world_bank_fetcher 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
3
  require 'rspec/core/rake_task'
4
- require './lib/world_bank_fetcher'
4
+ require 'world_bank_fetcher'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
  # 'SP.POP.TOTL'
@@ -9,13 +9,11 @@ task :test => :spec
9
9
  task :default => :spec
10
10
 
11
11
  task :indicator, :indicator_code do |t, args|
12
- # puts "code is #{args[:indicator_code]}"
13
12
  puts WorldBankFetcher::Job.new(:indicator => args[:indicator_code]).fetch ? "QUERY SUCCESSFUL!" : "QUERY FAILURE!!!!!!!!!!"
14
13
  end
15
14
 
16
15
  task :countries do
17
16
  results = WorldBankFetcher::Job.new(:countries => true).fetch
18
17
  puts results ? "QUERY SUCCESSFUL!" : "QUERY FAILURE!!!!!!!!!!"
19
- # puts "here are results"
20
18
  puts "#{results}"
21
19
  end
@@ -15,9 +15,9 @@ module WorldBankFetcher
15
15
  data = fetch_all_data query
16
16
  if data
17
17
  if @job_type == :indicator
18
- @results = WorldBankFetcher::DataParser.parse data
18
+ @results = DataParser.parse data
19
19
  else
20
- @results = WordBankFetcher::CountryParser.parse data
20
+ @results = CountryParser.parse data
21
21
  end
22
22
 
23
23
  @checksum = Digest::MD5.hexdigest Marshal.dump(@results)
@@ -46,8 +46,8 @@ module WorldBankFetcher
46
46
  end
47
47
 
48
48
  def fetch_all_data(query)
49
- scheduler = WorldBankFetcher::QueryScheduler.new query
50
- query.per_page(WorldBankFetcher::MAXIMUM_BUFFER_SIZE)
49
+ scheduler = QueryScheduler.new query
50
+ query.per_page(MAXIMUM_BUFFER_SIZE)
51
51
  scheduler.execute!
52
52
  end
53
53
  end
@@ -8,7 +8,7 @@ module WorldBankFetcher
8
8
  end
9
9
 
10
10
  def execute!
11
- query.per_page(WorldBankFetcher::MAXIMUM_BUFFER_SIZE)
11
+ query.per_page(MAXIMUM_BUFFER_SIZE)
12
12
  begin
13
13
  if query.is_a? WorldBank::ParamQuery
14
14
  fetch_param_query!
@@ -42,7 +42,7 @@ module WorldBankFetcher
42
42
 
43
43
  def total_queries
44
44
  query.per_page(1).fetch unless query.total
45
- (query.total / WorldBankFetcher::MAXIMUM_BUFFER_SIZE.to_f).ceil
45
+ (query.total / MAXIMUM_BUFFER_SIZE.to_f).ceil
46
46
  end
47
47
 
48
48
  def results=(results)
@@ -1,3 +1,3 @@
1
1
  module WorldBankFetcher
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: world_bank_fetcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: