openexchangerates 0.0.1 → 1.0.0

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
- SHA1:
3
- metadata.gz: e5ad184a4401e48b91d5f702cfad79640d5723d3
4
- data.tar.gz: 9b7808468a8f66b03f80c6ae5c883b7f260d7c6c
2
+ SHA256:
3
+ metadata.gz: 073a5e3fbef0f030cac9577610c35d3a0ed5f1d4e20f3bcfce681540f50d4123
4
+ data.tar.gz: 35a64317c41a6fde09543f1fef2c39e48516593735ea5f7162922179f1082ea8
5
5
  SHA512:
6
- metadata.gz: 83596f0c83b1cc258efcc56629d4437a1920431223f9c30e050dcc30f07d2229400d5920124fce4f51b5431bc00af5068292b1459fc500f71e0eaa9df7173f16
7
- data.tar.gz: 8f382404e453ae87fe9370f79ac4bbaa0f0f62fdaed291bd48c803ab43cb663106994783fc60338121be8cad475e536b0e014b24c7a9baa0176139e4cfde5b3e
6
+ metadata.gz: 151d33944d8763df3f46e19990b998a2769d96ec74ab9a0e45c15b8520c7a8d6ff84f29cd2dd2b78a5dfc5b29e492b6e8f6e3b5c605f5714f4605536ceba2346
7
+ data.tar.gz: 2d57a6fed6cd3395270ad848e0401c169583e2518c12608df93b7c74265149d7be49a97bc8df8d7fc16436316ad692d58f4294aeb7b4086780b1455a8e35a4ca
@@ -13,18 +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
+ return json
24
25
  end
25
26
 
26
27
  def get_currencies()
27
- json = open("#{@@url}currencies.json?app_id=#{@api_key}",
28
+ json = URI.open("#{@@url}currencies.json?app_id=#{@api_key}",
28
29
  'User-Agent' => @user_agent).read
29
30
  return json
30
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.0.1
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: Implementation API openexchangerates.org on Ruby
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,4 +0,0 @@
1
- openexchangerates
2
- =================
3
-
4
- Implementation API openexchangerates.org on Ruby
data/example.rb DELETED
@@ -1,12 +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
-
8
- cur_show = 'RUB'
9
-
10
- puts "Latest update: #{Time.at(cur['timestamp'])}"
11
- puts "1 USD = #{cur['rates'][cur_show]} \
12
- (#{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.0.1'
4
- s.date = '2012-12-06'
5
- s.summary = 'Implementation API openexchangerates.org on Ruby'
6
- s.description = 'Implementation API openexchangerates.org on Ruby'
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