air_quality_index 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/air_quality_index-0.2.1.gem +0 -0
- data/lib/air_quality_index/city.rb +1 -1
- data/lib/air_quality_index/local_aqi.rb +3 -2
- data/lib/air_quality_index/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e71fcc37c3e184fdd9cf3546e47a8c91bc1b1cf
|
4
|
+
data.tar.gz: 1c750a0c3254baccbc64b789b9f14a94c830088b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f182f7c28b92f7bc325a956cd42782311e3b7ae13af7cc606da911110205023fa128a24ca81fe9b2a3d875977fe0a4502f0d5cbcc0aa807eaaeaa5e45cc7121c
|
7
|
+
data.tar.gz: 6f6c2d97b90f49ef2ba935fe42ad2657c8e09e9260162654b747cdc1e90cf2503cdf8f577c4099f60c1461556ca49248b1cf54a3f69935ee93b2a611dd274292
|
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class AirQualityIndex::City
|
2
2
|
|
3
|
-
attr_accessor :location_city, :location_state, :todays_index, :location_city, :location_state, :current_aqi_index, :current_health_msg, :current_pm, :current_pm_msg, :current_ozone, :current_ozone_msg, :current_aqi_timestamp, :today_aqi, :today_aqi_msg, :today_ozone, :tomorrow_aqi, :tomorrow_aqi_msg, :tomorrow_ozone, :location_name_full, :index, :message, :link
|
3
|
+
attr_accessor :location_city, :location_state, :todays_index, :location_city, :location_state, :current_aqi_index, :current_health_msg, :current_aqi_msg, :current_pm, :current_pm_msg, :current_ozone, :current_ozone_msg, :current_aqi_timestamp, :today_aqi, :today_aqi_msg, :today_ozone, :tomorrow_aqi, :tomorrow_aqi_msg, :tomorrow_ozone, :location_name_full, :index, :message, :link
|
4
4
|
|
5
5
|
|
6
6
|
end
|
@@ -88,7 +88,7 @@ class AirQualityIndex::LocalAQI
|
|
88
88
|
if city.nil?
|
89
89
|
@city = AirQualityIndex::City.new
|
90
90
|
else
|
91
|
-
@city =
|
91
|
+
@city = city
|
92
92
|
end
|
93
93
|
|
94
94
|
#store location information
|
@@ -97,6 +97,7 @@ class AirQualityIndex::LocalAQI
|
|
97
97
|
|
98
98
|
#store aqi index
|
99
99
|
self.doc.at('.TblInvisible').css('tr td').children[1].nil?? self.city.current_aqi_index = unavailable_msg : self.city.current_aqi_index = self.doc.at('.TblInvisible').css('tr td').children[1].text.strip
|
100
|
+
self.doc.search("td.AQDataLg").nil?? self.city.current_aqi_msg = unavailable_msg : self.city.current_aqi_msg = self.doc.search("td.AQDataLg")[0].text.strip
|
100
101
|
self.doc.search("td.HealthMessage")[0].nil?? self.city.current_health_msg = unavailable_msg : self.city.current_health_msg = self.doc.search("td.HealthMessage")[0].text.strip[/(?<=Health Message: ).*/]
|
101
102
|
|
102
103
|
#store current aqi/ozone data
|
@@ -141,7 +142,7 @@ class AirQualityIndex::LocalAQI
|
|
141
142
|
|
142
143
|
Current Conditions in #{self.city.location_city}, #{self.city.location_state} (#{self.city.current_aqi_timestamp}):
|
143
144
|
|
144
|
-
AQI: #{self.city.current_aqi_index}
|
145
|
+
AQI: #{self.city.current_aqi_index} (#{self.city.current_aqi_msg})
|
145
146
|
Health Message: #{self.city.current_health_msg}
|
146
147
|
|
147
148
|
Ozone: #{self.city.current_ozone} (#{self.city.current_ozone_msg})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: air_quality_index
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "'Jameson Bass'"
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- air_quality_index-0.1.0.gem
|
57
57
|
- air_quality_index-0.2.0.gem
|
58
|
+
- air_quality_index-0.2.1.gem
|
58
59
|
- air_quality_index.gemspec
|
59
60
|
- bin/air-quality-index
|
60
61
|
- bin/console
|