world_time_api 0.1.2 → 0.1.3
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/CHANGELOG.md +4 -0
 - data/lib/world_time_api/version.rb +1 -1
 - data/lib/world_time_api.rb +12 -3
 - metadata +3 -10
 - data/.rspec +0 -3
 - data/.rubocop.yml +0 -13
 - data/Gemfile +0 -9
 - data/Gemfile.lock +0 -63
 - data/Rakefile +0 -8
 - data/bin/console +0 -15
 - data/bin/setup +0 -8
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 688543e3e6815aded60389f8381436089c6eb712fc5f65468679f7c5e46a5791
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a9d28f71ad6119736a10ef6a65d93319df4b0cd644730f25b5a66be952a1d176
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f8ae900b130a2aceffed6da40ea2a3e5e21d1503e86d144d08fed88da6dfb230f64cc514130f0ccc290c3aba02f64bf3fed2cde30ed55698d65f84eec6f7a620
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d113975484b37528c64d2d78c97a755c223ec8d9442cfb5aa96a496dd5b6ced41b2d51b9b72ec95aeb0ca5ebae12325576cd43f8b4396cd59777de98a0b4475a
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/lib/world_time_api.rb
    CHANGED
    
    | 
         @@ -7,10 +7,10 @@ require "httparty" 
     | 
|
| 
       7 
7 
     | 
    
         
             
            module WorldTimeApi
         
     | 
| 
       8 
8 
     | 
    
         
             
              include HTTParty
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
              base_uri "http://worldtimeapi.org/api 
     | 
| 
      
 10 
     | 
    
         
            +
              base_uri "http://worldtimeapi.org/api"
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
              def self.timezones
         
     | 
| 
       13 
     | 
    
         
            -
                response = get("/")
         
     | 
| 
      
 13 
     | 
    
         
            +
                response = get("/timezone")
         
     | 
| 
       14 
14 
     | 
    
         
             
                return "Consult Error" if response.code != 200
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                response.parsed_response
         
     | 
| 
         @@ -19,11 +19,20 @@ module WorldTimeApi 
     | 
|
| 
       19 
19 
     | 
    
         
             
              end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
              def self.time(zone_name)
         
     | 
| 
       22 
     | 
    
         
            -
                response = get("/#{zone_name}")
         
     | 
| 
      
 22 
     | 
    
         
            +
                response = get("/timezone/#{zone_name}")
         
     | 
| 
       23 
23 
     | 
    
         
             
                return "Invalid Zone Name" if response.code != 200
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
25 
     | 
    
         
             
                response.parsed_response
         
     | 
| 
       26 
26 
     | 
    
         
             
              rescue StandardError
         
     | 
| 
       27 
27 
     | 
    
         
             
                "Error of connection"
         
     | 
| 
       28 
28 
     | 
    
         
             
              end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              def self.client_ip(ip = nil)
         
     | 
| 
      
 31 
     | 
    
         
            +
                response = ip.nil? ? get("/ip") : get("/ip/#{ip}")
         
     | 
| 
      
 32 
     | 
    
         
            +
                return "Invalid IP" if response.code != 200
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                response.parsed_response
         
     | 
| 
      
 35 
     | 
    
         
            +
              rescue StandardError
         
     | 
| 
      
 36 
     | 
    
         
            +
                "Error of connection"
         
     | 
| 
      
 37 
     | 
    
         
            +
              end
         
     | 
| 
       29 
38 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: world_time_api
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Alef Ojeda de Oliveira
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2023-02- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-02-12 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rake
         
     | 
| 
         @@ -59,17 +59,10 @@ executables: [] 
     | 
|
| 
       59 
59 
     | 
    
         
             
            extensions: []
         
     | 
| 
       60 
60 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       61 
61 
     | 
    
         
             
            files:
         
     | 
| 
       62 
     | 
    
         
            -
            - ".rspec"
         
     | 
| 
       63 
     | 
    
         
            -
            - ".rubocop.yml"
         
     | 
| 
       64 
62 
     | 
    
         
             
            - CHANGELOG.md
         
     | 
| 
       65 
63 
     | 
    
         
             
            - CODE_OF_CONDUCT.md
         
     | 
| 
       66 
     | 
    
         
            -
            - Gemfile
         
     | 
| 
       67 
     | 
    
         
            -
            - Gemfile.lock
         
     | 
| 
       68 
64 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       69 
65 
     | 
    
         
             
            - README.md
         
     | 
| 
       70 
     | 
    
         
            -
            - Rakefile
         
     | 
| 
       71 
     | 
    
         
            -
            - bin/console
         
     | 
| 
       72 
     | 
    
         
            -
            - bin/setup
         
     | 
| 
       73 
66 
     | 
    
         
             
            - lib/world_time_api.rb
         
     | 
| 
       74 
67 
     | 
    
         
             
            - lib/world_time_api/version.rb
         
     | 
| 
       75 
68 
     | 
    
         
             
            homepage: https://github.com/nemuba/world_time_api
         
     | 
| 
         @@ -94,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       94 
87 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       95 
88 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       96 
89 
     | 
    
         
             
            requirements: []
         
     | 
| 
       97 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 90 
     | 
    
         
            +
            rubygems_version: 3.0.9
         
     | 
| 
       98 
91 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       99 
92 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       100 
93 
     | 
    
         
             
            summary: Api World Time
         
     | 
    
        data/.rspec
    DELETED
    
    
    
        data/.rubocop.yml
    DELETED
    
    
    
        data/Gemfile
    DELETED
    
    
    
        data/Gemfile.lock
    DELETED
    
    | 
         @@ -1,63 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            PATH
         
     | 
| 
       2 
     | 
    
         
            -
              remote: .
         
     | 
| 
       3 
     | 
    
         
            -
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                world_time_api (0.1.2)
         
     | 
| 
       5 
     | 
    
         
            -
                  httparty (~> 0.20)
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            GEM
         
     | 
| 
       8 
     | 
    
         
            -
              remote: https://rubygems.org/
         
     | 
| 
       9 
     | 
    
         
            -
              specs:
         
     | 
| 
       10 
     | 
    
         
            -
                ast (2.4.2)
         
     | 
| 
       11 
     | 
    
         
            -
                diff-lcs (1.4.4)
         
     | 
| 
       12 
     | 
    
         
            -
                httparty (0.21.0)
         
     | 
| 
       13 
     | 
    
         
            -
                  mini_mime (>= 1.0.0)
         
     | 
| 
       14 
     | 
    
         
            -
                  multi_xml (>= 0.5.2)
         
     | 
| 
       15 
     | 
    
         
            -
                mini_mime (1.1.2)
         
     | 
| 
       16 
     | 
    
         
            -
                multi_xml (0.6.0)
         
     | 
| 
       17 
     | 
    
         
            -
                parallel (1.21.0)
         
     | 
| 
       18 
     | 
    
         
            -
                parser (3.0.2.0)
         
     | 
| 
       19 
     | 
    
         
            -
                  ast (~> 2.4.1)
         
     | 
| 
       20 
     | 
    
         
            -
                rainbow (3.0.0)
         
     | 
| 
       21 
     | 
    
         
            -
                rake (13.0.6)
         
     | 
| 
       22 
     | 
    
         
            -
                regexp_parser (2.1.1)
         
     | 
| 
       23 
     | 
    
         
            -
                rexml (3.2.5)
         
     | 
| 
       24 
     | 
    
         
            -
                rspec (3.10.0)
         
     | 
| 
       25 
     | 
    
         
            -
                  rspec-core (~> 3.10.0)
         
     | 
| 
       26 
     | 
    
         
            -
                  rspec-expectations (~> 3.10.0)
         
     | 
| 
       27 
     | 
    
         
            -
                  rspec-mocks (~> 3.10.0)
         
     | 
| 
       28 
     | 
    
         
            -
                rspec-core (3.10.1)
         
     | 
| 
       29 
     | 
    
         
            -
                  rspec-support (~> 3.10.0)
         
     | 
| 
       30 
     | 
    
         
            -
                rspec-expectations (3.10.1)
         
     | 
| 
       31 
     | 
    
         
            -
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
       32 
     | 
    
         
            -
                  rspec-support (~> 3.10.0)
         
     | 
| 
       33 
     | 
    
         
            -
                rspec-mocks (3.10.2)
         
     | 
| 
       34 
     | 
    
         
            -
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
       35 
     | 
    
         
            -
                  rspec-support (~> 3.10.0)
         
     | 
| 
       36 
     | 
    
         
            -
                rspec-support (3.10.3)
         
     | 
| 
       37 
     | 
    
         
            -
                rubocop (1.23.0)
         
     | 
| 
       38 
     | 
    
         
            -
                  parallel (~> 1.10)
         
     | 
| 
       39 
     | 
    
         
            -
                  parser (>= 3.0.0.0)
         
     | 
| 
       40 
     | 
    
         
            -
                  rainbow (>= 2.2.2, < 4.0)
         
     | 
| 
       41 
     | 
    
         
            -
                  regexp_parser (>= 1.8, < 3.0)
         
     | 
| 
       42 
     | 
    
         
            -
                  rexml
         
     | 
| 
       43 
     | 
    
         
            -
                  rubocop-ast (>= 1.12.0, < 2.0)
         
     | 
| 
       44 
     | 
    
         
            -
                  ruby-progressbar (~> 1.7)
         
     | 
| 
       45 
     | 
    
         
            -
                  unicode-display_width (>= 1.4.0, < 3.0)
         
     | 
| 
       46 
     | 
    
         
            -
                rubocop-ast (1.13.0)
         
     | 
| 
       47 
     | 
    
         
            -
                  parser (>= 3.0.1.1)
         
     | 
| 
       48 
     | 
    
         
            -
                ruby-progressbar (1.11.0)
         
     | 
| 
       49 
     | 
    
         
            -
                unicode-display_width (2.1.0)
         
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
            PLATFORMS
         
     | 
| 
       52 
     | 
    
         
            -
              ruby
         
     | 
| 
       53 
     | 
    
         
            -
              x86_64-linux
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
            DEPENDENCIES
         
     | 
| 
       56 
     | 
    
         
            -
              rake (~> 13.0)
         
     | 
| 
       57 
     | 
    
         
            -
              rspec
         
     | 
| 
       58 
     | 
    
         
            -
              rspec-expectations
         
     | 
| 
       59 
     | 
    
         
            -
              rubocop (~> 1.21)
         
     | 
| 
       60 
     | 
    
         
            -
              world_time_api!
         
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
            BUNDLED WITH
         
     | 
| 
       63 
     | 
    
         
            -
               2.2.30
         
     | 
    
        data/Rakefile
    DELETED
    
    
    
        data/bin/console
    DELETED
    
    | 
         @@ -1,15 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #!/usr/bin/env ruby
         
     | 
| 
       2 
     | 
    
         
            -
            # frozen_string_literal: true
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            require "bundler/setup"
         
     | 
| 
       5 
     | 
    
         
            -
            require "world_time_api"
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            # You can add fixtures and/or initialization code here to make experimenting
         
     | 
| 
       8 
     | 
    
         
            -
            # with your gem easier. You can also use a different console, if you like.
         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
            # (If you use this, don't forget to add pry to your Gemfile!)
         
     | 
| 
       11 
     | 
    
         
            -
            # require "pry"
         
     | 
| 
       12 
     | 
    
         
            -
            # Pry.start
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
            require "irb"
         
     | 
| 
       15 
     | 
    
         
            -
            IRB.start(__FILE__)
         
     |