SnowWeather 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/README.md.save +75 -0
- data/lib/SnowWeather/version.rb +1 -1
- data/lib/generators/snow_weather/config/USAGE +5 -0
- data/lib/generators/snow_weather/config/config_generator.rb +13 -0
- data/lib/generators/snow_weather/config/templates/config.rb.erb +1 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7af7d63025c85c0e5381ffb332f544ee480abc04
|
4
|
+
data.tar.gz: 0f0d79d4b7a3d46f3b6ca56b00aa084ef7c294a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 930b6bc237ff47543de79419b65ca13866a8ca4f778c5acc85b53dd2b9f5e04ac3cd8ed2f609a77b159feb1833056f1c8bc5016f445c059c3f98eba4ee4359c7
|
7
|
+
data.tar.gz: 564f59aca5790cb1dc5a07a3a8ce89333e1d052758e8ba70aeec8aaa4338d08dd013bef19428b74931439ef818b5af886402f1b32ea5647c076d870e78174537
|
data/README.md
CHANGED
@@ -29,10 +29,10 @@ Or install it yourself as:
|
|
29
29
|
## Usage
|
30
30
|
|
31
31
|
|
32
|
-
|
32
|
+
Install the configuration file please change the api key to your api key from Weather Underground.
|
33
33
|
|
34
34
|
```ruby
|
35
|
-
|
35
|
+
rails g snow_weather:config
|
36
36
|
```
|
37
37
|
|
38
38
|
|
data/README.md.save
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# SnowWeather
|
2
|
+
|
3
|
+
SnowWeather is a simple Gem to interface with Weather Undergounds API
|
4
|
+
|
5
|
+
## Gem Status
|
6
|
+
<a href="https://travis-ci.org/Jrsnow8921"><img src="https://travis-ci.org/Jrsnow8921/SnowWeatherGem.svg?branch=master" height="18"></a>
|
7
|
+
|
8
|
+
## Travis CI Build Status
|
9
|
+
|
10
|
+
<a href="
|
11
|
+
https://travis-ci.org/Jrsnow8921/SnowWeatherGem.svg?branch=master
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add this line to your application's Gemfile:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem 'SnowWeather'
|
19
|
+
```
|
20
|
+
|
21
|
+
And then execute:
|
22
|
+
|
23
|
+
$ bundle
|
24
|
+
|
25
|
+
Or install it yourself as:
|
26
|
+
|
27
|
+
$ gem install SnowWeather
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
|
32
|
+
Set the api_key whithin in a model or controller
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
SnowWeather.api_key(<'123456789123456789'>)
|
36
|
+
```
|
37
|
+
|
38
|
+
|
39
|
+
Get current conditions
|
40
|
+
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
SnowWeather::Conditions.getConditions(<'state'>, <'city'>)
|
44
|
+
```
|
45
|
+
|
46
|
+
Example
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
SnowWeather.api_key(<'123456789123456789'>)
|
50
|
+
|
51
|
+
@data = SnowWeather::Conditions.getConditions('PA', 'Pittsburgh')
|
52
|
+
#gets the current temp in F
|
53
|
+
@temp = @data['current_observation']['temp_f']
|
54
|
+
#gets the current weather condition
|
55
|
+
@weather = @data['current_observation']['weather']
|
56
|
+
|
57
|
+
puts "The current weather is #{@weather} with a temperature of #{@temp}°F"
|
58
|
+
|
59
|
+
|
60
|
+
```
|
61
|
+
Result
|
62
|
+
|
63
|
+
The current weather is cloudy with a temperature of 60°F
|
64
|
+
|
65
|
+
|
66
|
+
Data is returned in JSON format.
|
67
|
+
|
68
|
+
|
69
|
+
## Contributing
|
70
|
+
|
71
|
+
1. Fork it ( https://github.com/Jrsnow8921/SnowWeatherGem/fork )
|
72
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
73
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
74
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
75
|
+
5. Create a new Pull Request
|
data/lib/SnowWeather/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
module SnowWeather
|
2
|
+
module Generators
|
3
|
+
|
4
|
+
class ConfigGenerator < ::Rails::Generators::Base
|
5
|
+
source_root File.expand_path('../templates', __FILE__)
|
6
|
+
|
7
|
+
def generate_config
|
8
|
+
template "config.rb.erb", "config/initializers/snow_weather.rb"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
SnowWeather.api_key('your_api_key_goes_here')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: SnowWeather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Snow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- Gemfile
|
109
109
|
- LICENSE.txt
|
110
110
|
- README.md
|
111
|
+
- README.md.save
|
111
112
|
- Rakefile
|
112
113
|
- SnowWeather.gemspec
|
113
114
|
- bin/console
|
@@ -115,6 +116,9 @@ files:
|
|
115
116
|
- lib/SnowWeather.rb
|
116
117
|
- lib/SnowWeather/conditions.rb
|
117
118
|
- lib/SnowWeather/version.rb
|
119
|
+
- lib/generators/snow_weather/config/USAGE
|
120
|
+
- lib/generators/snow_weather/config/config_generator.rb
|
121
|
+
- lib/generators/snow_weather/config/templates/config.rb.erb
|
118
122
|
- t_build.sh
|
119
123
|
homepage: https://github.com/Jrsnow8921/SnowWeatherGem.git
|
120
124
|
licenses:
|