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 +4 -4
- data/.rspec +3 -0
- data/CHANGELOG.md +5 -1
- data/Gemfile +2 -3
- data/Gemfile.lock +21 -6
- data/README.md +14 -6
- data/lib/world_time_api/version.rb +1 -1
- data/lib/world_time_api.rb +6 -6
- metadata +33 -5
- data/world_time_api.gemspec +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b6420d0428f5de938fe22c845b39cbbc9816ff5ce4262b2cbaa89c18c397a2e
|
4
|
+
data.tar.gz: 53ba3476af00bc51c3b01a78082d89a3485ea5e244fee5f6c7fe951b742fdce3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63372ccb083ad7c9265f94331d7e59715517d4602e41aef16146a694a4bb9d997e7c252bb70446ef3744d8244e61b6da1721c82bebc2b702d5d65511df86fa64
|
7
|
+
data.tar.gz: ac358cbf36d2695978e7e60ddb3fe88e504fae8543c91d711b994142feb4978b7dfec055eac4a5f307dfbb5d1dcbe09eda18c111336479a14c524b9c83c02d6e
|
data/.rspec
ADDED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,19 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
world_time_api (0.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
|
-
|
12
|
-
|
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
|
-
|
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
|
-
|
15
|
+
```
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
21
|
-
|
21
|
+
```
|
22
|
+
$ gem install world_time_api
|
23
|
+
```
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
25
|
-
|
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/
|
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
|
|
data/lib/world_time_api.rb
CHANGED
@@ -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
|
18
|
-
"Error
|
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
|
27
|
-
"Error
|
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.
|
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:
|
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
|
97
|
+
rubygems_version: 3.1.2
|
70
98
|
signing_key:
|
71
99
|
specification_version: 4
|
72
100
|
summary: Api World Time
|
data/world_time_api.gemspec
DELETED
@@ -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
|