weather-report 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/weather-report +25 -1
- data/lib/weather-report/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4f67b3b626ee3062de01ce4de35db316294011d
|
4
|
+
data.tar.gz: 862150e4ee81120765b9d670e88cc5a3885f9408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df4f657b9bb1b5e4a9d7b0eaa4fb4e44198e7db04ac1af56d734b48cefd3bdb76095f599d613c54af2a229d8aa18836b1e8dc4e9f0bcc77d51b22a1e5e972786
|
7
|
+
data.tar.gz: 9eadde1bb864a2f20a5afc9631459fd5c53e671bbee7ebde84eca34644556f891c035db806072bb106e29d11214d136964e19026270fe95ba3d3ef30a9c612e3
|
data/bin/weather-report
CHANGED
@@ -1,6 +1,30 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'weather-report'
|
4
|
+
require 'optparse'
|
5
|
+
require 'ostruct'
|
4
6
|
|
5
|
-
|
7
|
+
exit 1 if ARGV.empty?
|
8
|
+
|
9
|
+
options = OpenStruct.new
|
10
|
+
|
11
|
+
opt_parser = OptionParser.new do |opts|
|
12
|
+
opts.banner = 'Usage: weather-report CITY [options]'
|
13
|
+
|
14
|
+
opts.separator ""
|
15
|
+
opts.separator "Common options:"
|
16
|
+
|
17
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
18
|
+
puts opts
|
19
|
+
exit
|
20
|
+
end
|
21
|
+
|
22
|
+
opts.on_tail("-v", "--version", "Show version") do
|
23
|
+
puts WeatherReport::Version
|
24
|
+
exit
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
city = opt_parser.parse(ARGV)
|
29
|
+
weather = WeatherReport::Weather.new(WeatherReport::Weather.request_cityid(city))
|
6
30
|
puts weather.to_h
|