justexchangerates 0.3.0 → 0.4.0

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
- SHA1:
3
- metadata.gz: 1571659794639751cd6da74bff7940ec151fdf79
4
- data.tar.gz: c676d5c2d029f620a15e667e1f8bbd3edca31e46
2
+ SHA256:
3
+ metadata.gz: 6cc728376fd613e145e8a5e25260793d42c180fc4371c5ca9fe8e5a2ec813a72
4
+ data.tar.gz: 8d6484ee483c96357f473433f3130b8fc716fdbe17416394496df61f6e94f45a
5
5
  SHA512:
6
- metadata.gz: 5eca2a98653e5cda26eac351eb253dd4bf359aeffb1c4b89c139bbe1b41c1b906f6eb4e37571edfb6a32febe51a9ece5c2ff57c8ad1b3da866dd2cc152139386
7
- data.tar.gz: 5ceb1dd8e8cbaa0b2bccdd3bc7f3a09bcf5d03d7da670263d74a74f45f845ffeae9359ebfcdf307b11c746ea75d2d681e4458e29dfb51509f2dd148d4f7efa5e
6
+ metadata.gz: 5b360cc811faaf3373152083403d5f16eab461c3c206e9781d9b6536fac4df94c1b3619f03550974f1ca3cb8e0f4b19803180ca47012d027bd79f9f17bef6bfa
7
+ data.tar.gz: 615440723123c9659e39e4139c99ee1a498a246bf05882f12f998bde735453a5b7cc6eef00059f2ff99df3677c12da808f24483e48c8c0a9ca57e456ace3c688
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- |ݝ�4)R�⮾sƌ0'R�ױ<��ANQ��33e�{��4KKM���ac$�B^U&�0��q�*+��'1���KAx�,3I {���2��Z5��)
1
+ 7��.x�O��JMg3Ŕ1 �!��P��@x���������$]j\e��iB�)4k7��3��"7�~�9\Gy%߭�پ�����,����Y��4��"64��H ;g���C��G"L������H0ԍ���z[�Cr�b5�����_]�?�������Ӏ�t�;�g���>i|"��J��u��B!A\�֍�I�����.�m�л��{;�� ܔ gؙL/1���4LS-�p|�2ʘ�,�\��.7�U�V��; tB �S6xܑ5Ut0Jo�}T\!�J���NH��8�al|��5�'��Zj.�8Dm��
data.tar.gz.sig CHANGED
Binary file
@@ -5,6 +5,7 @@
5
5
  require 'json'
6
6
  require 'open-uri'
7
7
  require 'chronic_duration'
8
+ require 'dynarex-password' # used by JustExchangeRatesPlus
8
9
  require 'open_exchange_rates'
9
10
 
10
11
 
@@ -68,9 +69,11 @@ class JustExchangeRates
68
69
  def fetch_rate(currency)
69
70
 
70
71
  puts 'inside fetch_rate' if @debug
71
- fx = OpenExchangeRates::Rates.new(:app_id => @app_id)
72
+ puts '@app_id: ' + @app_id.inspect if @debug
73
+
74
+ rate = OpenExchangeRates::Rates.new(app_id: @app_id)\
75
+ .exchange_rate(from: @base, to: currency)
72
76
 
73
- rate = fx.convert(1, :from => "USD", :to => currency)
74
77
  puts "currency: %s rate: %s" % [currency, rate] if @debug
75
78
 
76
79
  @rates[currency.upcase.to_sym] = [rate, Time.now.to_s]
@@ -81,3 +84,34 @@ class JustExchangeRates
81
84
  end
82
85
 
83
86
  end
87
+
88
+ class JustExchangeRatesPlus < JustExchangeRates
89
+
90
+
91
+ def initialize(reg, base: 'USD', cache_refresh: '1 week', cache_path: '.', \
92
+ debug: false)
93
+
94
+ @debug = debug
95
+
96
+ key = 'hkey_apps/justexchangerates'
97
+ e = reg.get_key(key)
98
+ @lookup_file = e.text('lookup_file').to_s
99
+
100
+ app_id = decipher(e.text('app_id').to_s)
101
+
102
+ if @debug then
103
+ puts app_id.inspect
104
+ end
105
+
106
+ super(base: 'USD', cache_refresh: '1 week', cache_path: '.', \
107
+ debug: debug, app_id: app_id)
108
+ end
109
+
110
+
111
+ private
112
+
113
+ def decipher(s)
114
+ DynarexPassword.new.reverse_lookup(s, @lookup_file)
115
+ end
116
+
117
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justexchangerates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,28 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EAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUABvnXdqz
26
+ neWCc/rJbHFU2PSxfvUwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
27
+ c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
28
+ BgkqhkiG9w0BAQsFAAOCAYEAGY+2a/R8otnOe3prMpoi33L3Zoy6uV60S+zzNdTN
29
+ DqFFwerdq+C5nmHfdffG0xCpLgRvHhXgBx7q1LmoKfLINFZEYzYNgNqL0xzv5nlP
30
+ awmuaLENq3AInjbtBTpb13OJ5KJjYZ3qhQUSXVv+5zMtRAOZNjgb/qM5FpooM8+B
31
+ KW8ZM9H7YsRCQn6+ufN4zLc4QjJfgoK17+mNl3DeGENaLFygOm5uzGcoXUI1dGIY
32
+ nCxB6LEW6e7+UPCDMp4GKgK0QA5pCf8eR9nTEDhvZA8GNLiHO8n1vkCsVCgBtWPR
33
+ qFw6Mug5QcTMnpyzF9WJ6HGlDcefBpjAzGPibP9qLlFvxYSofFUhYl72dIZyJ8Cg
34
+ wwirVUOBgWnpWF8THFG8m/pp/ZhhbBn6mlS0XR4Z+7rAzzvviQvBg54jPduk5h2z
35
+ 7DV4V4ArjIvHVPFk1NBNtMTP9/u5jcFbnXRm0K1puvzAOu94LU7xzQj+eRmUCOiL
36
+ Egnradf17FANvSHDTppAf9Pz
32
37
  -----END CERTIFICATE-----
33
- date: 2018-06-08 00:00:00.000000000 Z
38
+ date: 2021-05-03 00:00:00.000000000 Z
34
39
  dependencies:
40
+ - !ruby/object:Gem::Dependency
41
+ name: dynarex-password
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.2.0
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.2'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.2.0
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '0.2'
35
60
  - !ruby/object:Gem::Dependency
36
61
  name: chronic_duration
37
62
  requirement: !ruby/object:Gem::Requirement
@@ -73,7 +98,7 @@ dependencies:
73
98
  - !ruby/object:Gem::Version
74
99
  version: 0.5.1
75
100
  description:
76
- email: james@jamesrobertson.eu
101
+ email: digital.robertson@gmail.com
77
102
  executables: []
78
103
  extensions: []
79
104
  extra_rdoc_files: []
@@ -99,8 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
124
  version: '0'
100
125
  requirements: []
101
126
  rubyforge_project:
102
- rubygems_version: 2.6.13
127
+ rubygems_version: 2.7.10
103
128
  signing_key:
104
129
  specification_version: 4
105
- summary: Fetches the latest exchange rates using the API from http://fixer.io/
130
+ summary: Fetches the latest exchange rates using the open_exchange_rates gem.
106
131
  test_files: []
metadata.gz.sig CHANGED
Binary file