Package not found. Please check the package name and try again.

exchange-rates 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af442b2772c38fec370094edacede3e0568a1902
4
- data.tar.gz: 91c5ee082651b106ac27e11bea3738bf76ecb9ba
3
+ metadata.gz: 246f39e84964702bcde4cae4d14c168b1eefdc05
4
+ data.tar.gz: 820bebe34e7dd10089aef2697939ac22004e75c0
5
5
  SHA512:
6
- metadata.gz: 85ef5b40b8dd8aa5a8b70e4cb82aea4a53bea5b22493d0b0fe03fd3c080bb82783f573fe281ec58912d62dbc047e56fdbad28df66987ba7eddfc579720a662a8
7
- data.tar.gz: 4d555e63c5790fd95d46aa6b69dd8fff7d70540dd08d05e7a76c859f33dcda60fb0284b98821a7ac3e5ee7c75bd17f14b386b27195d4620c1a685c6e7766ef29
6
+ metadata.gz: b38a7fee2a44b78bd03fd7b3c3a1253f640eccc66b11c6b2bd67070a3bce005cc1c034e22dccd7b49b44207f46333de594827b53bbb948e952e3c38887584f2b
7
+ data.tar.gz: 0b2bdc744a97e51f4856967038727177586283c1f3bb532eb2b897e0b6618a5a466fbdfb097a268dac672bfa8078dd052e5be60a3b057122d3a8459ccd2b792e
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # ExchangeRates
2
2
 
3
+ ## Before
4
+
5
+ Sign up on [Open Exchange Rate](https://openexchangerates.org/signup/free), and get App ID
6
+
7
+
3
8
  ## Installation
4
9
 
5
10
  ```
@@ -27,7 +32,7 @@ rake db:migrate
27
32
  Fetch Currency data and save to database
28
33
 
29
34
  ```
30
- rake exchange_rates:update
35
+ OPEN_EXCHANGE_RATES_APP_ID=XXXXXXXX rake exchange_rates:update
31
36
  ```
32
37
 
33
38
  ### Usage
@@ -1,3 +1,3 @@
1
1
  module ExchangeRates
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -3,14 +3,17 @@
3
3
  # # Task goes here
4
4
  # end
5
5
  require 'money'
6
- require 'money/bank/google_currency'
6
+ require 'money/bank/open_exchange_rates_bank'
7
7
  namespace :exchange_rates do
8
8
  desc 'update exchange rate'
9
9
  task update: :environment do
10
10
  puts '*****************************************'
11
11
  puts '--- update start ---'
12
- Money::Bank::GoogleCurrency.ttl_in_seconds = 86400
13
- Money.default_bank = Money::Bank::GoogleCurrency.new
12
+ oxr = Money::Bank::OpenExchangeRatesBank.new
13
+ oxr.app_id = ENV['OPEN_EXCHANGE_RATES_APP_ID']
14
+ oxr.update_rates
15
+ oxr.ttl_in_seconds = 86400
16
+ Money.default_bank = oxr
14
17
 
15
18
  currencies = Money::Currency.table.map{|c| c[0].to_s.upcase}
16
19
  currencies.delete('')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exchange-rates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - aloha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-30 00:00:00.000000000 Z
11
+ date: 2018-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 6.7.1
41
41
  - !ruby/object:Gem::Dependency
42
- name: google_currency
42
+ name: money-open-exchange-rates
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.4.0
47
+ version: 1.2.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.4.0
54
+ version: 1.2.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pg
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,8 @@ homepage: https://github.com/easyship/exchange-rates
126
126
  licenses:
127
127
  - MIT
128
128
  metadata: {}
129
- post_install_message:
129
+ post_install_message: "\n If you install 0.0.4 or newer, make sure you have OPEN_EXCHANGE_RATES_APP_ID\n
130
+ \ You can sign up for free: https://openexchangerates.org/signup/free\n "
130
131
  rdoc_options: []
131
132
  require_paths:
132
133
  - lib
@@ -147,43 +148,43 @@ signing_key:
147
148
  specification_version: 4
148
149
  summary: Rails ExchangeRates Helper
149
150
  test_files:
151
+ - test/dummy/app/controllers/application_controller.rb
152
+ - test/dummy/app/views/layouts/application.html.erb
150
153
  - test/dummy/app/assets/javascripts/application.js
151
154
  - test/dummy/app/assets/stylesheets/application.css
152
- - test/dummy/app/controllers/application_controller.rb
153
155
  - test/dummy/app/helpers/application_helper.rb
154
- - test/dummy/app/views/layouts/application.html.erb
155
- - test/dummy/bin/bundle
156
- - test/dummy/bin/rails
157
156
  - test/dummy/bin/rake
158
157
  - test/dummy/bin/setup
159
- - test/dummy/config/application.rb
160
- - test/dummy/config/boot.rb
161
- - test/dummy/config/database.yml
162
- - test/dummy/config/environment.rb
163
- - test/dummy/config/environments/development.rb
158
+ - test/dummy/bin/bundle
159
+ - test/dummy/bin/rails
160
+ - test/dummy/config/secrets.yml
161
+ - test/dummy/config/routes.rb
162
+ - test/dummy/config/locales/en.yml
164
163
  - test/dummy/config/environments/production.rb
164
+ - test/dummy/config/environments/development.rb
165
165
  - test/dummy/config/environments/test.rb
166
- - test/dummy/config/initializers/assets.rb
166
+ - test/dummy/config/environment.rb
167
+ - test/dummy/config/application.rb
168
+ - test/dummy/config/database.yml
169
+ - test/dummy/config/boot.rb
167
170
  - test/dummy/config/initializers/backtrace_silencers.rb
168
- - test/dummy/config/initializers/cookies_serializer.rb
169
- - test/dummy/config/initializers/filter_parameter_logging.rb
170
- - test/dummy/config/initializers/inflections.rb
171
171
  - test/dummy/config/initializers/mime_types.rb
172
+ - test/dummy/config/initializers/filter_parameter_logging.rb
172
173
  - test/dummy/config/initializers/session_store.rb
173
174
  - test/dummy/config/initializers/wrap_parameters.rb
174
- - test/dummy/config/locales/en.yml
175
- - test/dummy/config/routes.rb
176
- - test/dummy/config/secrets.yml
175
+ - test/dummy/config/initializers/assets.rb
176
+ - test/dummy/config/initializers/cookies_serializer.rb
177
+ - test/dummy/config/initializers/inflections.rb
177
178
  - test/dummy/config.ru
178
- - test/dummy/db/migrate/20160707090951_create_exchange_rates.exchange_rates.rb
179
- - test/dummy/db/schema.rb
180
- - test/dummy/log/development.log
181
- - test/dummy/public/404.html
179
+ - test/dummy/Rakefile
180
+ - test/dummy/public/favicon.ico
182
181
  - test/dummy/public/422.html
183
182
  - test/dummy/public/500.html
184
- - test/dummy/public/favicon.ico
185
- - test/dummy/Rakefile
186
- - test/dummy/README.rdoc
183
+ - test/dummy/public/404.html
184
+ - test/dummy/db/schema.rb
185
+ - test/dummy/db/migrate/20160707090951_create_exchange_rates.exchange_rates.rb
186
+ - test/dummy/log/development.log
187
187
  - test/dummy/tmp/cache/428/4B0/twd_to_hkd
188
+ - test/dummy/README.rdoc
188
189
  - test/exchange_rates_test.rb
189
190
  - test/test_helper.rb