jared-weather 1.0.0
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 +7 -0
- data/.gitignore +2 -0
- data/Gemfile +3 -0
- data/README.md +8 -0
- data/Rakefile +1 -0
- data/jared-weather.gemspec +20 -0
- data/lib/jared-weather.rb +6 -0
- data/lib/jared-weather/cli.rb +23 -0
- data/lib/jared-weather/jared-weather.rb +48 -0
- data/lib/jared-weather/version.rb +3 -0
- metadata +68 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d010d492ff52da03c870fe58d65e3231f5e80dd1
|
4
|
+
data.tar.gz: 463371a590be52a4aae7947fb38756e6c0627e5c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 72874229860fdbce657911e22a221a8a9e7851d8919f85883921ef754a4ef0a27d5ba9873cbf462a2744135a2cd2721b9a0900e85728e5af4c1b60bbcc055a92
|
7
|
+
data.tar.gz: bf58184c91eb7506ba29f61018db34e8da355eb94950cc5d3b0ab12f7a4711e95646c3f74ee3592dea030f605587a3e2602135c075a5fac729d5fca5d7dac2d1
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "jared-weather/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "jared-weather"
|
7
|
+
s.version = JaredWeather::VERSION
|
8
|
+
s.authors = ["cyberarm"]
|
9
|
+
s.email = ["matthewlikesrobots@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/cyberarm/jared"
|
11
|
+
s.summary = "Weather plugin for Jared"
|
12
|
+
s.description = "Weather plugin for Jared"
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib", "bin"]
|
18
|
+
|
19
|
+
s.add_runtime_dependency "weatherboy"
|
20
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class JaredWeather
|
2
|
+
class CLI < Thor
|
3
|
+
desc 'version', "shows version"
|
4
|
+
def version
|
5
|
+
puts "JaredWeather version #{JaredWeather::VERSION}"
|
6
|
+
end
|
7
|
+
|
8
|
+
desc 'forecast [place or zipcode]', "Gets the forecast."
|
9
|
+
def forecast(place_or_zipcode)
|
10
|
+
JaredWeather.new(place_or_zipcode).forecast
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'today [place or zipcode]', "Gets todays forecast."
|
14
|
+
def today(place_or_zipcode)
|
15
|
+
JaredWeather.new(place_or_zipcode).today
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'tomorrow [place or zipcode]', "gets tomorrows forecast."
|
19
|
+
def tomorrow(place_or_zipcode)
|
20
|
+
JaredWeather.new(place_or_zipcode).tomorrow
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
class JaredWeather
|
2
|
+
def initialize(place_or_zipcode)
|
3
|
+
begin
|
4
|
+
@weather = Weatherboy.new(place_or_zipcode)
|
5
|
+
rescue => e
|
6
|
+
puts "The error '#{e}', occurred fetching weather information."
|
7
|
+
exit
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def weather
|
12
|
+
@weather
|
13
|
+
end
|
14
|
+
|
15
|
+
def forecast
|
16
|
+
weather.forecasts.each do |condition|
|
17
|
+
puts "#{condition.title}."
|
18
|
+
puts " #{condition.text}"
|
19
|
+
puts
|
20
|
+
end
|
21
|
+
notice
|
22
|
+
end
|
23
|
+
|
24
|
+
def today
|
25
|
+
condition = weather.forecasts[0]
|
26
|
+
puts "#{condition.title}."
|
27
|
+
puts " #{condition.text}"
|
28
|
+
notice
|
29
|
+
end
|
30
|
+
|
31
|
+
def tomorrow
|
32
|
+
condition = weather.forecasts[2]
|
33
|
+
puts "#{condition.title}."
|
34
|
+
puts " #{condition.text}"
|
35
|
+
notice
|
36
|
+
end
|
37
|
+
|
38
|
+
def default
|
39
|
+
forecast = weather.current
|
40
|
+
puts forecast.temp_f + "Degrees Fahrenheit.", forecast.weather + ".", forecast.wind_mph + " mile per hour winds from the #{forecast.wind_dir}."
|
41
|
+
notice
|
42
|
+
end
|
43
|
+
|
44
|
+
def notice
|
45
|
+
puts
|
46
|
+
puts "-- from Weather Underground - http://www.wunderground.com"
|
47
|
+
end
|
48
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jared-weather
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- cyberarm
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: weatherboy
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Weather plugin for Jared
|
28
|
+
email:
|
29
|
+
- matthewlikesrobots@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- Gemfile
|
36
|
+
- README.md
|
37
|
+
- Rakefile
|
38
|
+
- jared-weather.gemspec
|
39
|
+
- lib/jared-weather.rb
|
40
|
+
- lib/jared-weather/cli.rb
|
41
|
+
- lib/jared-weather/jared-weather.rb
|
42
|
+
- lib/jared-weather/version.rb
|
43
|
+
homepage: https://github.com/cyberarm/jared
|
44
|
+
licenses: []
|
45
|
+
metadata: {}
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
- bin
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 2.2.2
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: Weather plugin for Jared
|
67
|
+
test_files: []
|
68
|
+
has_rdoc:
|