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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96ecd13414e8a16ca63fa2ee5bf4f0a191d1290420f9bfb0be80e02f4612290c
4
- data.tar.gz: 0acc84ea9119e80596b9ea3704fd221f125cf1d5dd862ae3a36578b409d30d2e
3
+ metadata.gz: 526191d354a0263c64008a108179d63e3d06532bc8f44071d61e8027e8210a2e
4
+ data.tar.gz: 7b80f14433dc8afaf832994adfa60117696db26ced57231d9dbf2acb5320a01f
5
5
  SHA512:
6
- metadata.gz: 52d4d2bfc4b32e892e6dd387538655918a969a6a687cb80541321c7c0328ef578e9154ff4019656ca9684740649122aacc57343afaaa97fcd04aed8624037270
7
- data.tar.gz: b1e12c74565edfec757c174f5c938bd5fb0c1f1baa4df7b7f98995e8815064ee11db39198d55478f4616df1a87e2cf0870f0e3b7d7221f24d66cf17b3c10ace6
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,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ship_compliant.gemspec
4
+ gemspec
@@ -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
@@ -0,0 +1,5 @@
1
+ require 'open_weather_map_api'
2
+ require 'rspec'
3
+ require 'dotenv'
4
+
5
+ Dotenv.load
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.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