exchange-rates 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 247519e91646b574f04f5f84786ffee9f5e2f269
4
- data.tar.gz: 4527f4ca6bc692347cb946b77aa3e7c98dbea10e
3
+ metadata.gz: 4160ab1da0698999714632f1347e49dc0be267c4
4
+ data.tar.gz: d72de44c4301e21157ee4666bae1ccd9d458f044
5
5
  SHA512:
6
- metadata.gz: 42c7650bcf6aa805d0e2c2aead74f9eab83ae490f226571a40533a2a41857cb939234bc5ba21e388ec0d94947c4cde00788af2ab1f379fc26f450d955bd1d5cc
7
- data.tar.gz: 89178a838803279c9e7beb24ecd2af01505dd6c6c0755aed1feb2ea38648c5832dbc26bd91a5d117a4b3ed5d94ce866f94e82425d044342455d839c060b86e0b
6
+ metadata.gz: f158e8fa335e0a7e2357cf21910c5396b74a93b7f65cca2af62cfd38cc37ffbbb3a9ff4be427afd93f146122fc182dc0d7732a31f915e90f08c2c879c4f1abf0
7
+ data.tar.gz: 4dba6521a317a1d395738494e8cf590c2f6619308e1925e2c106c203354455362bb6e576b8969e6f793905d556de9a294f6bcbaf62c8d9f3f49a50ff28108959
data/README.md CHANGED
@@ -36,4 +36,47 @@ rake exchange_rates:update
36
36
  ExchangeRates::Rate.convert(1000, 'TWD', 'HKD')
37
37
  ```
38
38
 
39
+ #### Testing
40
+
41
+ if in your rspec or minitest, you might need add these lines
42
+
43
+ *spec/factories/exchange_rates.rb*
44
+
45
+ ```
46
+ FactoryGirl.define do
47
+ factory :exchange_rate_usd, class: ExchangeRates::Rate do
48
+ from_currency 'USD'
49
+ rate_to_base_currency '7'
50
+ end
51
+
52
+ factory :exchange_rate_thb, class: ExchangeRates::Rate do
53
+ from_currency 'THB'
54
+ rate_to_base_currency '0.2'
55
+ end
56
+
57
+ factory :exchange_rate_hkd, class: ExchangeRates::Rate do
58
+ from_currency 'HKD'
59
+ rate_to_base_currency '1'
60
+ end
61
+
62
+ # ... depend on what you need
63
+ end
64
+ ```
65
+ *spec/rails_helper.rb*
66
+
67
+ ```
68
+ RSpec.configure do |config|
69
+
70
+ # ...
71
+
72
+ config.before(:each) do
73
+ create(:exchange_rate_hkd); create(:exchange_rate_thb); create(:exchange_rate_usd);
74
+ end
75
+
76
+ # ...
77
+ end
78
+
79
+ ```
80
+
81
+
39
82
  This project rocks and uses MIT-LICENSE.
@@ -1,3 +1,3 @@
1
1
  module ExchangeRates
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -22,6 +22,10 @@ namespace :exchange_rates do
22
22
  if exchange_rate.new_record? || exchange_rate.changed?
23
23
  exchange_rate.save
24
24
  puts "--- #{currency} has been updated---"
25
+ puts '*****************************************'
26
+
27
+ puts "--- Clean Cache: #{currency.downcase}_to_#{ExchangeRates::Rate::BASE_CURRENCY.downcase}---"
28
+ Rails.cache.delete("#{currency.downcase}_to_#{ExchangeRates::Rate::BASE_CURRENCY.downcase}")
25
29
  else
26
30
  puts "--- nothing to update for #{currency} ---"
27
31
  end
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - aloha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-07 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.4.5.1
145
+ rubygems_version: 2.6.11
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: Rails ExchangeRates Helper