world_time_api 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49610b7c90783b18113773e0afc48c0384926f015e638d5c11ffe8cbf492be0f
4
- data.tar.gz: 5cdb06ed27be594b9c515728355d5805bd9fd7f04b8af7e7f491fc93516d33c9
3
+ metadata.gz: 1b6420d0428f5de938fe22c845b39cbbc9816ff5ce4262b2cbaa89c18c397a2e
4
+ data.tar.gz: 53ba3476af00bc51c3b01a78082d89a3485ea5e244fee5f6c7fe951b742fdce3
5
5
  SHA512:
6
- metadata.gz: 8ceea121f51f4c73d0c848aee0e828075aa6c12fa45ec4c5929d0442926e6dfc13ce97242ccf30c85dc2b3c923c1f4cd7cdc1a8de54c31d2a0d44efc8251d472
7
- data.tar.gz: 183b10f775d8fc15fff5bfe5945a5a387ffdc70e45b21fb79676985e0d7963eb122dc428bec1dfd6a61578f24803d5b8c3d14b5505e7fbd1b8d42c6a6b8a894d
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
@@ -4,3 +4,6 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in world_time_api.gemspec
6
6
  gemspec
7
+
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.1)
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.1"
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,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.1
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
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".rspec"
62
63
  - ".rubocop.yml"
63
64
  - CHANGELOG.md
64
65
  - CODE_OF_CONDUCT.md
@@ -71,7 +72,6 @@ files:
71
72
  - bin/setup
72
73
  - lib/world_time_api.rb
73
74
  - lib/world_time_api/version.rb
74
- - world_time_api.gemspec
75
75
  homepage: https://github.com/nemuba/world_time_api
76
76
  licenses:
77
77
  - MIT
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.2.30
97
+ rubygems_version: 3.1.2
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Api World Time
@@ -1,39 +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"] = "https://github.com/nemuba/world_time_api/blob/main/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_development_dependency "rake", "~> 13.0"
34
- spec.add_development_dependency "rubocop", "~> 1.21"
35
- spec.add_dependency "httparty", "~> 0.20"
36
-
37
- # For more information and examples about making a new gem, checkout our
38
- # guide at: https://bundler.io/guides/creating_gem.html
39
- end