apple_system_status 1.0.1 → 2.0.0

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: fdb02da837139b920ce149ed9c00eb36e1f29e4f947e62e6e44e6a51d91b2948
4
- data.tar.gz: fe8fb64f2c99690e179b9cb2d7350869381f7ae8977a011a1c0f681117582486
3
+ metadata.gz: b17a312fbab70eeb4a90c28d6740a2bdb7757e554d19b8791bdfa48be16c156b
4
+ data.tar.gz: 433c1014b1d8b830fb23f19379e58d4c7dcdac12734d103b59f7393775846f97
5
5
  SHA512:
6
- metadata.gz: 8ac5ff5d6188ab25320c79612223d51b9311bba5d256eb793183161ffb9efcfa04a981899f0234a8fe36869c06a258ba52b23f86ca75126dd12172049a55e51d
7
- data.tar.gz: 866a50d5218a4e9d8f4aef626ddb1471b39aeae7dbb8de593c2dc746983da4ec0140dafc695915242ff30081e1e23b6085f05bfcf4935aaa641e21128d01c88c
6
+ metadata.gz: ab0f6d3d9efbe45f72809a2df1967a7f348c51d1303faae5c62615a9c235b277d28a6de7691becc0985610d16c67c3d219e9d1b9d7578bf4e333cc0bd93c72e4
7
+ data.tar.gz: 74952960423ecbfb2b681134fe34a3284be27b6baa414a8026a867f39db24fdc37667f2e7a9af01b854cabc4ddbe267ce98bcc02601541e0ffb3ce14aac3aff0
data/.circleci/config.yml CHANGED
@@ -1,94 +1,60 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
-
7
- environment: &environment
8
- LANG: en_US.UTF-8
9
- LANGUAGE: en_US.UTF-8
10
- LC_ALL: C.UTF-8
11
-
12
- BUNDLE_PATH: vendor/bundle
13
- BUNDLE_JOBS: 4
14
- CODECLIMATE_REPO_TOKEN: 89b665462d69ce4c873ee8165d496c4a97b9afaaf48e375c1bc3200e4b45b1e7
15
-
16
- default: &default
17
- docker:
18
- - image: circleci/ruby
19
- environment:
20
- <<: *environment
21
-
22
- working_directory: ~/app
23
-
24
- restore_bundle_cache_option: &restore_bundle_cache_option
25
- keys:
26
- - v1-bundle-{{ .Environment.CIRCLE_JOB }}-{{ epoch }}
27
- - v1-bundle-{{ .Environment.CIRCLE_JOB }}
28
-
29
- save_bundle_cache_option: &save_bundle_cache_option
30
- key: v1-bundle-{{ .Environment.CIRCLE_JOB }}-{{ epoch }}
31
- paths:
32
- - ~/app/vendor/bundle
33
- - ~/app/Gemfile.lock
34
-
35
- rspec_steps: &rspec_steps
36
- - checkout
37
- - restore_cache:
38
- <<: *restore_bundle_cache_option
39
- - run: ./.circleci/setup.sh
40
- - save_cache:
41
- <<: *save_bundle_cache_option
42
-
43
- - run: bundle exec rspec
44
- - run: bundle exec codeclimate-test-reporter
45
-
46
- build_jobs: &build_jobs
47
- - ruby:2.2
48
- - ruby:2.3
49
- - ruby:2.4
50
- - ruby:2.5
51
-
52
- jobs:
53
- ruby:2.2:
54
- <<: *default
55
-
1
+ version: 2.1
2
+
3
+ orbs:
4
+ browser-tools: circleci/browser-tools@volatile
5
+ codeclimate: sue445/codeclimate@volatile
6
+ slack: circleci/slack@3
7
+
8
+ executors:
9
+ ruby:
10
+ parameters:
11
+ version:
12
+ type: string
56
13
  docker:
57
- - image: circleci/ruby:2.2-node-browsers
58
- environment:
59
- <<: *environment
14
+ - image: cimg/ruby:<< parameters.version >>-browsers
15
+ environment:
16
+ # c.f. https://github.com/ffaker/ffaker/issues/277#issuecomment-263519146
17
+ LANG: en_US.UTF-8
18
+ LANGUAGE: en_US.UTF-8
19
+ LC_ALL: C.UTF-8
20
+
21
+ BUNDLE_PATH: vendor/bundle
22
+ BUNDLE_JOBS: 4
23
+ CC_TEST_REPORTER_ID: 89b665462d69ce4c873ee8165d496c4a97b9afaaf48e375c1bc3200e4b45b1e7
24
+ working_directory: ~/app
60
25
 
61
- steps: *rspec_steps
62
-
63
- ruby:2.3:
64
- <<: *default
65
-
66
- docker:
67
- - image: circleci/ruby:2.3-node-browsers
68
- environment:
69
- <<: *environment
70
-
71
- steps: *rspec_steps
72
-
73
- ruby:2.4:
74
- <<: *default
75
-
76
- docker:
77
- - image: circleci/ruby:2.4-node-browsers
78
- environment:
79
- <<: *environment
80
-
81
- steps: *rspec_steps
82
-
83
- ruby:2.5:
84
- <<: *default
85
-
86
- docker:
87
- - image: circleci/ruby:2.5-node-browsers
88
- environment:
89
- <<: *environment
26
+ jobs:
27
+ rspec:
28
+ parameters:
29
+ version:
30
+ type: string
31
+ executor:
32
+ name: ruby
33
+ version: << parameters.version >>
34
+ steps:
35
+ - browser-tools/install-browser-tools
36
+ - checkout
37
+ - run: bundle --version
38
+ - run: gem --version
39
+ - run: google-chrome --version
40
+ - run: chromedriver --version
41
+ - run: bundle config --local path vendor/bundle
42
+ - run: bundle install --jobs=4 --retry=3
43
+ - codeclimate/with-cc-test-reporter:
44
+ after_build_args: "--coverage-input-type simplecov"
45
+ steps:
46
+ - run: bundle exec rspec
47
+ - slack/notify-on-failure
90
48
 
91
- steps: *rspec_steps
49
+ build_jobs: &build_jobs
50
+ - rspec:
51
+ matrix:
52
+ parameters:
53
+ version:
54
+ - "2.5"
55
+ - "2.6"
56
+ - "2.7"
57
+ - "3.0"
92
58
 
93
59
  workflows:
94
60
  version: 2
@@ -99,7 +65,7 @@ workflows:
99
65
  weekly_build:
100
66
  triggers:
101
67
  - schedule:
102
- cron: "00 19 * * 5" # JST 4:00 (Sat)
68
+ cron: "00 10 * * 5" # JST 19:00 (Fri)
103
69
  filters:
104
70
  branches:
105
71
  only: master
data/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.0.0](https://github.com/sue445/apple_system_status/tree/v2.0.0) (2021-10-16)
4
+ [Full Changelog](https://github.com/sue445/apple_system_status/compare/v1.0.4...v2.0.0)
5
+
6
+ * :bomb: **[BREAKING CHANGE]** Drop support ruby < 2.5
7
+ * https://github.com/sue445/apple_system_status/pull/65
8
+ * Don't use selenium-webdriver v4
9
+ * https://github.com/sue445/apple_system_status/pull/63
10
+
11
+ ## [v1.0.4](https://github.com/sue445/apple_system_status/tree/v1.0.4) (2019-06-19)
12
+ [Full Changelog](https://github.com/sue445/apple_system_status/compare/v1.0.3...v1.0.4)
13
+
14
+ * Disable w3c for chrome75+
15
+ * https://github.com/sue445/apple_system_status/pull/43
16
+
17
+ ## [v1.0.3](https://github.com/sue445/apple_system_status/tree/v1.0.3) (2018-10-27)
18
+ [Full Changelog](https://github.com/sue445/apple_system_status/compare/v1.0.2...v1.0.3)
19
+
20
+ **Merged pull requests:**
21
+
22
+ - Add chrome\_options\_binary arg [\#33](https://github.com/sue445/apple_system_status/pull/33) ([sue445](https://github.com/sue445))
23
+
24
+ ## [v1.0.2](https://github.com/sue445/apple_system_status/tree/v1.0.2) (2018-09-23)
25
+ [Full Changelog](https://github.com/sue445/apple_system_status/compare/v1.0.1...v1.0.2)
26
+
27
+ **Closed issues:**
28
+
29
+ - Add chrome\_options\_args to Crawler\#initialize [\#30](https://github.com/sue445/apple_system_status/issues/30)
30
+
31
+ **Merged pull requests:**
32
+
33
+ - Add chrome\_options\_args to Crawler.perform [\#32](https://github.com/sue445/apple_system_status/pull/32) ([sue445](https://github.com/sue445))
34
+
35
+ ## [v1.0.1](https://github.com/sue445/apple_system_status/tree/v1.0.1) (2018-09-23)
36
+ [Full Changelog](https://github.com/sue445/apple_system_status/compare/v1.0.0...v1.0.1)
37
+
38
+ **Merged pull requests:**
39
+
40
+ - Add chrome\_options\_args to Crawler\#initialize [\#31](https://github.com/sue445/apple_system_status/pull/31) ([sue445](https://github.com/sue445))
41
+ - Tweak CI setting [\#29](https://github.com/sue445/apple_system_status/pull/29) ([sue445](https://github.com/sue445))
42
+
3
43
  ## [v1.0.0](https://github.com/sue445/apple_system_status/tree/v1.0.0) (2018-09-22)
4
44
  [Full Changelog](https://github.com/sue445/apple_system_status/compare/v0.3.2...v1.0.0)
5
45
 
data/Gemfile CHANGED
@@ -2,8 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in apple_system_status.gemspec
4
4
  gemspec
5
-
6
- if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.2")
7
- # NOTE: rack 2.x supports only ruby 2.2.2+
8
- gem "rack", "< 2.0.0"
9
- end
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  ## Requirements
12
12
  * Ruby 2.2+
13
- * Headless CHrome
13
+ * Headless Chrome
14
14
 
15
15
  ## Installation
16
16
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/sue445/apple_system_status"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.required_ruby_version = ">= 2.2"
17
+ spec.required_ruby_version = ">= 2.5"
18
18
 
19
19
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
20
20
  # delete this section to allow pushing this gem to any host.
@@ -30,16 +30,15 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ["lib"]
31
31
 
32
32
  spec.add_dependency "capybara"
33
- spec.add_dependency "selenium-webdriver"
33
+ spec.add_dependency "selenium-webdriver", "< 4.0.0"
34
34
  spec.add_dependency "thor"
35
35
 
36
36
  spec.add_development_dependency "bundler"
37
- spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0.0"
38
37
  spec.add_development_dependency "coveralls"
39
- spec.add_development_dependency "pry-byebug"
40
- spec.add_development_dependency "rake", "~> 10.0"
38
+ spec.add_development_dependency "rake"
41
39
  spec.add_development_dependency "rspec"
42
40
  spec.add_development_dependency "rspec-parameterized"
43
- spec.add_development_dependency "simplecov"
41
+ spec.add_development_dependency "simplecov", "< 0.18.0"
42
+ spec.add_development_dependency "unparser", ">= 0.4.5"
44
43
  spec.add_development_dependency "yard"
45
44
  end
@@ -16,16 +16,17 @@ module AppleSystemStatus
16
16
  MAX_RETRY_COUNT = 5
17
17
 
18
18
  # @param chrome_options_args [Array<String>]
19
- def initialize(chrome_options_args: DEFAULT_CHROME_OPTIONS_ARGS)
19
+ # @param chrome_options_binary [String]
20
+ def initialize(chrome_options_args: DEFAULT_CHROME_OPTIONS_ARGS, chrome_options_binary: nil)
20
21
  Capybara.register_driver :chrome_headless do |app|
21
22
  client = Selenium::WebDriver::Remote::Http::Default.new
22
23
  client.read_timeout = 120
23
24
 
24
- capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
25
- chromeOptions: {
26
- args: chrome_options_args,
27
- }
28
- )
25
+ chrome_options = { args: chrome_options_args }
26
+ chrome_options[:binary] = chrome_options_binary if chrome_options_binary
27
+ chrome_options[:w3c] = false # for chrome 75+
28
+
29
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: chrome_options)
29
30
 
30
31
  Capybara::Selenium::Driver.new(
31
32
  app,
@@ -94,6 +95,8 @@ module AppleSystemStatus
94
95
  # crawl apple system status page. When finished crawling, clear capybara session
95
96
  # @param country [String] country code. (e.g. jp, ca, fr. default. us)
96
97
  # @param title [String] If specified, narrow the service title
98
+ # @param chrome_options_args [Array<String>]
99
+ # @param chrome_options_binary [String]
97
100
  # @return [Hash]
98
101
  # @example response format
99
102
  # {
@@ -103,8 +106,8 @@ module AppleSystemStatus
103
106
  # ]
104
107
  # }
105
108
  # @link https://github.com/teampoltergeist/poltergeist#memory-leak
106
- def self.perform(country: nil, title: nil)
107
- crawler = AppleSystemStatus::Crawler.new
109
+ def self.perform(country: nil, title: nil, chrome_options_args: DEFAULT_CHROME_OPTIONS_ARGS, chrome_options_binary: nil)
110
+ crawler = AppleSystemStatus::Crawler.new(chrome_options_args: chrome_options_args, chrome_options_binary: chrome_options_binary)
108
111
  crawler.perform(country: country, title: title)
109
112
  ensure
110
113
  crawler.quit!
@@ -1,3 +1,3 @@
1
1
  module AppleSystemStatus
2
- VERSION = "1.0.1"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple_system_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-23 00:00:00.000000000 Z
11
+ date: 2021-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 4.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "<"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 4.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: codeclimate-test-reporter
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 1.0.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 1.0.0
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: coveralls
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -95,7 +81,7 @@ dependencies:
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
- name: pry-byebug
84
+ name: rake
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - ">="
@@ -109,21 +95,21 @@ dependencies:
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
- name: rake
98
+ name: rspec
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - "~>"
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
- version: '10.0'
103
+ version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - "~>"
108
+ - - ">="
123
109
  - !ruby/object:Gem::Version
124
- version: '10.0'
110
+ version: '0'
125
111
  - !ruby/object:Gem::Dependency
126
- name: rspec
112
+ name: rspec-parameterized
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
115
  - - ">="
@@ -137,33 +123,33 @@ dependencies:
137
123
  - !ruby/object:Gem::Version
138
124
  version: '0'
139
125
  - !ruby/object:Gem::Dependency
140
- name: rspec-parameterized
126
+ name: simplecov
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - ">="
129
+ - - "<"
144
130
  - !ruby/object:Gem::Version
145
- version: '0'
131
+ version: 0.18.0
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - ">="
136
+ - - "<"
151
137
  - !ruby/object:Gem::Version
152
- version: '0'
138
+ version: 0.18.0
153
139
  - !ruby/object:Gem::Dependency
154
- name: simplecov
140
+ name: unparser
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
143
  - - ">="
158
144
  - !ruby/object:Gem::Version
159
- version: '0'
145
+ version: 0.4.5
160
146
  type: :development
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
150
  - - ">="
165
151
  - !ruby/object:Gem::Version
166
- version: '0'
152
+ version: 0.4.5
167
153
  - !ruby/object:Gem::Dependency
168
154
  name: yard
169
155
  requirement: !ruby/object:Gem::Requirement
@@ -187,7 +173,6 @@ extensions: []
187
173
  extra_rdoc_files: []
188
174
  files:
189
175
  - ".circleci/config.yml"
190
- - ".circleci/setup.sh"
191
176
  - ".coveralls.yml"
192
177
  - ".gitignore"
193
178
  - ".rspec"
@@ -210,7 +195,7 @@ licenses:
210
195
  - MIT
211
196
  metadata:
212
197
  allowed_push_host: https://rubygems.org
213
- post_install_message:
198
+ post_install_message:
214
199
  rdoc_options: []
215
200
  require_paths:
216
201
  - lib
@@ -218,16 +203,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
203
  requirements:
219
204
  - - ">="
220
205
  - !ruby/object:Gem::Version
221
- version: '2.2'
206
+ version: '2.5'
222
207
  required_rubygems_version: !ruby/object:Gem::Requirement
223
208
  requirements:
224
209
  - - ">="
225
210
  - !ruby/object:Gem::Version
226
211
  version: '0'
227
212
  requirements: []
228
- rubyforge_project:
229
- rubygems_version: 2.7.6
230
- signing_key:
213
+ rubygems_version: 3.2.22
214
+ signing_key:
231
215
  specification_version: 4
232
216
  summary: Apple System Status scraping library
233
217
  test_files: []
data/.circleci/setup.sh DELETED
@@ -1,8 +0,0 @@
1
- #!/bin/bash -xe
2
-
3
- ruby --version
4
- bundle --version
5
- gem --version
6
-
7
- bundle check || bundle update
8
- bundle clean