world_time_api 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: 9f894e293b40606642ed5a41f2e3cdd6a696ff12f128d595b33e4a58e9cc933a
4
- data.tar.gz: ccb823dbf2ce7f59f49055b1cd2251d9dcf9e68bbe68b90eaaa3ffca7f5d9c5e
3
+ metadata.gz: 1b6420d0428f5de938fe22c845b39cbbc9816ff5ce4262b2cbaa89c18c397a2e
4
+ data.tar.gz: 53ba3476af00bc51c3b01a78082d89a3485ea5e244fee5f6c7fe951b742fdce3
5
5
  SHA512:
6
- metadata.gz: 9858d0d273c0c17a289856aa6f8a44083c809f40014b541e38b13154373c8fd83e9c6cc8fcb3332f77b6b461b299ed51839e569659ac4de28e394cc3f132c142
7
- data.tar.gz: e367ea73180fb7cfa09951b822aa3aa3dacb0560e50bf463e061a604d876dafa909b33bbbfef7b488b47ddaaf937fc8245a179fabd363009eafd6d5c6faed01e
6
+ metadata.gz: 63372ccb083ad7c9265f94331d7e59715517d4602e41aef16146a694a4bb9d997e7c252bb70446ef3744d8244e61b6da1721c82bebc2b702d5d65511df86fa64
7
+ data.tar.gz: ac358cbf36d2695978e7e60ddb3fe88e504fae8543c91d711b994142feb4978b7dfec055eac4a5f307dfbb5d1dcbe09eda18c111336479a14c524b9c83c02d6e
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --color
3
+ --format documentation
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
- ## [Unreleased]
1
+ ## [WorldTimeAPi]
2
2
 
3
3
  ## [0.1.0] - 2021-11-22
4
4
 
5
5
  - Initial release
6
+
7
+ ## [0.1.1] - 2021-11-22
8
+
9
+ - add methods :time and :timezones
data/Gemfile CHANGED
@@ -5,6 +5,5 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in world_time_api.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rubocop", "~> 1.21"
8
+ gem "rspec"
9
+ gem "rspec-expectations"
data/Gemfile.lock CHANGED
@@ -1,19 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- world_time_api (0.1.0)
4
+ world_time_api (0.1.2)
5
5
  httparty (~> 0.20)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
- httparty (0.20.0)
12
- mime-types (~> 3.0)
11
+ diff-lcs (1.4.4)
12
+ httparty (0.21.0)
13
+ mini_mime (>= 1.0.0)
13
14
  multi_xml (>= 0.5.2)
14
- mime-types (3.4.1)
15
- mime-types-data (~> 3.2015)
16
- mime-types-data (3.2021.1115)
15
+ mini_mime (1.1.2)
17
16
  multi_xml (0.6.0)
18
17
  parallel (1.21.0)
19
18
  parser (3.0.2.0)
@@ -22,6 +21,19 @@ GEM
22
21
  rake (13.0.6)
23
22
  regexp_parser (2.1.1)
24
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)
25
37
  rubocop (1.23.0)
26
38
  parallel (~> 1.10)
27
39
  parser (>= 3.0.0.0)
@@ -37,10 +49,13 @@ GEM
37
49
  unicode-display_width (2.1.0)
38
50
 
39
51
  PLATFORMS
52
+ ruby
40
53
  x86_64-linux
41
54
 
42
55
  DEPENDENCIES
43
56
  rake (~> 13.0)
57
+ rspec
58
+ rspec-expectations
44
59
  rubocop (~> 1.21)
45
60
  world_time_api!
46
61
 
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
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/world_time_api`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
@@ -14,15 +12,25 @@ gem 'world_time_api'
14
12
 
15
13
  And then execute:
16
14
 
17
- $ bundle install
15
+ ```
16
+ $ bundle install
17
+ ```
18
18
 
19
19
  Or install it yourself as:
20
20
 
21
- $ gem install world_time_api
21
+ ```
22
+ $ gem install world_time_api
23
+ ```
22
24
 
23
25
  ## Usage
24
26
 
25
- TODO: Write usage instructions here
27
+ ```ruby
28
+ WorldTimeApi.timezones # list timezones
29
+
30
+ WorldTimeApi.time(time_zone) # get datetime of the timezone
31
+
32
+
33
+ ```
26
34
 
27
35
  ## Development
28
36
 
@@ -32,7 +40,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
40
 
33
41
  ## Contributing
34
42
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/world_time_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/world_time_api/blob/master/CODE_OF_CONDUCT.md).
43
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nemuba/world_time_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/world_time_api/blob/master/CODE_OF_CONDUCT.md).
36
44
 
37
45
  ## License
38
46
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorldTimeApi
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -13,17 +13,17 @@ module WorldTimeApi
13
13
  response = get("/")
14
14
  return "Consult Error" if response.code != 200
15
15
 
16
- response
17
- rescue Net::OpenTimeout
18
- "Error time out connection"
16
+ response.parsed_response
17
+ rescue StandardError
18
+ "Error of connection"
19
19
  end
20
20
 
21
21
  def self.time(zone_name)
22
22
  response = get("/#{zone_name}")
23
23
  return "Invalid Zone Name" if response.code != 200
24
24
 
25
- response
26
- rescue Net::OpenTimeout
27
- "Error time out connection"
25
+ response.parsed_response
26
+ rescue StandardError
27
+ "Error of connection"
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: world_time_api
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
  - Alef Ojeda de Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-22 00:00:00.000000000 Z
11
+ date: 2023-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '13.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '13.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.21'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.21'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: httparty
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -31,6 +59,7 @@ executables: []
31
59
  extensions: []
32
60
  extra_rdoc_files: []
33
61
  files:
62
+ - ".rspec"
34
63
  - ".rubocop.yml"
35
64
  - CHANGELOG.md
36
65
  - CODE_OF_CONDUCT.md
@@ -43,14 +72,13 @@ files:
43
72
  - bin/setup
44
73
  - lib/world_time_api.rb
45
74
  - lib/world_time_api/version.rb
46
- - world_time_api.gemspec
47
75
  homepage: https://github.com/nemuba/world_time_api
48
76
  licenses:
49
77
  - MIT
50
78
  metadata:
51
79
  homepage_uri: https://github.com/nemuba/world_time_api
52
80
  source_code_uri: https://github.com/nemuba/world_time_api
53
- changelog_uri: https://github.com/nemuba/world_time_api/CHANGELOG.md
81
+ changelog_uri: https://github.com/nemuba/world_time_api/blob/main/CHANGELOG.md
54
82
  post_install_message:
55
83
  rdoc_options: []
56
84
  require_paths:
@@ -66,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
94
  - !ruby/object:Gem::Version
67
95
  version: '0'
68
96
  requirements: []
69
- rubygems_version: 3.2.30
97
+ rubygems_version: 3.1.2
70
98
  signing_key:
71
99
  specification_version: 4
72
100
  summary: Api World Time
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/world_time_api/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "world_time_api"
7
- spec.version = WorldTimeApi::VERSION
8
- spec.authors = ["Alef Ojeda de Oliveira"]
9
- spec.email = ["alef.oliveira@inovamind.com.br"]
10
-
11
- spec.summary = "Api World Time"
12
- spec.description = "A API to get world time"
13
- spec.homepage = "https://github.com/nemuba/world_time_api"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.6.0"
16
-
17
- spec.metadata["homepage_uri"] = spec.homepage
18
- spec.metadata["source_code_uri"] = spec.homepage
19
- spec.metadata["changelog_uri"] = "#{spec.homepage}/CHANGELOG.md"
20
-
21
- # Specify which files should be added to the gem when it is released.
22
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
- `git ls-files -z`.split("\x0").reject do |f|
25
- (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
26
- end
27
- end
28
- spec.bindir = "exe"
29
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
- spec.require_paths = ["lib"]
31
-
32
- # Uncomment to register a new dependency of your gem
33
- spec.add_dependency "httparty", "~> 0.20"
34
-
35
- # For more information and examples about making a new gem, checkout our
36
- # guide at: https://bundler.io/guides/creating_gem.html
37
- end