ruboty-weather 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruboty/weather/client.rb +6 -10
- data/lib/ruboty/weather/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b520408a72466757b73ad43b551c48d22032513d
|
4
|
+
data.tar.gz: eecfc8a325f95c909540abd2667fb5d053d378fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37bb8f3d6db64f6315618384e2a2c017aa08c9b4cbdc21840e053c4a7b84a6f69adea5d7ea886abb9cd5c678878cbeb491309724d5f7055aaf195f0543bc83d4
|
7
|
+
data.tar.gz: 01777ee8c8397991e1c65e4eb2b042860e43129a46857e1ec1793bbcaf75ed90a4c2c4d3655eb098dce968e4f15f4690218780a3f938f78f2ec4319b81182a24
|
@@ -16,14 +16,10 @@ module Ruboty
|
|
16
16
|
def get(city_code=default_city)
|
17
17
|
response = @client.get("#{url}?city=#{city_code}").body
|
18
18
|
|
19
|
-
forecasts = response['forecasts']
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
today_forecast = "#{today['date']}: #{emojilize!(today['telop'])} (#{temperature_to_s(today['temperature'])})"
|
24
|
-
tomorrow_forecast = "#{tomorrow['date']}: #{emojilize!(tomorrow['telop'])} (#{temperature_to_s(tomorrow['temperature'])})"
|
25
|
-
|
26
|
-
[today_forecast, tomorrow_forecast].join("\n")
|
19
|
+
forecasts = response['forecasts'].map do |forecast|
|
20
|
+
"#{forecast['date']}: #{emojilize!(forecast['telop'])} (#{temperature_to_s(forecast['temperature'])})"
|
21
|
+
end
|
22
|
+
forecasts.join("\n")
|
27
23
|
end
|
28
24
|
|
29
25
|
private
|
@@ -42,8 +38,8 @@ module Ruboty
|
|
42
38
|
telop.gsub!(/のち/, "\u{27A1}")
|
43
39
|
|
44
40
|
emojis = {
|
45
|
-
"
|
46
|
-
"
|
41
|
+
"晴れ{,1}" => "\u{2600}",
|
42
|
+
"曇り{,1}" => "\u{2601}",
|
47
43
|
"雨" => "\u{2614}",
|
48
44
|
"雷" => "\u{26A1}",
|
49
45
|
"雪" => "\u{26C4}",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-weather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryoichi SEKIGUCHI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruboty
|
@@ -122,4 +122,3 @@ signing_key:
|
|
122
122
|
specification_version: 4
|
123
123
|
summary: An ruboty handler to weather from livedoor API
|
124
124
|
test_files: []
|
125
|
-
has_rdoc:
|