exchange_jpy 0.1.0 → 0.1.1
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 +4 -4
 - data/Gemfile.lock +2 -2
 - data/lib/exchange_jpy/version.rb +1 -1
 - data/lib/exchange_jpy.rb +11 -2
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 6205c51f13c38e17bdfb3b9077a445501f37e44f8ff18458b020da4eb6a21b0f
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a21db85816bfe914f0f1da27454af1101d3e012e63e48a92ec0aad43b66d5116
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 605792c07d7b92782e6420347592351fc2a4a038339ff7094d776691de6479ead856fc43f7945a411579ac8e793431f87be73e36a3ea468060d35a1b0cd4574c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ec82437ed766bea68f3bd048234671e621f90e3b9642a6c2b3a66ad7d3c333ff1866ded7cbcc53bd835362afbacbaebc6d4c371f0a849b5e2a256e71242d6ec0
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/lib/exchange_jpy/version.rb
    CHANGED
    
    
    
        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,7 +16,14 @@ class ExchangeJpyCLI < Thor 
     | 
|
| 
       14 
16 
     | 
    
         
             
                puts "Hello #{name}."
         
     | 
| 
       15 
17 
     | 
    
         
             
              end
         
     | 
| 
       16 
18 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
              desc " 
     | 
| 
      
 19 
     | 
    
         
            +
              desc "currency_code", "Indicates the url of the currency code table"
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 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"
         
     | 
| 
       18 
27 
     | 
    
         | 
| 
       19 
28 
     | 
    
         
             
              def currency_rate(currency_code)
         
     | 
| 
       20 
29 
     | 
    
         
             
                currency_code = ARGV[1] || "GBP"
         
     | 
| 
         @@ -27,7 +36,7 @@ class ExchangeJpyCLI < Thor 
     | 
|
| 
       27 
36 
     | 
    
         
             
                end
         
     | 
| 
       28 
37 
     | 
    
         
             
              end
         
     | 
| 
       29 
38 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
              desc "currency_jpy [currency_code] [money]", " 
     | 
| 
      
 39 
     | 
    
         
            +
              desc "currency_jpy [currency_code] [money]", "Exchange from [currency_code] to JPY"
         
     | 
| 
       31 
40 
     | 
    
         | 
| 
       32 
41 
     | 
    
         
             
              def currency_jpy(currency_code = ARGV[1] || "GBP", money = ARGV[2] || "1")
         
     | 
| 
       33 
42 
     | 
    
         
             
                currency_rate = CurrencyRate.new
         
     |