exchange_jpy 0.1.0 → 0.1.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: 95cefee42fd385913f44a9b5b5b28e7926026d17d08e75759384c726c95f6133
4
- data.tar.gz: c1e0c35f2d8e4ef47dd4041d18e65880985d9fefb38c051fd398e2a23f50aff2
3
+ metadata.gz: b76e8e773bfd0fcb38fe50a22773d44f7ae4a20018834fbb28075d36b194574b
4
+ data.tar.gz: 99ead04d1efcfa78120a7abcd3d9b30987dc5f97e99a9d74edbfea99081492f2
5
5
  SHA512:
6
- metadata.gz: 37c02beab0f92ccf7878e90b1b53a945e66bc0a03c79a8a68e4f217c430288e99b9dbdb6575f177a2b6e8dccad1da80729b17e9b6f22d3aa269b0ace01bf2c8e
7
- data.tar.gz: 0ad328671a4fadefcfe8bc93eee1a85448054c3d6ed8bd2133b74fb0082a5af1c833df60d79932fd08f0d2fc5098bab27e8ce2523ecabe242b410d999ba4aab6
6
+ metadata.gz: 7d343d666dda4bb04c8b71e2af9eb56e48b4b790cd53038a07ca69fdf347d6351b3fde8fd15e69cc49b9801b88727ae5b150f1e650493f539657e283ca06484b
7
+ data.tar.gz: c30c20d339ef6ccfa57ceec34449c75d653221f0580bd04a26d08f31aacd0b61633e6dfd382d9d7b55d6edba89d486e00cfe40b886a8a6d9a55c8e3d0b1923b6
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- exchange_jpy (0.1.0)
4
+ exchange_jpy (0.1.1)
5
5
  thor
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- power_assert (1.2.0)
10
+ power_assert (2.0.2)
11
11
  rake (13.0.6)
12
- test-unit (3.3.7)
12
+ test-unit (3.5.7)
13
13
  power_assert
14
14
  thor (1.2.1)
15
15
 
data/exchange_jpy.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Yoshimasa Yuri"]
9
9
  spec.email = ["yurimore.tm@gmail.com"]
10
10
 
11
- spec.summary = "Show Exchange Rates."
11
+ spec.summary = "Show current exchange rate from currency_code to JPY."
12
12
  spec.description = "Show Exchange Rates."
13
13
  #spec.homepage = "TODO: Put your gem's website or public repo URL here."
14
14
  spec.license = "MIT"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExchangeJpy
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/exchange_jpy.rb CHANGED
@@ -2,6 +2,8 @@
2
2
  require "thor"
3
3
  require "uri"
4
4
  require "net/http"
5
+ require "open-uri"
6
+ #require "colorize"
5
7
  require_relative "exchange_jpy/version"
6
8
  require_relative "currency_rate"
7
9
 
@@ -14,10 +16,17 @@ class ExchangeJpyCLI < Thor
14
16
  puts "Hello #{name}."
15
17
  end
16
18
 
17
- desc "currency_rate [currency_code]", "show current exchange rate to JPY"
19
+ desc "currency_code", "Indicates the url of the currency code table"
18
20
 
19
- def currency_rate(currency_code)
20
- currency_code = ARGV[1] || "GBP"
21
+ def currency_code
22
+ str = "https://www.iban.jp/currency-codes"
23
+ print("Access to ", str)
24
+ end
25
+
26
+ desc "currency_rate [currency_code]", "Show current exchange rate from [currency_code] to JPY"
27
+
28
+ def currency_rate(currency_code = ARGV[1] || "GBP")
29
+ #currency_code =
21
30
  currency_rate = CurrencyRate.new
22
31
  jpy = currency_rate.currency_rate(currency_code)
23
32
  if (jpy == nil)
@@ -27,9 +36,9 @@ class ExchangeJpyCLI < Thor
27
36
  end
28
37
  end
29
38
 
30
- desc "currency_jpy [currency_code] [money]", "exchange to JPY"
39
+ desc "exchange [currency_code] [amount]", "Exchange [currency_code] [amount] into JPY"
31
40
 
32
- def currency_jpy(currency_code = ARGV[1] || "GBP", money = ARGV[2] || "1")
41
+ def exchange(currency_code = ARGV[1] || "GBP", money = ARGV[2] || "1")
33
42
  currency_rate = CurrencyRate.new
34
43
  jpy = currency_rate.currency_rate(currency_code)
35
44
  if (jpy == nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exchange_jpy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshimasa Yuri
@@ -71,5 +71,5 @@ requirements: []
71
71
  rubygems_version: 3.2.32
72
72
  signing_key:
73
73
  specification_version: 4
74
- summary: Show Exchange Rates.
74
+ summary: Show current exchange rate from currency_code to JPY.
75
75
  test_files: []