irasutoya 1.1.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c5a5b3dab5c783dcb0aa961cab26f390a0e54081bd81479d13e177f0c37fcf7
4
- data.tar.gz: 8a2a78034c9839bdc3c9a20a73e2428dacee819bbe068e85107b792bae46294e
3
+ metadata.gz: b6c34130f06a3b94e02fedad0c2eaf53a782cd1440f8ad6b045c3f42932b1250
4
+ data.tar.gz: c62d42c3fafeacc06854dafa5d153ee4e614f2d341f4b5766da55d3ee72752d5
5
5
  SHA512:
6
- metadata.gz: 5979a9ab3500f788d6440857c8a1ec7f2c2fb1287106de4ae130322634c94580eb10177f08b0ddd1c3b1d3a400b6bdb0b388196c5b70c5eeef679fc926db0721
7
- data.tar.gz: 2c92ca11d1cfea630d5578d891709c19ae42c20de65dfd52e81dfa4df88491e1014f8032199b5123a6d4809a45ae67ad87639f852e3a12e33fec95930dcf513e
6
+ metadata.gz: 0a13d0edc6f15948dd43057f6f9c154fd2163bf6be5eb9276d421b70e9e124ed85639f8441e0c6b9279ab01ac77f0482720e911ca68b7616cd009f38b709c6d8
7
+ data.tar.gz: 79b2ded3f30e0c756d557a6d6a9bfdde1e843663c09aa399af9b97d88004bee627140734848ad71ee37c061eebdbd7a056db561dfc2bde7e12da12a8e1806a69
@@ -0,0 +1,16 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "12:00"
8
+ timezone: Asia/Tokyo
9
+ open-pull-requests-limit: 20
10
+ reviewers:
11
+ - unhappychoice
12
+ allow:
13
+ - dependency-type: direct
14
+ - dependency-type: indirect
15
+ ignore:
16
+
@@ -0,0 +1,45 @@
1
+ name: release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: Release version
8
+ required: true
9
+ type: choice
10
+ options:
11
+ - major
12
+ - minor
13
+ - patch
14
+ jobs:
15
+ push:
16
+ name: Push gem to RubyGems.org
17
+ runs-on: ubuntu-latest
18
+ environment:
19
+ name: release
20
+ permissions:
21
+ id-token: write
22
+ contents: write
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - name: Set up Ruby
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ bundler-cache: true
29
+ ruby-version: .ruby-version
30
+ - name: Setup Git
31
+ run: |
32
+ git config --global user.email "unhappychoice@gmail.com"
33
+ git config --global user.name "unhappychoice"
34
+ - name: Install gem-release
35
+ run: gem install gem-release
36
+ - name: Bump version
37
+ run: |
38
+ git status
39
+ gem bump --version ${{inputs.version}} --message ':tada: Bump %{name} to %{version}'
40
+ git status
41
+ bundle config set frozen false
42
+ bundle install
43
+ git add .
44
+ git commit --amend --no-edit
45
+ - uses: rubygems/release-gem@v1
@@ -3,20 +3,39 @@ name: test
3
3
  on: [push]
4
4
 
5
5
  jobs:
6
- build:
6
+ lint:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@master
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: .ruby-version
14
+ - name: Install bundler
15
+ run: gem install bundler
16
+ - name: Install dependencies
17
+ run: bundle install --jobs 4
18
+ - name: Run lint
19
+ run: bundle exec rubocop lib
20
+ test:
7
21
  runs-on: ubuntu-latest
8
22
  strategy:
9
23
  matrix:
10
- ruby: ['2.6.x', '2.5.x', '2.4.x']
24
+ ruby: ['3.4.4', '3.3.8', '3.2.8', '3.1.7']
11
25
  steps:
12
26
  - uses: actions/checkout@master
13
27
  - name: Set up Ruby
14
- uses: actions/setup-ruby@v1
28
+ uses: ruby/setup-ruby@v1
15
29
  with:
16
30
  ruby-version: ${{ matrix.ruby }}
31
+ rubygems: latest
17
32
  - name: Install bundler
18
33
  run: gem install bundler
19
34
  - name: Install dependencies
20
35
  run: bundle install --jobs 4
21
36
  - name: Run test
37
+ env:
38
+ RAILS_ENV: test
39
+ COVERAGE: true
40
+ CODECOV_TOKEN: 3786990f-aaba-4bc7-8a14-dcaac1d22749
22
41
  run: bundle exec rspec
data/.gitignore ADDED
@@ -0,0 +1,57 @@
1
+ # Created by https://www.gitignore.io/api/ruby
2
+ # Edit at https://www.gitignore.io/?templates=ruby
3
+
4
+ ### Ruby ###
5
+ *.gem
6
+ *.rbc
7
+ /.config
8
+ /coverage/
9
+ /InstalledFiles
10
+ /pkg/
11
+ /spec/reports/
12
+ /spec/examples.txt
13
+ /test/tmp/
14
+ /test/version_tmp/
15
+ /tmp/
16
+
17
+ # Used by dotenv library to load environment variables.
18
+ # .env
19
+
20
+ ## Specific to RubyMotion:
21
+ .dat*
22
+ .repl_history
23
+ build/
24
+ *.bridgesupport
25
+ build-iPhoneOS/
26
+ build-iPhoneSimulator/
27
+
28
+ ## Specific to RubyMotion (use of CocoaPods):
29
+ #
30
+ # We recommend against adding the Pods directory to your .gitignore. However
31
+ # you should judge for yourself, the pros and cons are mentioned at:
32
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
33
+ #
34
+ # vendor/Pods/
35
+
36
+ ## Documentation cache and generated files:
37
+ /.yardoc/
38
+ /_yardoc/
39
+ /doc/
40
+ /rdoc/
41
+
42
+ ## Environment normalization:
43
+ /.bundle/
44
+ /vendor/bundle
45
+ /lib/bundler/man/
46
+ vendor/bundle
47
+
48
+ # for a library or gem, you might want to ignore these files since the code is
49
+ # intended to run in multiple environments; otherwise, check them in:
50
+ # Gemfile.lock
51
+ # .ruby-version
52
+ # .ruby-gemset
53
+
54
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
55
+ .rvmrc
56
+
57
+ # End of https://www.gitignore.io/api/ruby
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
4
  NewCops: enable
5
- TargetRubyVersion: 2.4
5
+ TargetRubyVersion: 3.1
6
6
 
7
7
  Style/Documentation:
8
8
  Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.4
data/Gemfile.lock CHANGED
@@ -1,28 +1,48 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- irasutoya (1.1.0)
4
+ irasutoya (2.0.1)
5
5
  nokogiri
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- ast (2.4.1)
11
- codecov (0.2.12)
12
- json
13
- simplecov
10
+ activesupport (8.0.1)
11
+ base64
12
+ benchmark (>= 0.3)
13
+ bigdecimal
14
+ concurrent-ruby (~> 1.0, >= 1.3.1)
15
+ connection_pool (>= 2.2.5)
16
+ drb
17
+ i18n (>= 1.6, < 2)
18
+ logger (>= 1.4.2)
19
+ minitest (>= 5.1)
20
+ securerandom (>= 0.3)
21
+ tzinfo (~> 2.0, >= 2.0.5)
22
+ uri (>= 0.13.1)
23
+ ast (2.4.2)
24
+ base64 (0.2.0)
25
+ benchmark (0.4.0)
26
+ bigdecimal (3.1.9)
27
+ codecov (0.6.0)
28
+ simplecov (>= 0.15, < 0.22)
14
29
  coderay (1.1.3)
15
- diff-lcs (1.4.4)
16
- docile (1.3.2)
17
- ffi (1.13.1)
18
- formatador (0.2.5)
19
- guard (2.16.2)
30
+ concurrent-ruby (1.3.4)
31
+ connection_pool (2.4.1)
32
+ csv (3.3.2)
33
+ diff-lcs (1.5.1)
34
+ docile (1.4.1)
35
+ drb (2.2.1)
36
+ ffi (1.17.1)
37
+ fileutils (1.7.3)
38
+ formatador (1.1.0)
39
+ guard (2.19.0)
20
40
  formatador (>= 0.2.4)
21
41
  listen (>= 2.7, < 4.0)
22
42
  lumberjack (>= 1.0.12, < 2.0)
23
43
  nenv (~> 0.1)
24
44
  notiffany (~> 0.0)
25
- pry (>= 0.9.12)
45
+ pry (>= 0.13.0)
26
46
  shellany (~> 0.0)
27
47
  thor (>= 0.18.1)
28
48
  guard-compat (1.2.1)
@@ -30,72 +50,108 @@ GEM
30
50
  guard (~> 2.1)
31
51
  guard-compat (~> 1.1)
32
52
  rspec (>= 2.99.0, < 4.0)
33
- guard-rubocop (1.3.0)
53
+ guard-rubocop (1.5.0)
34
54
  guard (~> 2.0)
35
- rubocop (~> 0.20)
36
- json (2.3.1)
37
- listen (3.2.1)
55
+ rubocop (< 2.0)
56
+ i18n (1.14.6)
57
+ concurrent-ruby (~> 1.0)
58
+ json (2.9.1)
59
+ language_server-protocol (3.17.0.3)
60
+ listen (3.9.0)
38
61
  rb-fsevent (~> 0.10, >= 0.10.3)
39
62
  rb-inotify (~> 0.9, >= 0.9.10)
40
- lumberjack (1.2.8)
41
- method_source (1.0.0)
42
- mini_portile2 (2.4.0)
63
+ logger (1.6.4)
64
+ lumberjack (1.2.10)
65
+ method_source (1.1.0)
66
+ mini_portile2 (2.8.9)
67
+ minitest (5.25.4)
43
68
  nenv (0.3.0)
44
- nokogiri (1.10.10)
45
- mini_portile2 (~> 2.4.0)
69
+ nokogiri (1.18.8)
70
+ mini_portile2 (~> 2.8.2)
71
+ racc (~> 1.4)
46
72
  notiffany (0.1.3)
47
73
  nenv (~> 0.1)
48
74
  shellany (~> 0.0)
49
- parallel (1.19.2)
50
- parser (2.7.2.0)
75
+ parallel (1.26.3)
76
+ parser (3.3.6.0)
51
77
  ast (~> 2.4.1)
52
- pry (0.13.1)
78
+ racc
79
+ pry (0.15.2)
53
80
  coderay (~> 1.1)
54
81
  method_source (~> 1.0)
55
- rainbow (3.0.0)
56
- rake (13.0.1)
57
- rb-fsevent (0.10.4)
58
- rb-inotify (0.10.1)
82
+ racc (1.8.1)
83
+ rainbow (3.1.1)
84
+ rake (13.2.1)
85
+ rb-fsevent (0.11.2)
86
+ rb-inotify (0.11.1)
59
87
  ffi (~> 1.0)
60
- regexp_parser (1.8.2)
61
- rexml (3.2.4)
62
- rspec (3.9.0)
63
- rspec-core (~> 3.9.0)
64
- rspec-expectations (~> 3.9.0)
65
- rspec-mocks (~> 3.9.0)
66
- rspec-core (3.9.3)
67
- rspec-support (~> 3.9.3)
68
- rspec-expectations (3.9.2)
88
+ rbs (3.8.1)
89
+ logger
90
+ regexp_parser (2.10.0)
91
+ rspec (3.13.0)
92
+ rspec-core (~> 3.13.0)
93
+ rspec-expectations (~> 3.13.0)
94
+ rspec-mocks (~> 3.13.0)
95
+ rspec-core (3.13.2)
96
+ rspec-support (~> 3.13.0)
97
+ rspec-expectations (3.13.3)
69
98
  diff-lcs (>= 1.2.0, < 2.0)
70
- rspec-support (~> 3.9.0)
71
- rspec-mocks (3.9.1)
99
+ rspec-support (~> 3.13.0)
100
+ rspec-mocks (3.13.2)
72
101
  diff-lcs (>= 1.2.0, < 2.0)
73
- rspec-support (~> 3.9.0)
74
- rspec-support (3.9.3)
75
- rubocop (0.93.1)
102
+ rspec-support (~> 3.13.0)
103
+ rspec-support (3.13.2)
104
+ rubocop (1.69.2)
105
+ json (~> 2.3)
106
+ language_server-protocol (>= 3.17.0)
76
107
  parallel (~> 1.10)
77
- parser (>= 2.7.1.5)
108
+ parser (>= 3.3.0.2)
78
109
  rainbow (>= 2.2.2, < 4.0)
79
- regexp_parser (>= 1.8)
80
- rexml
81
- rubocop-ast (>= 0.6.0)
110
+ regexp_parser (>= 2.9.3, < 3.0)
111
+ rubocop-ast (>= 1.36.2, < 2.0)
82
112
  ruby-progressbar (~> 1.7)
83
- unicode-display_width (>= 1.4.0, < 2.0)
84
- rubocop-ast (0.8.0)
85
- parser (>= 2.7.1.5)
86
- ruby-progressbar (1.10.1)
113
+ unicode-display_width (>= 2.4.0, < 4.0)
114
+ rubocop-ast (1.37.0)
115
+ parser (>= 3.3.1.0)
116
+ ruby-progressbar (1.13.0)
117
+ securerandom (0.4.1)
87
118
  shellany (0.0.1)
88
- simplecov (0.18.5)
119
+ simplecov (0.21.2)
89
120
  docile (~> 1.1)
90
121
  simplecov-html (~> 0.11)
91
- simplecov-html (0.12.3)
92
- thor (1.0.1)
93
- unicode-display_width (1.7.0)
122
+ simplecov_json_formatter (~> 0.1)
123
+ simplecov-html (0.13.1)
124
+ simplecov_json_formatter (0.1.4)
125
+ steep (1.9.3)
126
+ activesupport (>= 5.1)
127
+ concurrent-ruby (>= 1.1.10)
128
+ csv (>= 3.0.9)
129
+ fileutils (>= 1.1.0)
130
+ json (>= 2.1.0)
131
+ language_server-protocol (>= 3.15, < 4.0)
132
+ listen (~> 3.0)
133
+ logger (>= 1.3.0)
134
+ parser (>= 3.1)
135
+ rainbow (>= 2.2.2, < 4.0)
136
+ rbs (~> 3.8)
137
+ securerandom (>= 0.1)
138
+ strscan (>= 1.0.0)
139
+ terminal-table (>= 2, < 4)
140
+ uri (>= 0.12.0)
141
+ strscan (3.1.2)
142
+ terminal-table (3.0.2)
143
+ unicode-display_width (>= 1.1.1, < 3)
144
+ thor (1.3.2)
145
+ tzinfo (2.0.6)
146
+ concurrent-ruby (~> 1.0)
147
+ unicode-display_width (2.6.0)
148
+ uri (1.0.3)
94
149
 
95
150
  PLATFORMS
96
151
  ruby
97
152
 
98
153
  DEPENDENCIES
154
+ base64
99
155
  bundler (~> 2.0)
100
156
  codecov
101
157
  guard
@@ -103,9 +159,11 @@ DEPENDENCIES
103
159
  guard-rubocop
104
160
  irasutoya!
105
161
  rake (~> 13.0)
162
+ rbs
106
163
  rspec (~> 3.0)
107
164
  rubocop
108
165
  simplecov
166
+ steep
109
167
 
110
168
  BUNDLED WITH
111
- 2.0.2
169
+ 2.4.14
data/Guardfile CHANGED
@@ -17,7 +17,7 @@
17
17
  #
18
18
  # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
19
19
 
20
- # Note: The cmd option is now required due to the increasing number of ways
20
+ # NOTE: The cmd option is now required due to the increasing number of ways
21
21
  # rspec may be run, below are examples of the most common uses.
22
22
  # * bundler: 'bundle exec rspec'
23
23
  # * bundler binstubs: 'bin/rspec'
data/README.md CHANGED
@@ -1,12 +1,11 @@
1
1
  # Irasutoya
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/irasutoya.svg)](https://badge.fury.io/rb/irasutoya)
4
- [![Circle CI](https://circleci.com/gh/unhappychoice/irasutoya.svg?style=shield)](https://circleci.com/gh/unhappychoice/irasutoya)
5
- [![Code Climate](https://codeclimate.com/github/unhappychoice/irasutoya/badges/gpa.svg)](https://codeclimate.com/github/unhappychoice/irasutoya)
6
- [![codecov](https://codecov.io/gh/unhappychoice/irasutoya/branch/master/graph/badge.svg)](https://codecov.io/gh/unhappychoice/irasutoya)
7
- [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/unhappychoice/irasutoya.svg)](https://libraries.io/github/unhappychoice/irasutoya)
4
+ [![Code Climate](https://codeclimate.com/github/irasutoya-tools/irasutoya/badges/gpa.svg)](https://codeclimate.com/github/irasutoya-tools/irasutoya)
5
+ [![codecov](https://codecov.io/gh/irasutoya-tools/irasutoya/branch/master/graph/badge.svg)](https://codecov.io/gh/irasutoya-tools/irasutoya)
6
+ [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/irasutoya-tools/irasutoya.svg)](https://libraries.io/github/irasutoya-tools/irasutoya)
8
7
  ![](http://ruby-gem-downloads-badge.herokuapp.com/irasutoya?type=total)
9
- ![GitHub](https://img.shields.io/github/license/unhappychoice/irasutoya.svg)
8
+ ![GitHub](https://img.shields.io/github/license/irasutoya-tools/irasutoya.svg)
10
9
 
11
10
  <p align="center">
12
11
  <img src="https://1.bp.blogspot.com/-QU1PrEXerMg/XWS5ZxD-tsI/AAAAAAABUR4/1EuTP776BowewKdMAgnAUpUB5m3O7ve-ACLcBGAs/s1600/computer_screen_programming.png" width="400"/>
@@ -54,7 +53,7 @@ irasuto = irasuto_link.fetch_irasuto #=> returns Irasuto instance
54
53
 
55
54
  ## Contributing
56
55
 
57
- Bug reports and pull requests are welcome on GitHub at https://github.com/unhappychoice/irasutoya. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
56
+ Bug reports and pull requests are welcome on GitHub at https://github.com/irasutoya-tools/irasutoya. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
58
57
 
59
58
  ## License
60
59
 
@@ -62,4 +61,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
62
61
 
63
62
  ## Code of Conduct
64
63
 
65
- Everyone interacting in the Irasutoya project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/unhappychoice/irasutoya/blob/master/CODE_OF_CONDUCT.md).
64
+ Everyone interacting in the Irasutoya project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/irasutoya-tools/irasutoya/blob/master/CODE_OF_CONDUCT.md).
data/Steepfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ target :lib do
4
+ signature 'sig'
5
+ check 'lib'
6
+ end
data/irasutoya.gemspec CHANGED
@@ -7,7 +7,7 @@ require 'irasutoya/version'
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'irasutoya'
9
9
  spec.version = Irasutoya::VERSION
10
- spec.required_ruby_version = '>= 2.4'
10
+ spec.required_ruby_version = '>= 3.1'
11
11
  spec.authors = ['Yuji Ueki']
12
12
  spec.email = ['unhappychoice@gmail.com']
13
13
 
@@ -31,13 +31,16 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_dependency 'nokogiri'
33
33
 
34
+ spec.add_development_dependency 'base64'
34
35
  spec.add_development_dependency 'bundler', '~> 2.0'
35
36
  spec.add_development_dependency 'codecov'
36
37
  spec.add_development_dependency 'guard'
37
38
  spec.add_development_dependency 'guard-rspec'
38
39
  spec.add_development_dependency 'guard-rubocop'
39
40
  spec.add_development_dependency 'rake', '~> 13.0'
41
+ spec.add_development_dependency 'rbs'
40
42
  spec.add_development_dependency 'rspec', '~> 3.0'
41
43
  spec.add_development_dependency 'rubocop'
42
44
  spec.add_development_dependency 'simplecov'
45
+ spec.add_development_dependency 'steep'
43
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Irasutoya
4
- VERSION = '1.1.0'
4
+ VERSION = '2.0.1'
5
5
  end
@@ -0,0 +1,14 @@
1
+ module Irasutoya
2
+ class Category
3
+ include Modules::HasDocumentFetcher::Methods
4
+ include Modules::HasListPageParser::Methods
5
+ extend Modules::HasDocumentFetcher::Methods
6
+ extend Modules::HasListPageParser::Methods
7
+
8
+ attr_reader list_url: String
9
+ attr_reader title: String
10
+ def initialize: (title: String, list_url: String) -> void
11
+ def self.all: -> Array[Category]
12
+ def fetch_irasuto_links: -> Array[IrasutoLink]
13
+ end
14
+ end
@@ -0,0 +1,24 @@
1
+ module Irasutoya
2
+ class Irasuto
3
+ include Modules::HasDocumentFetcher::Methods
4
+ include Modules::HasListPageParser::Methods
5
+ include Modules::HasShowPageParser::Methods
6
+ extend Modules::HasDocumentFetcher::Methods
7
+ extend Modules::HasListPageParser::Methods
8
+ extend Modules::HasShowPageParser::Methods
9
+
10
+ attr_reader url: String
11
+ attr_reader title: String
12
+ attr_reader description: String
13
+ attr_reader image_urls: Array[String]
14
+ attr_reader postthumb_image_url: String?
15
+ attr_reader image_url: String?
16
+ attr_reader has_multiple_images: bool
17
+
18
+ def initialize: (url: String, title: String, description: String, image_urls: Array[String]) -> void
19
+ def self.random: -> Irasuto
20
+ def self.search: (query: String, ?page: Integer) -> Array[IrasutoLink]
21
+ def self.random_api_path: -> String
22
+ def self.random_url: -> String
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ module Irasutoya
2
+ class IrasutoLink
3
+ include Modules::HasDocumentFetcher::Methods
4
+ include Modules::HasShowPageParser::Methods
5
+ extend Modules::HasDocumentFetcher::Methods
6
+ extend Modules::HasShowPageParser::Methods
7
+
8
+ attr_reader title: String
9
+ attr_reader show_url: String
10
+ def initialize: (title: String, show_url: String) -> void
11
+ def fetch_irasuto: -> Irasuto
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ module Irasutoya
2
+ module Modules
3
+ module HasDocumentFetcher
4
+ def self.included: (Class) -> void
5
+
6
+ module Methods
7
+ def fetch_page_and_parse: (String) -> untyped
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ module Irasutoya
2
+ module Modules
3
+ module HasListPageParser
4
+ def self.included: (Class) -> void
5
+
6
+ module Methods
7
+ def parse_list_page: (document: untyped) -> Array[{ title: String, show_url: String }]
8
+ end
9
+
10
+ module PrivateMethods
11
+ def self.title_from: (box: untyped) -> String
12
+ def self.show_url_from: (box: untyped) -> String
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ module Irasutoya
2
+ module Modules
3
+ module HasShowPageParser
4
+ def self.included: (Class) -> void
5
+
6
+ module Methods
7
+ def parse_show_page: (document: untyped) -> { title: String, description: String, image_urls: Array[String] }
8
+ end
9
+
10
+ module PrivateMethods
11
+ def self.title_from: (document: untyped) -> String
12
+ def self.description_from: (document: untyped) -> String
13
+ def self.image_url_from: (document: untyped) -> String
14
+ def self.image_urls_from: (document: untyped) -> Array[String]
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ module Irasutoya
2
+ VERSION: String
3
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irasutoya
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Ueki
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2020-10-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: nokogiri
@@ -24,6 +23,20 @@ dependencies:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: base64
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
27
40
  - !ruby/object:Gem::Dependency
28
41
  name: bundler
29
42
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +121,20 @@ dependencies:
108
121
  - - "~>"
109
122
  - !ruby/object:Gem::Version
110
123
  version: '13.0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: rbs
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
111
138
  - !ruby/object:Gem::Dependency
112
139
  name: rspec
113
140
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +177,20 @@ dependencies:
150
177
  - - ">="
151
178
  - !ruby/object:Gem::Version
152
179
  version: '0'
180
+ - !ruby/object:Gem::Dependency
181
+ name: steep
182
+ requirement: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ type: :development
188
+ prerelease: false
189
+ version_requirements: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
153
194
  description: CLI and library for irastoya
154
195
  email:
155
196
  - unhappychoice@gmail.com
@@ -157,11 +198,14 @@ executables: []
157
198
  extensions: []
158
199
  extra_rdoc_files: []
159
200
  files:
160
- - ".circleci/config.yml"
201
+ - ".github/dependabot.yml"
202
+ - ".github/workflows/release.yaml"
161
203
  - ".github/workflows/test.yml"
204
+ - ".gitignore"
162
205
  - ".rspec"
163
206
  - ".rubocop.yml"
164
207
  - ".rubocop_todo.yml"
208
+ - ".ruby-version"
165
209
  - CODE_OF_CONDUCT.md
166
210
  - Gemfile
167
211
  - Gemfile.lock
@@ -169,6 +213,7 @@ files:
169
213
  - LICENSE.txt
170
214
  - README.md
171
215
  - Rakefile
216
+ - Steepfile
172
217
  - irasutoya.gemspec
173
218
  - lib/irasutoya.rb
174
219
  - lib/irasutoya/category.rb
@@ -179,6 +224,13 @@ files:
179
224
  - lib/irasutoya/modules/has_list_page_parser.rb
180
225
  - lib/irasutoya/modules/has_show_page_parser.rb
181
226
  - lib/irasutoya/version.rb
227
+ - sig/irasutoya/category.rbs
228
+ - sig/irasutoya/irasuto.rbs
229
+ - sig/irasutoya/irasuto_link.rbs
230
+ - sig/irasutoya/modules/has_document_fetcher.rbs
231
+ - sig/irasutoya/modules/has_list_page_parser.rbs
232
+ - sig/irasutoya/modules/has_show_page_parser.rbs
233
+ - sig/irasutoya/version.rbs
182
234
  homepage: https://github.com/unhappychoice/irasutoya
183
235
  licenses:
184
236
  - MIT
@@ -186,7 +238,6 @@ metadata:
186
238
  homepage_uri: https://github.com/unhappychoice/irasutoya
187
239
  source_code_uri: https://github.com/unhappychoice/irasutoya
188
240
  changelog_uri: https://github.com/unhappychoice/irasutoya
189
- post_install_message:
190
241
  rdoc_options: []
191
242
  require_paths:
192
243
  - lib
@@ -194,15 +245,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
245
  requirements:
195
246
  - - ">="
196
247
  - !ruby/object:Gem::Version
197
- version: '2.4'
248
+ version: '3.1'
198
249
  required_rubygems_version: !ruby/object:Gem::Requirement
199
250
  requirements:
200
251
  - - ">="
201
252
  - !ruby/object:Gem::Version
202
253
  version: '0'
203
254
  requirements: []
204
- rubygems_version: 3.0.3
205
- signing_key:
255
+ rubygems_version: 3.6.7
206
256
  specification_version: 4
207
257
  summary: CLI and library for irastoya
208
258
  test_files: []
data/.circleci/config.yml DELETED
@@ -1,61 +0,0 @@
1
- version: 2.1
2
-
3
- update_bundler: &update_bundler
4
- run:
5
- name: update bundler
6
- command: gem update bundler
7
-
8
- bundle_install: &bundle_install
9
- run:
10
- name: bundle install
11
- command: bundle update --bundler && bundle install --path vendor/bundle --jobs 4
12
-
13
- restore_bundle_cache: &restore_bundle_cache
14
- restore_cache:
15
- key: cache-bundler-{{ checksum "Gemfile.lock" }}
16
-
17
- jobs:
18
- build:
19
- docker:
20
- - image: circleci/ruby
21
- steps:
22
- - checkout
23
- - *restore_bundle_cache
24
- - *update_bundler
25
- - *bundle_install
26
- - save_cache:
27
- key: cache-bundler-{{ checksum "Gemfile.lock" }}
28
- paths:
29
- - vendor/bundle
30
- rubocop:
31
- docker:
32
- - image: circleci/ruby
33
- steps:
34
- - checkout
35
- - *restore_bundle_cache
36
- - *update_bundler
37
- - *bundle_install
38
- - run: bundle exec rubocop
39
- rspec:
40
- docker:
41
- - image: circleci/ruby
42
- steps:
43
- - checkout
44
- - *restore_bundle_cache
45
- - *update_bundler
46
- - *bundle_install
47
- - run:
48
- environment:
49
- RAILS_ENV: test
50
- COVERAGE: true
51
- CODECOV_TOKEN: 3786990f-aaba-4bc7-8a14-dcaac1d22749
52
- command: bundle exec rspec
53
- workflows:
54
- version: 2.1
55
- rspec:
56
- jobs:
57
- - build
58
- - rubocop:
59
- requires: [build]
60
- - rspec:
61
- requires: [build]