Class: Gemat::Fetcher
- Inherits:
-
Object
- Object
- Gemat::Fetcher
- Defined in:
- lib/fetcher.rb
Instance Attribute Summary collapse
-
#gems ⇒ Object
Returns the value of attribute gems.
Instance Method Summary collapse
-
#initialize(dsl) ⇒ Fetcher
constructor
A new instance of Fetcher.
- #run ⇒ Object
Constructor Details
#initialize(dsl) ⇒ Fetcher
Returns a new instance of Fetcher.
7 8 9 10 |
# File 'lib/fetcher.rb', line 7 def initialize(dsl) @dsl = dsl @gems = [] end |
Instance Attribute Details
#gems ⇒ Object
Returns the value of attribute gems.
5 6 7 |
# File 'lib/fetcher.rb', line 5 def gems @gems end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fetcher.rb', line 12 def run pb = ProgressBar.create(total: @dsl.dependencies.length) @dsl.dependencies.each_with_index do |dependency, idx| pb.increment response = fetch_rubygems(dependency) next unless response create_gem(response, idx) sleep 0.2 end end |