hatenablog_publisher 0.2.0 → 0.4.0
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 +4 -4
- data/.github/workflows/ci.yml +11 -11
- data/.github/workflows/tagpr.yml +13 -0
- data/.gitignore +2 -0
- data/.ruby-version +1 -0
- data/Gemfile +11 -13
- data/README.md +5 -0
- data/exe/hatenablog_publish +1 -0
- data/hatenablog_publisher.gemspec +0 -5
- data/lib/hatenablog_publisher/client.rb +0 -1
- data/lib/hatenablog_publisher/context.rb +1 -0
- data/lib/hatenablog_publisher/entry.rb +11 -0
- data/lib/hatenablog_publisher/io.rb +1 -1
- data/lib/hatenablog_publisher/version.rb +1 -1
- metadata +9 -78
- data/Gemfile.lock +0 -126
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1364daffa9e55a7992d825f9a5271d4e44c274f3842e80782528c7c08973a95
|
4
|
+
data.tar.gz: 473ad8b55534ac798bb4a21382163f9a4354bac1c7989d944d7f37d6ea388099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fca83e8caac019c4ba2e2c63051e75128a662d604337b9625802c6a4e1c3b7261a4a3d1e0ba787ad542fd6e96784fbd5e051575a159f6b92d39b5239eb5ed964
|
7
|
+
data.tar.gz: 198927a17848679627c2b40980fe35c51af934d1ea7af2e01b7a28c3143147808dda1c9dea4f434fb8c60f286ed5366420b94b13007064d32a15429bee4698cc
|
data/.github/workflows/ci.yml
CHANGED
@@ -7,12 +7,16 @@ jobs:
|
|
7
7
|
test:
|
8
8
|
runs-on: ubuntu-latest
|
9
9
|
name: 'test'
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
10
14
|
steps:
|
11
|
-
- uses: actions/checkout@
|
15
|
+
- uses: actions/checkout@v3.3.0
|
12
16
|
- uses: ruby/setup-ruby@v1
|
13
17
|
with:
|
14
|
-
ruby-version:
|
15
|
-
- uses: actions/cache@
|
18
|
+
ruby-version: ${{ matrix.ruby-version }}
|
19
|
+
- uses: actions/cache@v3.2.3
|
16
20
|
with:
|
17
21
|
path: vendor/bundle
|
18
22
|
key: ${{ runner.os }}-gems-${{ hashFiles('./Gemfile.lock') }}
|
@@ -37,10 +41,10 @@ jobs:
|
|
37
41
|
runs-on: ubuntu-latest
|
38
42
|
name: 'rubocop'
|
39
43
|
steps:
|
40
|
-
- uses: actions/checkout@
|
41
|
-
- uses: ruby/setup-ruby@v1
|
44
|
+
- uses: actions/checkout@v3.3.0
|
45
|
+
- uses: ruby/setup-ruby@v1.133.2
|
42
46
|
with:
|
43
|
-
ruby-version:
|
47
|
+
ruby-version: .ruby-version
|
44
48
|
- run: |
|
45
49
|
gem install rubocop
|
46
50
|
|
@@ -50,10 +54,6 @@ jobs:
|
|
50
54
|
run: |
|
51
55
|
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s
|
52
56
|
rubocop | ./bin/reviewdog -f=rubocop -reporter=github-pr-review
|
53
|
-
# - uses: reviewdog/action-rubocop@v1
|
54
|
-
# with:
|
55
|
-
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
56
|
-
# reporter: github-pr-check
|
57
57
|
|
58
58
|
slack-notify:
|
59
59
|
if: always()
|
@@ -61,7 +61,7 @@ jobs:
|
|
61
61
|
name: post slack
|
62
62
|
runs-on: ubuntu-latest
|
63
63
|
steps:
|
64
|
-
- uses: Gamesight/slack-workflow-status@
|
64
|
+
- uses: Gamesight/slack-workflow-status@v1.2.0
|
65
65
|
with:
|
66
66
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
67
67
|
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.2.0
|
data/Gemfile
CHANGED
@@ -3,16 +3,14 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in hatenablog_publisher.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
7
|
-
gem 'awesome_print'
|
8
|
-
gem '
|
9
|
-
gem '
|
10
|
-
gem '
|
11
|
-
gem '
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
gem '
|
16
|
-
|
17
|
-
gem 'xml-simple'
|
18
|
-
gem 'codecov', :require => false, :group => :test
|
6
|
+
group :development do
|
7
|
+
gem 'awesome_print'
|
8
|
+
gem 'bundler'
|
9
|
+
gem 'pry-byebug'
|
10
|
+
gem 'rake'
|
11
|
+
gem 'rspec'
|
12
|
+
end
|
13
|
+
|
14
|
+
group :test do
|
15
|
+
gem 'codecov', require: false
|
16
|
+
end
|
data/README.md
CHANGED
@@ -41,6 +41,7 @@ args = ARGV.getopts('',
|
|
41
41
|
'filename:',
|
42
42
|
'config:',
|
43
43
|
'data_file:',
|
44
|
+
'custom_path',
|
44
45
|
'trace').symbolize_keys
|
45
46
|
|
46
47
|
HatenablogPublisher.publish(args)
|
@@ -75,6 +76,10 @@ HatenablogPublisher.publish(args)
|
|
75
76
|
- for article management
|
76
77
|
- JSON format
|
77
78
|
|
79
|
+
- custom_path
|
80
|
+
- specify a path
|
81
|
+
- If `foo/bar` is specified, the URL of the article will be `entry/foo/bar`.
|
82
|
+
|
78
83
|
- trace
|
79
84
|
- Detailed Output
|
80
85
|
|
data/exe/hatenablog_publish
CHANGED
@@ -23,11 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.bindir = "exe"
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ["lib"]
|
26
|
-
spec.add_development_dependency 'bundler'
|
27
|
-
spec.add_development_dependency 'rake'
|
28
|
-
spec.add_development_dependency 'rspec'
|
29
|
-
spec.add_development_dependency 'awesome_print'
|
30
|
-
spec.add_development_dependency 'pry-byebug'
|
31
26
|
spec.add_dependency 'activesupport'
|
32
27
|
spec.add_dependency 'front_matter_parser'
|
33
28
|
spec.add_dependency 'oauth'
|
@@ -39,11 +39,21 @@ module HatenablogPublisher
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def categories
|
42
|
+
return unless @context.categories
|
43
|
+
|
42
44
|
@context.categories.map do |c|
|
43
45
|
'<category term="' + c + '" />'
|
44
46
|
end.join
|
45
47
|
end
|
46
48
|
|
49
|
+
def custom_path
|
50
|
+
return unless @options.custom_path
|
51
|
+
|
52
|
+
<<~"XML"
|
53
|
+
<hatenablog:custom-url xmlns:hatenablog="http://www.hatena.ne.jp/info/xmlns#hatenablog">#{@options.custom_path}</hatenablog:custom-url>
|
54
|
+
XML
|
55
|
+
end
|
56
|
+
|
47
57
|
def format_request(body)
|
48
58
|
draft = @options.draft ? 'yes' : 'no'
|
49
59
|
body = <<~"XML"
|
@@ -60,6 +70,7 @@ module HatenablogPublisher
|
|
60
70
|
<app:control>
|
61
71
|
<app:draft>#{draft}</app:draft>
|
62
72
|
</app:control>
|
73
|
+
#{custom_path}
|
63
74
|
</entry>
|
64
75
|
XML
|
65
76
|
body
|
metadata
CHANGED
@@ -1,85 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hatenablog_publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- swfz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
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
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: awesome_print
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pry-byebug
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
13
|
- !ruby/object:Gem::Dependency
|
84
14
|
name: activesupport
|
85
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +108,7 @@ dependencies:
|
|
178
108
|
- - ">="
|
179
109
|
- !ruby/object:Gem::Version
|
180
110
|
version: '0'
|
181
|
-
description:
|
111
|
+
description:
|
182
112
|
email:
|
183
113
|
- sawafuji.09@gmail.com
|
184
114
|
executables:
|
@@ -188,13 +118,14 @@ extra_rdoc_files: []
|
|
188
118
|
files:
|
189
119
|
- ".github/dependabot.yml"
|
190
120
|
- ".github/workflows/ci.yml"
|
121
|
+
- ".github/workflows/tagpr.yml"
|
191
122
|
- ".gitignore"
|
192
123
|
- ".rspec"
|
193
124
|
- ".rubocop.yml"
|
125
|
+
- ".ruby-version"
|
194
126
|
- ".travis.yml"
|
195
127
|
- CODE_OF_CONDUCT.md
|
196
128
|
- Gemfile
|
197
|
-
- Gemfile.lock
|
198
129
|
- LICENSE.txt
|
199
130
|
- README.md
|
200
131
|
- Rakefile
|
@@ -223,7 +154,7 @@ metadata:
|
|
223
154
|
homepage_uri: https://github.com/swfz/hatenablog_publisher
|
224
155
|
source_code_uri: https://github.com/swfz/hatenablog_publisher
|
225
156
|
changelog_uri: https://github.com/swfz/hatenablog_publisher
|
226
|
-
post_install_message:
|
157
|
+
post_install_message:
|
227
158
|
rdoc_options: []
|
228
159
|
require_paths:
|
229
160
|
- lib
|
@@ -238,8 +169,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
169
|
- !ruby/object:Gem::Version
|
239
170
|
version: '0'
|
240
171
|
requirements: []
|
241
|
-
rubygems_version: 3.
|
242
|
-
signing_key:
|
172
|
+
rubygems_version: 3.4.1
|
173
|
+
signing_key:
|
243
174
|
specification_version: 4
|
244
175
|
summary: Gem that posts to the Hatena Blog API and PhotoLife API
|
245
176
|
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,126 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
hatenablog_publisher (0.2.0)
|
5
|
-
activesupport
|
6
|
-
front_matter_parser
|
7
|
-
mime-types
|
8
|
-
oauth
|
9
|
-
oga
|
10
|
-
sanitize
|
11
|
-
xml-simple
|
12
|
-
|
13
|
-
GEM
|
14
|
-
remote: https://rubygems.org/
|
15
|
-
specs:
|
16
|
-
activesupport (6.0.3.1)
|
17
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
-
i18n (>= 0.7, < 2)
|
19
|
-
minitest (~> 5.1)
|
20
|
-
tzinfo (~> 1.1)
|
21
|
-
zeitwerk (~> 2.2, >= 2.2.2)
|
22
|
-
ansi (1.5.0)
|
23
|
-
ast (2.4.0)
|
24
|
-
awesome_print (1.8.0)
|
25
|
-
byebug (11.1.3)
|
26
|
-
codecov (0.2.11)
|
27
|
-
json
|
28
|
-
simplecov
|
29
|
-
coderay (1.1.2)
|
30
|
-
concurrent-ruby (1.1.6)
|
31
|
-
crass (1.0.6)
|
32
|
-
diff-lcs (1.3)
|
33
|
-
docile (1.3.2)
|
34
|
-
front_matter_parser (0.2.1)
|
35
|
-
i18n (1.8.2)
|
36
|
-
concurrent-ruby (~> 1.0)
|
37
|
-
jaro_winkler (1.5.4)
|
38
|
-
json (2.3.1)
|
39
|
-
method_source (1.0.0)
|
40
|
-
mime-types (3.3.1)
|
41
|
-
mime-types-data (~> 3.2015)
|
42
|
-
mime-types-data (3.2020.0425)
|
43
|
-
mini_portile2 (2.4.0)
|
44
|
-
minitest (5.14.1)
|
45
|
-
nokogiri (1.10.9)
|
46
|
-
mini_portile2 (~> 2.4.0)
|
47
|
-
nokogumbo (2.0.2)
|
48
|
-
nokogiri (~> 1.8, >= 1.8.4)
|
49
|
-
oauth (0.5.4)
|
50
|
-
oga (3.2)
|
51
|
-
ast
|
52
|
-
ruby-ll (~> 2.1)
|
53
|
-
parallel (1.19.1)
|
54
|
-
parser (2.7.1.2)
|
55
|
-
ast (~> 2.4.0)
|
56
|
-
pry (0.13.1)
|
57
|
-
coderay (~> 1.1)
|
58
|
-
method_source (~> 1.0)
|
59
|
-
pry-byebug (3.9.0)
|
60
|
-
byebug (~> 11.0)
|
61
|
-
pry (~> 0.13.0)
|
62
|
-
rainbow (3.0.0)
|
63
|
-
rake (13.0.1)
|
64
|
-
rexml (3.2.4)
|
65
|
-
rspec (3.9.0)
|
66
|
-
rspec-core (~> 3.9.0)
|
67
|
-
rspec-expectations (~> 3.9.0)
|
68
|
-
rspec-mocks (~> 3.9.0)
|
69
|
-
rspec-core (3.9.2)
|
70
|
-
rspec-support (~> 3.9.3)
|
71
|
-
rspec-expectations (3.9.1)
|
72
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
-
rspec-support (~> 3.9.0)
|
74
|
-
rspec-mocks (3.9.1)
|
75
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
76
|
-
rspec-support (~> 3.9.0)
|
77
|
-
rspec-support (3.9.3)
|
78
|
-
rubocop (0.82.0)
|
79
|
-
jaro_winkler (~> 1.5.1)
|
80
|
-
parallel (~> 1.10)
|
81
|
-
parser (>= 2.7.0.1)
|
82
|
-
rainbow (>= 2.2.2, < 4.0)
|
83
|
-
rexml
|
84
|
-
ruby-progressbar (~> 1.7)
|
85
|
-
unicode-display_width (>= 1.4.0, < 2.0)
|
86
|
-
ruby-ll (2.1.2)
|
87
|
-
ansi
|
88
|
-
ast
|
89
|
-
ruby-progressbar (1.10.1)
|
90
|
-
sanitize (5.2.1)
|
91
|
-
crass (~> 1.0.2)
|
92
|
-
nokogiri (>= 1.8.0)
|
93
|
-
nokogumbo (~> 2.0)
|
94
|
-
simplecov (0.19.0)
|
95
|
-
docile (~> 1.1)
|
96
|
-
simplecov-html (~> 0.11)
|
97
|
-
simplecov-html (0.12.3)
|
98
|
-
thread_safe (0.3.6)
|
99
|
-
tzinfo (1.2.7)
|
100
|
-
thread_safe (~> 0.1)
|
101
|
-
unicode-display_width (1.7.0)
|
102
|
-
xml-simple (1.1.5)
|
103
|
-
zeitwerk (2.3.0)
|
104
|
-
|
105
|
-
PLATFORMS
|
106
|
-
ruby
|
107
|
-
|
108
|
-
DEPENDENCIES
|
109
|
-
activesupport
|
110
|
-
awesome_print
|
111
|
-
bundler
|
112
|
-
codecov
|
113
|
-
front_matter_parser
|
114
|
-
hatenablog_publisher!
|
115
|
-
mime-types
|
116
|
-
oauth
|
117
|
-
oga
|
118
|
-
pry-byebug
|
119
|
-
rake (~> 13.0)
|
120
|
-
rspec (~> 3.0)
|
121
|
-
rubocop
|
122
|
-
sanitize
|
123
|
-
xml-simple
|
124
|
-
|
125
|
-
BUNDLED WITH
|
126
|
-
2.1.4
|