maju 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -11
- data/lib/maju/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a623699dbdaf465d675b52e625cab7b1aeb2900100b870b03edd89a142be49e7
|
4
|
+
data.tar.gz: e57d7febcdf1b7618d32f39bdc164bf2fc1b35f7274520c1e5fdf514eeccd8d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11e29d154a1f69492a1b705e4a49d2a23e275b2fd033037ff2fdca363f0cc72770e392ea5f724726ed06319bed54e8031613293f8d32ff781a2910077fe29a0d
|
7
|
+
data.tar.gz: d256a2c72c6bf1fa991e2ebe9f5cd377ebc87f4daf67c21b4f5f407f672ba17f23e2d9bafa7a26d366bb7a1f4df7bd5a89f46d9737ff29c17308da829a038b36
|
data/README.md
CHANGED
@@ -1,47 +1,66 @@
|
|
1
1
|
# StringHelpers
|
2
|
-
Get weather
|
2
|
+
Get weather information about a city easily with Maju.
|
3
|
+
|
4
|
+
|
3
5
|
|
4
6
|
## Install
|
7
|
+
Maju is a rubygem package, and it can be installed via gem install command
|
5
8
|
|
6
9
|
```sh
|
7
10
|
gem install maju
|
8
11
|
```
|
9
|
-
|
12
|
+
|
13
|
+
or you can add to your Gemfile
|
10
14
|
|
11
15
|
```sh
|
12
16
|
gem maju
|
13
17
|
```
|
18
|
+
and then run
|
19
|
+
|
20
|
+
```sh
|
21
|
+
bundle install
|
22
|
+
```
|
23
|
+
|
14
24
|
|
15
25
|
## Configuration
|
16
|
-
|
26
|
+
After instalation and before usage, you need to create a account on[Open Weather Site](https://openweathermap.org/) and gerenate a API key. To create an API key, follow the steps in [this tutorial](https://openweathermap.org/guide)
|
17
27
|
|
18
|
-
After get your API KEY, you need to start
|
28
|
+
After get your API KEY, you need to start a maju client.
|
19
29
|
|
20
30
|
```ruby
|
21
|
-
client = Maju::Client.new(api_token: 'YOUR_API_KEY_HERE')
|
31
|
+
client = Maju::Client.new(api_token: 'YOUR_API_KEY_HERE', lang: 'pt_BR', unit: 'celsius')
|
22
32
|
```
|
23
33
|
|
34
|
+
Now you will use the instance 'client' to call all public method
|
24
35
|
|
25
36
|
|
26
37
|
## Usage
|
27
|
-
|
38
|
+
To get today information about weather.
|
39
|
+
|
40
|
+
You need to pass city name with params 'city'
|
28
41
|
|
29
42
|
```ruby
|
30
43
|
client.current(city: 'Monte Santo de Minas')
|
31
44
|
```
|
32
|
-
|
45
|
+
|
46
|
+
or to pass a lat and long cordinates
|
33
47
|
|
34
48
|
```ruby
|
35
49
|
client.current(lat: '-21.2049202', long: '-47.0943532')
|
36
50
|
```
|
37
51
|
|
38
|
-
|
52
|
+
If you don't know lat and long from city, use geocode method.
|
39
53
|
|
54
|
+
## Geocode
|
40
55
|
if you need to find out lat and long of some city you can use geocode method
|
41
56
|
```ruby
|
42
57
|
client.geocode(city: 'Monte Santo de Minas')
|
43
58
|
```
|
44
|
-
|
59
|
+
|
60
|
+
|
61
|
+
it will returns the array.
|
62
|
+
|
63
|
+
NOTE: if the return contains only one object, that is, only one city was found, it will return a direct object. If there is more than one city, an array containing objects will be returned, in the same structure.
|
45
64
|
|
46
65
|
```json
|
47
66
|
[
|
@@ -55,14 +74,14 @@ will returns:
|
|
55
74
|
]
|
56
75
|
```
|
57
76
|
|
77
|
+
|
58
78
|
## Forecasts
|
59
79
|
To get forecast for the days ahead, you can use the forecast method. If you don't know lat and long informations, use the geocode method.
|
60
80
|
|
61
81
|
```ruby
|
62
|
-
client.
|
82
|
+
client.forecast(lat: '-21.2049202', long: '-47.0943532')
|
63
83
|
```
|
64
84
|
|
65
|
-
|
66
85
|
## License
|
67
86
|
StringHelper is available under the MIT license.
|
68
87
|
|
data/lib/maju/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maju
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Ivan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
12
|
-
dependencies:
|
11
|
+
date: 2023-02-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.1.0
|
13
27
|
description: Get weather information directly from the console or easily integrate
|
14
28
|
your application with OpenWeather
|
15
29
|
email:
|