openexchangerates 0.1.0 → 1.0.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: cf4cfe33f88cb15f7aac7664538030eb1e641583
4
- data.tar.gz: b351fc413bb57cb5133e9e776c4e7812906fb64f
2
+ SHA256:
3
+ metadata.gz: 073a5e3fbef0f030cac9577610c35d3a0ed5f1d4e20f3bcfce681540f50d4123
4
+ data.tar.gz: 35a64317c41a6fde09543f1fef2c39e48516593735ea5f7162922179f1082ea8
5
5
  SHA512:
6
- metadata.gz: 8342df7e4a1b05524709f4e999b1e8d4bc241638551fc62063450a32cf5f2d3354085b5f0bf5b5263ba7e005af554498b0f51b993d0da2e627bcc1ac24e4315c
7
- data.tar.gz: dfe39dce443625f2e1bd9463c4b835b025363aaeeec064b6c4cb94b0e5a30d496e793155a52b4605f92ff87edf5ef1af9a379bd745e669abfcc68e6ec0bd1843
6
+ metadata.gz: 151d33944d8763df3f46e19990b998a2769d96ec74ab9a0e45c15b8520c7a8d6ff84f29cd2dd2b78a5dfc5b29e492b6e8f6e3b5c605f5714f4605536ceba2346
7
+ data.tar.gz: 2d57a6fed6cd3395270ad848e0401c169583e2518c12608df93b7c74265149d7be49a97bc8df8d7fc16436316ad692d58f4294aeb7b4086780b1455a8e35a4ca
@@ -13,19 +13,19 @@ class OpenExchange
13
13
  end
14
14
 
15
15
  def get_latest()
16
- json = open("#{@@url}latest.json?app_id=#{@api_key}",
16
+ json = URI.open("#{@@url}latest.json?app_id=#{@api_key}",
17
17
  'User-Agent' => @user_agent).read
18
18
  return json
19
19
  end
20
20
 
21
21
  def get_old(date) # YYYY-MM-DD
22
- json = open("#{@@url}historical/#{date}.json?app_id=#{@api_key}",
22
+ json = URI.open("#{@@url}historical/#{date}.json?app_id=#{@api_key}",
23
23
  'User-Agent' => @user_agent).read
24
24
  return json
25
25
  end
26
26
 
27
27
  def get_currencies()
28
- json = open("#{@@url}currencies.json?app_id=#{@api_key}",
28
+ json = URI.open("#{@@url}currencies.json?app_id=#{@api_key}",
29
29
  'User-Agent' => @user_agent).read
30
30
  return json
31
31
  end
metadata CHANGED
@@ -1,50 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openexchangerates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2012-12-06 00:00:00.000000000 Z
11
+ date: 2024-04-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: '...'
14
- email:
15
- - iiiypuk@iiiypuk.me
13
+ description: "..."
14
+ email: iiiypuk@fastmail.fm
16
15
  executables: []
17
16
  extensions: []
18
17
  extra_rdoc_files: []
19
18
  files:
20
- - .gitignore
21
- - LICENSE
22
- - README.md
23
- - example.rb
24
19
  - lib/openexchangerates.rb
25
- - openexchangerates.gemspec
26
- homepage: https://github.com/IIIypuk/openexchangerates
20
+ homepage: https://git.a2s.su/iiiypuk/openexchangerates
27
21
  licenses:
28
22
  - MIT
29
23
  metadata: {}
30
- post_install_message:
24
+ post_install_message:
31
25
  rdoc_options: []
32
26
  require_paths:
33
27
  - lib
34
28
  required_ruby_version: !ruby/object:Gem::Requirement
35
29
  requirements:
36
- - - '>='
30
+ - - ">="
37
31
  - !ruby/object:Gem::Version
38
32
  version: '0'
39
33
  required_rubygems_version: !ruby/object:Gem::Requirement
40
34
  requirements:
41
- - - '>='
35
+ - - ">="
42
36
  - !ruby/object:Gem::Version
43
37
  version: '0'
44
38
  requirements: []
45
- rubyforge_project:
46
- rubygems_version: 2.1.11
47
- signing_key:
39
+ rubygems_version: 3.3.25
40
+ signing_key:
48
41
  specification_version: 4
49
42
  summary: Implementation API openexchangerates.org on Ruby
50
43
  test_files: []
data/.gitignore DELETED
@@ -1 +0,0 @@
1
- *.gem
data/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2013 Alexander Popov
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,12 +0,0 @@
1
- ### openexchangerates ###
2
- Implementation API openexchangerates.org on Ruby
3
-
4
- ### methods ###
5
- **1.** `get_latest()`
6
- Get the most recent exchange rates
7
-
8
- **2.** `get_currencies`
9
- get list of currency codes and names
10
-
11
- **3.** `get_old(date)`
12
- get rates for any given day, where available
data/example.rb DELETED
@@ -1,14 +0,0 @@
1
- require 'json'
2
- require 'time'
3
- require 'openexchangerates'
4
-
5
- currency = OpenExchange.new('586ee899f7eb4f79861589a1f00a8630')
6
- cur = JSON.parse(currency.get_latest)
7
- cur_old = JSON.parse(currency.get_old('2010-12-31'))
8
-
9
- cur_show = 'RUB'
10
-
11
- puts "#{Time.at(cur_old['timestamp'])} \n\t1 USD = #{cur['rates'][cur_show]} \
12
- #{JSON.parse(currency.get_currencies)[cur_show]}"
13
- puts "#{Time.at(cur['timestamp'])} \n\t1 USD = #{cur_old['rates'][cur_show]} \
14
- #{JSON.parse(currency.get_currencies)[cur_show]}"
@@ -1,14 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.name = 'openexchangerates'
3
- s.version = '0.1.0'
4
- s.date = '2012-12-06'
5
- s.summary = 'Implementation API openexchangerates.org on Ruby'
6
- s.description = '...'
7
- s.authors = ['Alexander Popov']
8
- s.email = ['iiiypuk@iiiypuk.me']
9
- s.homepage = 'https://github.com/IIIypuk/openexchangerates'
10
- s.license = 'MIT'
11
-
12
- s.files = `git ls-files`.split("\n")
13
- s.require_paths = ["lib"]
14
- end