cure_line 0.1.1 → 1.0.1

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: f42451faf4d618b0ad9874a00409b0c2d7a123d78a3f0eb714c593434cfb64cf
4
- data.tar.gz: c64c84bdcb08e65a04f16310fa37b8d571ad1617f26378feaa2268d918d66c71
3
+ metadata.gz: 20979225ec73e7e49e3719cd454998b996e2f8182a4a8daabb7343b7090f84c1
4
+ data.tar.gz: 33511e788a0f3095144091024c9fd5d72a65fa872868b97420913f162873c070
5
5
  SHA512:
6
- metadata.gz: 4fdc41b12c4f9d6249ee392d09a8080c79b4fd7f528e799ffb1821e69e920a8527c109af9afcfa39977cacaa7a690706b910e33a084baa3dc8a8c4540710566c
7
- data.tar.gz: cbfd56d22719e68e9ffe064d2fe418c8718d3269ca8e8f2649d22c0819d6ecbae71d44c9fd6e50db99d2a8859d73cde93fac2e29762f3f31762565ca0e9fbd8b
6
+ metadata.gz: 6a7a864eb6cf15b660fbcf05e72e884b038c16d78250dfcdfbce7881f0a71f682a67cf5b475117a5b1c674c00237954f16293ae5cfd9f504236b075ec3eddeb6
7
+ data.tar.gz: 840ac0deeb98dcb4af342c938b1ba31e57b9a673e60257a454d8337dee027d93a2040cbf4878c2a13d6ed29ceb13ba2a92e7db81194d590d258e51723fe30dd4
@@ -0,0 +1,108 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ env:
16
+ CI: "true"
17
+
18
+ jobs:
19
+ test:
20
+ runs-on: ubuntu-latest
21
+
22
+ container: ${{ matrix.ruby }}
23
+
24
+ strategy:
25
+ fail-fast: false
26
+
27
+ matrix:
28
+ ruby:
29
+ - ruby:2.5
30
+ - ruby:2.6
31
+ - ruby:2.7
32
+ - ruby:3.0
33
+ - rubylang/ruby:master-nightly-bionic
34
+ include:
35
+ - ruby: rubylang/ruby:master-nightly-bionic
36
+ allow_failures: "true"
37
+
38
+ steps:
39
+ - uses: actions/checkout@v2
40
+
41
+
42
+ - name: Cache vendor/bundle
43
+ uses: actions/cache@v1
44
+ id: cache_gem
45
+ with:
46
+ path: vendor/bundle
47
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
48
+ restore-keys: |
49
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
50
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
51
+
52
+ - name: bundle update
53
+ run: |
54
+ set -xe
55
+ bundle config path vendor/bundle
56
+ bundle update --jobs $(nproc) --retry 3
57
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
58
+
59
+ - name: Setup Code Climate Test Reporter
60
+ uses: aktions/codeclimate-test-reporter@v1
61
+ with:
62
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
63
+ command: before-build
64
+ if: matrix.ruby >= 'ruby:2.4'
65
+ continue-on-error: true
66
+
67
+ - name: Run test
68
+ run: |
69
+ set -xe
70
+ bundle exec rspec
71
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
72
+
73
+ - name: Teardown Code Climate Test Reporter
74
+ uses: aktions/codeclimate-test-reporter@v1
75
+ with:
76
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
77
+ command: after-build
78
+ if: matrix.ruby >= 'ruby:2.4' && always()
79
+ continue-on-error: true
80
+
81
+ - name: Slack Notification (not success)
82
+ uses: lazy-actions/slatify@master
83
+ if: "! success()"
84
+ continue-on-error: true
85
+ with:
86
+ job_name: ${{ format('*build* ({0})', matrix.ruby) }}
87
+ type: ${{ job.status }}
88
+ icon_emoji: ":octocat:"
89
+ url: ${{ secrets.SLACK_WEBHOOK }}
90
+ token: ${{ secrets.GITHUB_TOKEN }}
91
+
92
+ notify:
93
+ needs:
94
+ - test
95
+
96
+ runs-on: ubuntu-latest
97
+
98
+ steps:
99
+ - name: Slack Notification (success)
100
+ uses: lazy-actions/slatify@master
101
+ if: always()
102
+ continue-on-error: true
103
+ with:
104
+ job_name: '*build*'
105
+ type: ${{ job.status }}
106
+ icon_emoji: ":octocat:"
107
+ url: ${{ secrets.SLACK_WEBHOOK }}
108
+ token: ${{ secrets.GITHUB_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  ## Unreleased
2
- [full changelog](http://github.com/sue445/cure_line/compare/v0.1.1...master)
2
+ [full changelog](http://github.com/sue445/cure_line/compare/v1.0.1...master)
3
+
4
+ ## v1.0.1
5
+ [full changelog](http://github.com/sue445/cure_line/compare/v1.0.0...v1.0.1)
6
+
7
+ * Enable MFA requirement for gem releasing
8
+ * https://github.com/sue445/cure_line/pull/30
9
+
10
+ ## v1.0.0
11
+ [full changelog](http://github.com/sue445/cure_line/compare/v0.1.3...v1.0.0)
12
+
13
+ ### BREAKING CHANGES :bomb:
14
+ * Drop support ruby 2.3 and 2.4
15
+ * https://github.com/sue445/cure_line/pull/19
16
+
17
+ ### Refactorings
18
+ * [Resolved] Deprecated warning on Ruby 2.7
19
+ * https://github.com/sue445/cure_line/pull/18
20
+
21
+ ## v0.1.3
22
+ [full changelog](http://github.com/sue445/cure_line/compare/v0.1.2...v0.1.3)
23
+
24
+ * Fixed: Not Found `window.__PRELOADED_STATE__`
25
+ * https://github.com/sue445/cure_line/pull/10
26
+
27
+ ## v0.1.2
28
+ [full changelog](http://github.com/sue445/cure_line/compare/v0.1.1...v0.1.2)
29
+
30
+ * Fixed. `NoMethodError` when photo is not found
31
+ * https://github.com/sue445/cure_line/pull/9
3
32
 
4
33
  ## v0.1.1
5
34
  [full changelog](http://github.com/sue445/cure_line/compare/v0.1.0...v0.1.1)
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [LINE TIMELINE](https://timeline.line.me/) scraping tool
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/cure_line.svg)](https://badge.fury.io/rb/cure_line)
5
- [![Build Status](https://travis-ci.org/sue445/cure_line.svg?branch=master)](https://travis-ci.org/sue445/cure_line)
5
+ [![Build Status](https://github.com/sue445/cure_line/workflows/test/badge.svg?branch=master)](https://github.com/sue445/cure_line/actions?query=workflow%3Atest)
6
6
  [![Maintainability](https://api.codeclimate.com/v1/badges/25259e188e96c1b78164/maintainability)](https://codeclimate.com/github/sue445/cure_line/maintainability)
7
7
  [![Coverage Status](https://coveralls.io/repos/github/sue445/cure_line/badge.svg?branch=master)](https://coveralls.io/github/sue445/cure_line?branch=master)
8
8
 
data/cure_line.gemspec CHANGED
@@ -14,7 +14,12 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/sue445/cure_line"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.required_ruby_version = ">= 2.3.0"
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
20
+ spec.metadata["rubygems_mfa_required"] = "true"
21
+
22
+ spec.required_ruby_version = ">= 2.5.0"
18
23
 
19
24
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
25
  f.match(%r{^(test|spec|features)/})
@@ -25,11 +30,10 @@ Gem::Specification.new do |spec|
25
30
 
26
31
  spec.add_dependency "hashie"
27
32
 
28
- spec.add_development_dependency "bundler", "~> 1.16"
29
- spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0.0"
33
+ spec.add_development_dependency "bundler", ">= 1.16"
30
34
  spec.add_development_dependency "coveralls"
31
35
  spec.add_development_dependency "pry-byebug"
32
- spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "rake"
33
37
  spec.add_development_dependency "rspec", "~> 3.0"
34
38
  spec.add_development_dependency "rspec-its"
35
39
  spec.add_development_dependency "simplecov"
@@ -46,7 +46,7 @@ module CureLine
46
46
 
47
47
  # @return [Array<Hash>]
48
48
  def medias
49
- dig("post", "contents", "media")
49
+ dig("post", "contents", "media") || []
50
50
  end
51
51
  end
52
52
  end
@@ -39,10 +39,10 @@ module CureLine
39
39
  options["User-Agent"] = CureLine.config.user_agent if CureLine.config.user_agent
40
40
 
41
41
  url = "https://timeline.line.me/user/#{user_id}"
42
- html = open(url, options).read
42
+ html = URI.open(url, options).read
43
43
 
44
- m = html.match(/window.__PRELOADED_STATE__\s*=\s*({.+})/)
45
- raise "Not Found window.__PRELOADED_STATE__ in #{url}" unless m
44
+ m = html.match(%r{<script id="init_data" type="application/json">({.+})</script>})
45
+ raise %Q(Not Found <script id="init_data" type="application/json"> in #{url}) unless m
46
46
 
47
47
  @preloaded_state = CureLine::Mash.new(JSON.parse(m[1]))
48
48
  end
@@ -1,3 +1,3 @@
1
1
  module CureLine
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cure_line
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.1
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-03-20 00:00:00.000000000 Z
11
+ date: 2021-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -28,30 +28,16 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.16'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.16'
41
- - !ruby/object:Gem::Dependency
42
- name: codeclimate-test-reporter
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 1.0.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 1.0.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: coveralls
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +70,16 @@ dependencies:
84
70
  name: rake
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - "~>"
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
- version: '10.0'
75
+ version: '0'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - "~>"
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: '10.0'
82
+ version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: rspec
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -158,9 +144,9 @@ extensions: []
158
144
  extra_rdoc_files: []
159
145
  files:
160
146
  - ".coveralls.yml"
147
+ - ".github/workflows/test.yml"
161
148
  - ".gitignore"
162
149
  - ".rspec"
163
- - ".travis.yml"
164
150
  - CHANGELOG.md
165
151
  - Gemfile
166
152
  - LICENSE.txt
@@ -180,8 +166,12 @@ files:
180
166
  homepage: https://github.com/sue445/cure_line
181
167
  licenses:
182
168
  - MIT
183
- metadata: {}
184
- post_install_message:
169
+ metadata:
170
+ homepage_uri: https://github.com/sue445/cure_line
171
+ source_code_uri: https://github.com/sue445/cure_line
172
+ changelog_uri: https://github.com/sue445/cure_line/blob/master/CHANGELOG.md
173
+ rubygems_mfa_required: 'true'
174
+ post_install_message:
185
175
  rdoc_options: []
186
176
  require_paths:
187
177
  - lib
@@ -189,16 +179,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
179
  requirements:
190
180
  - - ">="
191
181
  - !ruby/object:Gem::Version
192
- version: 2.3.0
182
+ version: 2.5.0
193
183
  required_rubygems_version: !ruby/object:Gem::Requirement
194
184
  requirements:
195
185
  - - ">="
196
186
  - !ruby/object:Gem::Version
197
187
  version: '0'
198
188
  requirements: []
199
- rubyforge_project:
200
- rubygems_version: 2.7.6
201
- signing_key:
189
+ rubygems_version: 3.2.22
190
+ signing_key:
202
191
  specification_version: 4
203
192
  summary: LINE TIMELINE scraping tool
204
193
  test_files: []
data/.travis.yml DELETED
@@ -1,27 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.3
4
- - 2.4.1
5
- - 2.5.0
6
- - ruby-head
7
- bundler_args: "--jobs=4"
8
- cache: bundler
9
- before_install:
10
- - gem update --system --no-document
11
- - gem install bundler -v 1.16.1 --no-document
12
- before_script:
13
- - export CODECLIMATE_REPO_TOKEN=29bb92272b70024f792a291432c81de6da73524199d344128630289f14367f9b
14
- script:
15
- - bundle exec rspec
16
- - bundle exec codeclimate-test-reporter
17
- branches:
18
- only:
19
- - master
20
- notifications:
21
- email: false
22
- slack:
23
- secure: u7fcioS9qrq1phAZ2sr6kueIwyIsZCLHWvrdY75Fc/+0STnSwYEVQ24rX1yY2A+ThJdfOcqriUb4txpH1QmGQaf4GgddMdhslr+uBA5ISQuBgI4QZ5ePb8w7CyJGGkZB6+61QMY5InorWuNxOcTcOhne40KTkdieH0HP2QIu2vRZlxWNrCZ3dlkIsVt5ndPRT5/+0RPicJthj/cSlcsavr/W68XV8qWx9xFZmVmxLRMuoo6fR2SH6qAn2xfrvuG0NUVnZWsoMaB7J4A3qZaeZmq5vbYlP6rdp+VyBZpDl84VpbCEGtXXMS0vE+qyRPUWQGWATGlnP3inp6dZ6wumiutDRDVkSH3zFGJfL3q6dXJRFiYFAP8H9vVBMKvQYqPBfRv1mOmdA9hyRTlkGbOogh4lv/+NCs8kbfvoTQ9ywSR9QWgfc6U066+SwXJ7PKgaRs+gYLi9H5TOprwhEgSSmrHD2kIepQwDdAttLM84msAoz+FNx2Uwt1tvvvfjfKanTlqQjZQed7cTxlevA0SHS/EM0MoGHPHrwmWA8LPgHxAGYdPKLFfQxNJNpLBi/WDnVFYE5xVxyXklJcAsjWXu4lDPOT/FurovsJSk+SpNOINAnvaD50RJDQCDwdv5qGuucb0dldJDaDC/wp6GDNecZWo6cUo7lnUbt/odrl/d6k0=
24
- matrix:
25
- allow_failures:
26
- - rvm: ruby-head
27
- sudo: false