south_african_air_quality_index 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 5d697dae6b8a2a2239caa16f7107edfca19a6fe4ca3b13dbdf35ed2cd1220a55
4
- data.tar.gz: cbb4c1a357e70556c6a1e778a24e740ac853de86f0a7780469fb240ab87a9f3f
3
+ metadata.gz: 2ba62e529fa5fb339cee6ef09b5f76d3d4bf8d3f15317ffbbeabb3d31ede8701
4
+ data.tar.gz: 880be755e33b591173be0d09ec54354d194d6199db644167a2323767cab4153b
5
5
  SHA512:
6
- metadata.gz: 7b94a2be9950e13b4f8b363e297a236271144801b436cb02e0b9ef55b011eea2714c85427bdd8df476f71e1839297b46689a4687492fc762200ffb1bc4959cbb
7
- data.tar.gz: 15583299e9d8660eb9391642cc64f8d0495e1287368225e35c651c9b6d703cb681e6ab67ef46b0a6b6f79409c9d20641a23a76f838dcd24a842612f7724aa535
6
+ metadata.gz: 776ae597b1a28c4f1d2523832a6d39b947ff27f7c7aded4cf62377f16f768af1d37613fd6c74d93f1a78274906c796f95c3ec309f6a9265fc655d6c4a882bdfb
7
+ data.tar.gz: 386687a539374d5f7a959afe510b5f31ce70a653db0f673cb1e2b0c8b89b1a5d836d954ff5833ea609b999b3dd8361f3abb6d564a91084b7bae622107de37d54
data/Gemfile.lock CHANGED
@@ -1,22 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- south_african_air_quality_index (0.0.1)
4
+ south_african_air_quality_index (0.0.2)
5
5
  active_attr (~> 0.15)
6
6
  httparty (~> 0.20)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (7.0.3)
12
- actionview (= 7.0.3)
13
- activesupport (= 7.0.3)
11
+ actionpack (7.0.4)
12
+ actionview (= 7.0.4)
13
+ activesupport (= 7.0.4)
14
14
  rack (~> 2.0, >= 2.2.0)
15
15
  rack-test (>= 0.6.3)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (7.0.3)
19
- activesupport (= 7.0.3)
18
+ actionview (7.0.4)
19
+ activesupport (= 7.0.4)
20
20
  builder (~> 3.1)
21
21
  erubi (~> 1.4)
22
22
  rails-dom-testing (~> 2.0)
@@ -25,15 +25,15 @@ GEM
25
25
  actionpack (>= 3.0.2, < 7.1)
26
26
  activemodel (>= 3.0.2, < 7.1)
27
27
  activesupport (>= 3.0.2, < 7.1)
28
- activemodel (7.0.3)
29
- activesupport (= 7.0.3)
30
- activesupport (7.0.3)
28
+ activemodel (7.0.4)
29
+ activesupport (= 7.0.4)
30
+ activesupport (7.0.4)
31
31
  concurrent-ruby (~> 1.0, >= 1.0.2)
32
32
  i18n (>= 1.6, < 2)
33
33
  minitest (>= 5.1)
34
34
  tzinfo (~> 2.0)
35
- addressable (2.8.0)
36
- public_suffix (>= 2.0.2, < 5.0)
35
+ addressable (2.8.1)
36
+ public_suffix (>= 2.0.2, < 6.0)
37
37
  ansi (1.5.0)
38
38
  builder (3.2.4)
39
39
  coderay (1.1.3)
@@ -41,21 +41,21 @@ GEM
41
41
  crack (0.4.5)
42
42
  rexml
43
43
  crass (1.0.6)
44
- erubi (1.10.0)
44
+ erubi (1.11.0)
45
45
  hashdiff (1.0.1)
46
46
  httparty (0.20.0)
47
47
  mime-types (~> 3.0)
48
48
  multi_xml (>= 0.5.2)
49
- i18n (1.10.0)
49
+ i18n (1.12.0)
50
50
  concurrent-ruby (~> 1.0)
51
- loofah (2.18.0)
51
+ loofah (2.19.1)
52
52
  crass (~> 1.0.2)
53
53
  nokogiri (>= 1.5.9)
54
54
  method_source (1.0.0)
55
55
  mime-types (3.4.1)
56
56
  mime-types-data (~> 3.2015)
57
57
  mime-types-data (3.2022.0105)
58
- minitest (5.15.0)
58
+ minitest (5.16.3)
59
59
  minitest-focus (1.1.2)
60
60
  minitest (>= 4, < 6)
61
61
  minitest-reporters (1.4.3)
@@ -65,26 +65,26 @@ GEM
65
65
  ruby-progressbar
66
66
  mocha (1.11.2)
67
67
  multi_xml (0.6.0)
68
- nokogiri (1.13.6-arm64-darwin)
68
+ nokogiri (1.13.10-arm64-darwin)
69
69
  racc (~> 1.4)
70
70
  pry (0.14.1)
71
71
  coderay (~> 1.1)
72
72
  method_source (~> 1.0)
73
- public_suffix (4.0.7)
74
- racc (1.6.0)
75
- rack (2.2.3.1)
76
- rack-test (1.1.0)
77
- rack (>= 1.0, < 3)
73
+ public_suffix (5.0.1)
74
+ racc (1.6.1)
75
+ rack (2.2.4)
76
+ rack-test (2.0.2)
77
+ rack (>= 1.3)
78
78
  rails-dom-testing (2.0.3)
79
79
  activesupport (>= 4.2.0)
80
80
  nokogiri (>= 1.6)
81
- rails-html-sanitizer (1.4.2)
82
- loofah (~> 2.3)
81
+ rails-html-sanitizer (1.4.4)
82
+ loofah (~> 2.19, >= 2.19.1)
83
83
  rake (13.0.6)
84
84
  rexml (3.2.5)
85
85
  ruby-progressbar (1.11.0)
86
- timecop (0.9.5)
87
- tzinfo (2.0.4)
86
+ timecop (0.9.6)
87
+ tzinfo (2.0.5)
88
88
  concurrent-ruby (~> 1.0)
89
89
  webmock (3.8.3)
90
90
  addressable (>= 2.3.6)
@@ -107,4 +107,4 @@ DEPENDENCIES
107
107
  webmock (~> 3.8.3)
108
108
 
109
109
  BUNDLED WITH
110
- 2.3.5
110
+ 2.3.16
@@ -15,14 +15,15 @@ module SouthAfricanAirQualityIndex
15
15
 
16
16
  # This is the version of the API docs this client was built off-of
17
17
  def self.api_version
18
- 'v1 2022-06-08'
18
+ 'v1 2022-12-15'
19
19
  end
20
20
 
21
21
  # Endpoints
22
22
 
23
23
  # Memoize stations as they are unlikely to change often
24
24
  def stations
25
- @stations ||= send(http_method: :get, path: 'ajax/getAllStationsNew')
25
+ # This endpoint is no longer active:
26
+ @stations ||= send(http_method: :get, path: 'ajax/getAllStations')
26
27
  end
27
28
 
28
29
  def stations_from_code(codes, build_for_response: false)
@@ -32,7 +33,7 @@ module SouthAfricanAirQualityIndex
32
33
  end
33
34
 
34
35
  def selected_stations(station_names)
35
- stations['body']['Stations'].select do |station|
36
+ stations['body'].select do |station|
36
37
  station_matches?(station_names, station)
37
38
  end
38
39
  end
@@ -156,7 +157,8 @@ module SouthAfricanAirQualityIndex
156
157
  .any? do |station_name|
157
158
  processed_name = process_station(station_name)
158
159
 
159
- process_station(station['city']) == processed_name ||
160
+ process_station(station['ShortName']) == processed_name ||
161
+ process_station(station['city']) == processed_name ||
160
162
  process_station(station['DisplayName']) == processed_name ||
161
163
  process_station(station['name']) == processed_name ||
162
164
  process_station(station['owner']) == processed_name ||
@@ -171,7 +173,7 @@ module SouthAfricanAirQualityIndex
171
173
  end
172
174
 
173
175
  def process_station(name)
174
- name.downcase.gsub(' ', ' ')
176
+ name.to_s.downcase.gsub(' ', ' ')
175
177
  end
176
178
  end
177
179
  end
@@ -1,3 +1,3 @@
1
1
  module SouthAfricanAirQualityIndex
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: south_african_air_quality_index
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-08 00:00:00.000000000 Z
11
+ date: 2022-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty