exrt-cli 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: 5f851778e3abcd433901d59bd541f372d95f613fc155c09e44e8657181189be4
4
- data.tar.gz: bb439ba70a8d027320f6573e65999281378e93c364d98a9322f3f3f5c29da1ee
3
+ metadata.gz: ce8e45b2ac50a95f7e030f0cb0d88a829a5c612e6e0498b604b1d2ecaaab0d1a
4
+ data.tar.gz: afb38cbb91dba67147a0c04f63f8bdc5b4a710da747bb604196e5f40f74e17e3
5
5
  SHA512:
6
- metadata.gz: 5fc745c8a188d2cd88430daa25e999d1800bb0046b9489089181b0cafaf484517855fbcc7c5868c07d4a9eb2217f4719a49fba4f513d002ec3632cf7fdbc3263
7
- data.tar.gz: 9275929c350de58f9eeeabb700a2f989b5b9a17b8337915742a41f919c8e8f783d7bcc8612bc67826dc9355b6a58cc0babc440a5f805b4352c211fae67cba77e
6
+ metadata.gz: bc9c6b2af83d6f86767779fe29fde3420ed048f79161fb9736ead8e6854d481462d3ca3c5e449c7a4b5e67e39b54fb77905524b694a569160c8452d48c56484e
7
+ data.tar.gz: 26b42c868b0becd4e007b5b8bfdb1c4975e8829843071c14e8555860cd53efa955659dba1c57c62d1fad6dfdf04ac58325f7cef071edad82de86f78e866252ca
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- exrt-cli (0.2.0)
5
- exrt (~> 0.1)
4
+ exrt-cli (0.2.1)
5
+ exrt (~> 0.1.1)
6
6
  thor (~> 0.20)
7
7
  tty-table (~> 0.10)
8
8
 
@@ -11,7 +11,7 @@ GEM
11
11
  specs:
12
12
  diff-lcs (1.3)
13
13
  equatable (0.5.0)
14
- exrt (0.1.0)
14
+ exrt (0.1.1)
15
15
  faraday (~> 0.15)
16
16
  faraday (0.15.4)
17
17
  multipart-post (>= 1.2, < 3)
data/README.md CHANGED
@@ -1,35 +1,27 @@
1
1
  # Exrt::Cli
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/exrt/cli`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Get latest and historical exchange rates published by the [European Central Bank](https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html) in your command line.
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'exrt-cli'
13
- ```
14
-
15
- And then execute:
7
+ $ gem install exrt-cli
16
8
 
17
- $ bundle
9
+ ## Usage
18
10
 
19
- Or install it yourself as:
11
+ ### Latest
20
12
 
21
- $ gem install exrt-cli
13
+ $ exrt-cli latest --symbols CNY
22
14
 
23
- ## Usage
15
+ ### History
24
16
 
25
- TODO: Write usage instructions here
17
+ $ exrt-cli history --symbols CNY --start_at 2019-02-15 --end_at 2019-02-28
26
18
 
27
- ## Development
19
+ ## Related Projects
28
20
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
21
+ Core: [exrt](https://github.com/al002/exrt)
30
22
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
23
+ API Provider: [exchangeratesapi](https://github.com/exchangeratesapi/exchangeratesapi)
32
24
 
33
25
  ## Contributing
34
26
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/exrt-cli.
27
+ Bug reports and pull requests are welcome on GitHub at https://github.com/al002/exrt-cli.
@@ -12,6 +12,8 @@ Gem::Specification.new do |spec|
12
12
  spec.summary = "Exchange rate commad line tool"
13
13
  spec.homepage = "https://github.com/al002/exrt-cli"
14
14
 
15
+ spec.license = 'GPL-3.0'
16
+
15
17
  # Specify which files should be added to the gem when it is released.
16
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
19
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
@@ -23,7 +25,7 @@ Gem::Specification.new do |spec|
23
25
 
24
26
  spec.add_dependency "thor", "~> 0.20"
25
27
  spec.add_dependency "tty-table", "~> 0.10"
26
- spec.add_dependency "exrt", "~> 0.1"
28
+ spec.add_dependency "exrt", "~> 0.1.1"
27
29
 
28
30
  spec.add_development_dependency "bundler", "~> 2.0"
29
31
  spec.add_development_dependency "rake", "~> 10.0"
@@ -5,9 +5,8 @@ module Exrt
5
5
  module Cli
6
6
  class Format
7
7
  def self.latest(response)
8
- r = self.to_json(response)
9
8
  rows = []
10
- r['rates'].each do |symbol, value|
9
+ response['rates'].each do |symbol, value|
11
10
  rows.append([symbol, value])
12
11
  end
13
12
 
@@ -15,9 +14,8 @@ module Exrt
15
14
  end
16
15
 
17
16
  def self.history(response)
18
- r = self.to_json(response)
19
17
  rows = []
20
- r['rates'].each do |date, rates|
18
+ response['rates'].each do |date, rates|
21
19
  row = [date]
22
20
  rates.each do |symbol, rate|
23
21
  row.prepend(symbol, rate)
@@ -28,10 +26,6 @@ module Exrt
28
26
 
29
27
  rows
30
28
  end
31
-
32
- def self.to_json(resp)
33
- JSON.parse(resp)
34
- end
35
29
  end
36
30
  end
37
31
  end
@@ -1,5 +1,5 @@
1
1
  module Exrt
2
2
  module Cli
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exrt-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - al002
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.1'
47
+ version: 0.1.1
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: '0.1'
54
+ version: 0.1.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -119,7 +119,8 @@ files:
119
119
  - lib/exrt/cli/renderer.rb
120
120
  - lib/exrt/cli/version.rb
121
121
  homepage: https://github.com/al002/exrt-cli
122
- licenses: []
122
+ licenses:
123
+ - GPL-3.0
123
124
  metadata: {}
124
125
  post_install_message:
125
126
  rdoc_options: []
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  - !ruby/object:Gem::Version
137
138
  version: '0'
138
139
  requirements: []
139
- rubygems_version: 3.0.1
140
+ rubygems_version: 3.0.2
140
141
  signing_key:
141
142
  specification_version: 4
142
143
  summary: Exchange rate commad line tool