china_aqi 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/.gitignore +1 -0
- data/.rubocop.yml +60 -0
- data/.travis.yml +5 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile +11 -3
- data/README.md +34 -4
- data/china_aqi.gemspec +18 -14
- data/lib/china_aqi.rb +3 -2
- data/lib/china_aqi/aqi/dynamic/city.rb +1 -1
- data/lib/china_aqi/aqi/dynamic/city_pro.rb +1 -1
- data/lib/china_aqi/aqi/dynamic/co.rb +1 -1
- data/lib/china_aqi/aqi/dynamic/no2.rb +1 -1
- data/lib/china_aqi/aqi/dynamic/o3.rb +1 -1
- data/lib/china_aqi/aqi/dynamic/pm10.rb +1 -1
- data/lib/china_aqi/aqi/dynamic/pm25.rb +1 -1
- data/lib/china_aqi/aqi/dynamic/so2.rb +1 -1
- data/lib/china_aqi/aqi/static/global.rb +1 -1
- data/lib/china_aqi/aqi/static/ranking.rb +1 -1
- data/lib/china_aqi/aqi/station.rb +1 -1
- data/lib/china_aqi/base.rb +7 -7
- data/lib/china_aqi/exceptions.rb +1 -1
- data/lib/china_aqi/helper/available_cities.rb +11 -0
- data/lib/china_aqi/helper/city_stations.rb +2 -3
- data/lib/china_aqi/utility.rb +5 -3
- data/lib/china_aqi/version.rb +1 -1
- data/lib/generators/china_aqi/install/install_generator.rb +3 -2
- data/spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/ChinaAqi_AvailableCities/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +139 -0
- data/spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/have_module_function_called_available_cities_to_get_all_available_cities.yml +139 -0
- data/spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/return_a_hash_with_aqi_data_when_call_get_instance_method.yml +139 -0
- data/spec/cassettes/ChinaAqi/ChinaAqi_CityStations/ChinaAqi_CityStations/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +69 -0
- data/spec/cassettes/ChinaAqi/ChinaAqi_CityStations/have_module_function_called_get_stations_for_city_to_get_stations_for_one_city.yml +69 -0
- data/spec/cassettes/ChinaAqi/ChinaAqi_CityStations/return_a_hash_with_aqi_data_when_call_get_instance_method.yml +69 -0
- data/spec/cassettes/ChinaAqi/ChinaAqi_Station/ChinaAqi_Station/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +63 -0
- data/spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_CO/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +100 -0
- data/spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_City/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +95 -0
- data/spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_CityPro/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +58 -0
- data/spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_NO2/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +100 -0
- data/spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_O3/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +106 -0
- data/spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_PM10/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +101 -0
- data/spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_PM25/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +58 -0
- data/spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_SO2/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +100 -0
- data/spec/cassettes/ChinaAqi/Static_models/ChinaAqi_Global/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +58 -0
- data/spec/cassettes/ChinaAqi/Static_models/ChinaAqi_Ranking/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml +58 -0
- data/spec/china_aqi/aqi_spec.rb +89 -113
- data/spec/china_aqi/base_spec.rb +25 -32
- data/spec/china_aqi_spec.rb +6 -6
- data/spec/spec_helper.rb +7 -0
- metadata +54 -31
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
require 'coveralls'
|
2
|
+
require 'vcr'
|
2
3
|
Coveralls.wear!
|
3
4
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
4
5
|
require 'china_aqi'
|
6
|
+
|
7
|
+
VCR.configure do |c|
|
8
|
+
c.cassette_library_dir = 'spec/cassettes'
|
9
|
+
c.hook_into :webmock
|
10
|
+
c.configure_rspec_metadata!
|
11
|
+
end
|
metadata
CHANGED
@@ -1,83 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: china_aqi
|
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
|
- Xuhao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '>='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '>='
|
38
|
+
- - ">="
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: activesupport
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- -
|
45
|
+
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: '0'
|
62
48
|
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- -
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: httparty
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- -
|
59
|
+
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
61
|
version: '0'
|
76
62
|
type: :runtime
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- -
|
66
|
+
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '0'
|
83
69
|
description: China AQI API from PM25.in
|
@@ -87,9 +73,11 @@ executables: []
|
|
87
73
|
extensions: []
|
88
74
|
extra_rdoc_files: []
|
89
75
|
files:
|
90
|
-
- .gitignore
|
91
|
-
- .rspec
|
92
|
-
- .
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".rubocop.yml"
|
79
|
+
- ".travis.yml"
|
80
|
+
- CHANGELOG.md
|
93
81
|
- Gemfile
|
94
82
|
- LICENSE.txt
|
95
83
|
- README.md
|
@@ -109,11 +97,29 @@ files:
|
|
109
97
|
- lib/china_aqi/aqi/station.rb
|
110
98
|
- lib/china_aqi/base.rb
|
111
99
|
- lib/china_aqi/exceptions.rb
|
100
|
+
- lib/china_aqi/helper/available_cities.rb
|
112
101
|
- lib/china_aqi/helper/city_stations.rb
|
113
102
|
- lib/china_aqi/utility.rb
|
114
103
|
- lib/china_aqi/version.rb
|
115
104
|
- lib/generators/china_aqi/install/USAGE
|
116
105
|
- lib/generators/china_aqi/install/install_generator.rb
|
106
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/ChinaAqi_AvailableCities/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
107
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/have_module_function_called_available_cities_to_get_all_available_cities.yml
|
108
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/return_a_hash_with_aqi_data_when_call_get_instance_method.yml
|
109
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_CityStations/ChinaAqi_CityStations/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
110
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_CityStations/have_module_function_called_get_stations_for_city_to_get_stations_for_one_city.yml
|
111
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_CityStations/return_a_hash_with_aqi_data_when_call_get_instance_method.yml
|
112
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_Station/ChinaAqi_Station/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
113
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_CO/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
114
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_City/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
115
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_CityPro/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
116
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_NO2/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
117
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_O3/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
118
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_PM10/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
119
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_PM25/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
120
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_SO2/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
121
|
+
- spec/cassettes/ChinaAqi/Static_models/ChinaAqi_Global/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
122
|
+
- spec/cassettes/ChinaAqi/Static_models/ChinaAqi_Ranking/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
117
123
|
- spec/china_aqi/aqi_spec.rb
|
118
124
|
- spec/china_aqi/base_spec.rb
|
119
125
|
- spec/china_aqi_spec.rb
|
@@ -128,21 +134,38 @@ require_paths:
|
|
128
134
|
- lib
|
129
135
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
136
|
requirements:
|
131
|
-
- -
|
137
|
+
- - ">="
|
132
138
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
139
|
+
version: 1.9.3
|
134
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
141
|
requirements:
|
136
|
-
- -
|
142
|
+
- - ">="
|
137
143
|
- !ruby/object:Gem::Version
|
138
144
|
version: '0'
|
139
145
|
requirements: []
|
140
146
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.5.1
|
142
148
|
signing_key:
|
143
149
|
specification_version: 4
|
144
150
|
summary: China AQI API from PM25.in
|
145
151
|
test_files:
|
152
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/ChinaAqi_AvailableCities/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
153
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/have_module_function_called_available_cities_to_get_all_available_cities.yml
|
154
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_AvailableCities/return_a_hash_with_aqi_data_when_call_get_instance_method.yml
|
155
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_CityStations/ChinaAqi_CityStations/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
156
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_CityStations/have_module_function_called_get_stations_for_city_to_get_stations_for_one_city.yml
|
157
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_CityStations/return_a_hash_with_aqi_data_when_call_get_instance_method.yml
|
158
|
+
- spec/cassettes/ChinaAqi/ChinaAqi_Station/ChinaAqi_Station/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
159
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_CO/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
160
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_City/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
161
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_CityPro/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
162
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_NO2/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
163
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_O3/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
164
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_PM10/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
165
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_PM25/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
166
|
+
- spec/cassettes/ChinaAqi/Dynamic_models/ChinaAqi_SO2/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
167
|
+
- spec/cassettes/ChinaAqi/Static_models/ChinaAqi_Global/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
168
|
+
- spec/cassettes/ChinaAqi/Static_models/ChinaAqi_Ranking/return_an_array_or_hash_with_aqi_data_when_call_get_method.yml
|
146
169
|
- spec/china_aqi/aqi_spec.rb
|
147
170
|
- spec/china_aqi/base_spec.rb
|
148
171
|
- spec/china_aqi_spec.rb
|