Socket
Socket
Sign inDemoInstall

each_with_anim

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

each_with_anim


Version published
Maintainers
1
Created
Source

each_with_anim

RubyのCUI上でループ時のアニメーションが簡単に作れるメソッドです。
ループが終了する予測時間も測定してくれます。

Each_with_anim is easiest to make progress bar and other cool animations in CUI.

anim

Installation

$ gem install each_with_anim

Usage

each_with_animは,アニメーションを表示する以外は基本的にeachと同じ振る舞いをします。
Use "each_with_anim" like "each" method.

require "each_with_anim"

list = %w(hage hoge foo) * 1000
list.each_with_anim do |elem|
  #something
end

もちろんwith_indexとかも使えます。
あとeach_with_animationはeach_with_animのエイリアスになってます。ただ長いので非推奨。
also, if you want to use "with_index",

list = %w(hage hoge foo) * 1000
list.each_with_animation.with_index do |elem,i|
  #something
end

同様に,引数を取ってアニメーションを変えることができます。今はまだ2つだけ。
暇なときに増やして行きます。
if you want to change animation,

list = %w(hage hoge foo) * 1000
list.each_with_anim(1) do |elem|
  #something
end

change_anim

Problem

each_with_anim内でprintすると表示がバグります。
解決策を絶賛探し中。

list = %w(hage hoge foo) * 10
list.each_with_anim do |elem|
    puts "piyoo"
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/7rpn/each_with_anim. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

なんでもok
すごい顔文字師がいたら助けてください笑

License

The gem is available as open source under the terms of the MIT License.

自由に使ってください。

FAQs

Package last updated on 07 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc