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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecbe7a1112b83e2d5aeda9649e62793f8f408d69
4
- data.tar.gz: 946ee44d3ed0e50daf5eb894da8c2eea3666714d
3
+ metadata.gz: b520408a72466757b73ad43b551c48d22032513d
4
+ data.tar.gz: eecfc8a325f95c909540abd2667fb5d053d378fb
5
5
  SHA512:
6
- metadata.gz: d2cf18cd5ff5ec4d043b6c43dbcca1ac6da746c65273af1f4e24f73367f0cc28e0d5d703a0a7a59bd0287682ae8b6f377dfb9cb602c45defba2acc9ad0d63be7
7
- data.tar.gz: 397a1215d30f887aec4a58eca6f2c50f3dbe03abeead556307175c11d34d4844d94fecf8635bfe30819a20078e61a1044679e26df06eaadb37a49dd53133dbc7
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
- today = forecasts[0]
21
- tomorrow = forecasts[1]
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
- "" => "\u{2600}",
46
- "" => "\u{2601}",
41
+ "晴れ{,1}" => "\u{2600}",
42
+ "曇り{,1}" => "\u{2601}",
47
43
  "雨" => "\u{2614}",
48
44
  "雷" => "\u{26A1}",
49
45
  "雪" => "\u{26C4}",
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Weather
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
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
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-15 00:00:00.000000000 Z
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: