open_weather_map_api 0.0.0 → 0.0.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/.gitignore +25 -0
- data/Gemfile +4 -0
- data/open_weather_map_api.gemspec +17 -0
- data/spec/open_weather_map_api_spec.rb +33 -0
- data/spec/spec_helper.rb +5 -0
- metadata +38 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 526191d354a0263c64008a108179d63e3d06532bc8f44071d61e8027e8210a2e
|
4
|
+
data.tar.gz: 7b80f14433dc8afaf832994adfa60117696db26ced57231d9dbf2acb5320a01f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84cb396e48515decc2016bacaa5e21f3e8365883b2b1e26dab8c69ac95ee494f387e58839ca2778e43acd01791310092698d660505b621fb2f57a7cd39c05c0c
|
7
|
+
data.tar.gz: 13f5ef9a7a75d6df9a950d52e613dcae6394fc3b8b99bd82672a68b6f551478c3ad76f07fae9bd8608fbe2414333235d34099dd376cb482c4d6ca2c5ec0a33f3
|
data/.gitignore
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
.ruby-gemset
|
24
|
+
.ruby-version
|
25
|
+
.env
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'open_weather_map_api'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.summary = "Implementation of OpenWeatherMap API"
|
5
|
+
s.description = "Get Weather and Forecast for the city you want easily"
|
6
|
+
s.authors = ["Wellington Gomes Graciani"]
|
7
|
+
s.email = 'wellingtongg12@gmail.com'
|
8
|
+
s.files = ["lib/open_weather_map_api.rb"]
|
9
|
+
s.homepage = 'https://github.com/Wellingtongg/open_weather_map_api'
|
10
|
+
s.license = 'MIT'
|
11
|
+
|
12
|
+
s.files = `git ls-files -z`.split("\x0")
|
13
|
+
s.test_files = s.files.grep(%r{^spec/})
|
14
|
+
|
15
|
+
s.add_development_dependency "rspec", "~> 3.10"
|
16
|
+
s.add_development_dependency "dotenv", "~> 2.7.6"
|
17
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe OpenWeatherMapApi do
|
4
|
+
describe '#OpenWeatherMapService' do
|
5
|
+
it 'get weather by city' do
|
6
|
+
response = OpenWeatherMapApi.get_weather(q: 'florianopolis', appid: ENV['OPEN_WEATHER_MAP_APP_ID'])
|
7
|
+
|
8
|
+
expect(response.class).to eq(Hash)
|
9
|
+
expect(response['name']).to eq('Florianópolis')
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'get weather by latitude an longitude' do
|
13
|
+
response = OpenWeatherMapApi.get_weather(lat: '51.5085', lon: '-0.1257', appid: ENV['OPEN_WEATHER_MAP_APP_ID'])
|
14
|
+
|
15
|
+
expect(response.class).to eq(Hash)
|
16
|
+
expect(response['name']).to eq('London')
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'get forecast by city' do
|
20
|
+
response = OpenWeatherMapApi.get_forecast(q: 'florianopolis', appid: ENV['OPEN_WEATHER_MAP_APP_ID'])
|
21
|
+
|
22
|
+
expect(response.class).to eq(Hash)
|
23
|
+
expect(response['city']['name']).to eq('Florianópolis')
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'get forecast by latitude an longitude' do
|
27
|
+
response = OpenWeatherMapApi.get_forecast(lat: '51.5085', lon: '-0.1257', appid: ENV['OPEN_WEATHER_MAP_APP_ID'])
|
28
|
+
|
29
|
+
expect(response.class).to eq(Hash)
|
30
|
+
expect(response['city']['name']).to eq('London')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_weather_map_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wellington Gomes Graciani
|
@@ -9,14 +9,47 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2022-02-24 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dotenv
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.7.6
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.7.6
|
13
41
|
description: Get Weather and Forecast for the city you want easily
|
14
42
|
email: wellingtongg12@gmail.com
|
15
43
|
executables: []
|
16
44
|
extensions: []
|
17
45
|
extra_rdoc_files: []
|
18
46
|
files:
|
47
|
+
- ".gitignore"
|
48
|
+
- Gemfile
|
19
49
|
- lib/open_weather_map_api.rb
|
50
|
+
- open_weather_map_api.gemspec
|
51
|
+
- spec/open_weather_map_api_spec.rb
|
52
|
+
- spec/spec_helper.rb
|
20
53
|
homepage: https://github.com/Wellingtongg/open_weather_map_api
|
21
54
|
licenses:
|
22
55
|
- MIT
|
@@ -40,4 +73,6 @@ rubygems_version: 3.0.3
|
|
40
73
|
signing_key:
|
41
74
|
specification_version: 4
|
42
75
|
summary: Implementation of OpenWeatherMap API
|
43
|
-
test_files:
|
76
|
+
test_files:
|
77
|
+
- spec/open_weather_map_api_spec.rb
|
78
|
+
- spec/spec_helper.rb
|