hatenablog 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +18 -17
- data/Gemfile +1 -2
- data/README.md +7 -6
- data/lib/hatenablog/entry.rb +7 -0
- data/lib/hatenablog/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5ba2be4110aba1299f43e9392477651511fc8f25b833fa0cbbadf19ead23b9
|
4
|
+
data.tar.gz: afbde859959d37d364e249e22b4a02206db70bd274040fb62068227f74e9447e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3578cefbfeddc8cd8d7ebd143fc581daea4e76a8299acb2d1de0004b18ead98969f7245cd9569c216664163e0940ae54a85f0a3a73d9edeb83be8e054b5ca4d9
|
7
|
+
data.tar.gz: 34c100e0157ae121c65baf6c71cbd13b50fbcad17a6fe3e330bb4413f290632568a287c33562b72a1dc7c49eb924f93b29415f8e67544684722a1cd2bc506174
|
data/.github/workflows/build.yml
CHANGED
@@ -1,31 +1,32 @@
|
|
1
1
|
name: build
|
2
2
|
|
3
|
-
on: [
|
3
|
+
on: [pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
6
|
build:
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
ruby: ['2.4
|
10
|
+
ruby: ['2.4', '2.5', '2.6', '2.7']
|
11
|
+
include:
|
12
|
+
- ruby: '2.7'
|
13
|
+
report-coverage: true
|
11
14
|
steps:
|
12
|
-
- uses: actions/checkout@
|
13
|
-
-
|
14
|
-
uses: actions/setup-ruby@v1
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- uses: ruby/setup-ruby@v1
|
15
17
|
with:
|
16
18
|
ruby-version: ${{ matrix.ruby }}
|
17
|
-
-
|
18
|
-
|
19
|
-
- name:
|
20
|
-
|
21
|
-
|
19
|
+
- run: gem install bundler
|
20
|
+
- run: bundle install -j4
|
21
|
+
- name: Run tests and report test coverage
|
22
|
+
if: matrix.report-coverage
|
23
|
+
uses: paambaati/codeclimate-action@v2.4.0
|
24
|
+
env:
|
25
|
+
CC_TEST_REPORTER_ID: 309cf0784d00d2a6009566d28be111a8a0280cdeb2da280225eedf577b16beb5
|
26
|
+
with:
|
27
|
+
coverageCommand: bundle exec rake
|
28
|
+
- name: Run tests
|
29
|
+
if: "!matrix.report-coverage"
|
22
30
|
env:
|
23
31
|
TZ: Asia/Tokyo
|
24
32
|
run: bundle exec rake
|
25
|
-
- name: Report test coverage
|
26
|
-
env:
|
27
|
-
CC_TEST_REPORTER_ID: 309cf0784d00d2a6009566d28be111a8a0280cdeb2da280225eedf577b16beb5
|
28
|
-
run: |
|
29
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
30
|
-
chmod +x ./cc-test-reporter
|
31
|
-
./cc-test-reporter after-build
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -192,12 +192,13 @@ entry.id
|
|
192
192
|
entry.uri
|
193
193
|
entry.edit_uri
|
194
194
|
entry.author_name
|
195
|
-
entry.title
|
196
|
-
entry.content
|
197
|
-
entry.
|
198
|
-
entry.draft
|
199
|
-
entry.
|
200
|
-
entry.
|
195
|
+
entry.title #=> 'Example Title'
|
196
|
+
entry.content #=> 'This is the **example** entry.'
|
197
|
+
entry.formatted_content #=> '<p>This is the <strong>example</strong> entry.</p>'
|
198
|
+
entry.draft #=> 'yes'
|
199
|
+
entry.draft? #=> true
|
200
|
+
entry.categories #=> ['Ruby', 'Rails']
|
201
|
+
entry.updated # Updated datetime
|
201
202
|
|
202
203
|
client.update_entry(
|
203
204
|
entry.id,
|
data/lib/hatenablog/entry.rb
CHANGED
@@ -89,6 +89,11 @@ module Hatenablog
|
|
89
89
|
@document.to_s.gsub(/\"/, "'")
|
90
90
|
end
|
91
91
|
|
92
|
+
# @return [String]
|
93
|
+
def formatted_content
|
94
|
+
@formatted_content
|
95
|
+
end
|
96
|
+
|
92
97
|
def self.build_xml(uri, edit_uri, author_name, title, content, draft, categories, updated)
|
93
98
|
builder = Nokogiri::XML::Builder.new(encoding: 'utf-8') do |xml|
|
94
99
|
xml.entry('xmlns' => 'http://www.w3.org/2005/Atom',
|
@@ -130,6 +135,8 @@ module Hatenablog
|
|
130
135
|
@author_name = @document.at_css('author name').content
|
131
136
|
@title = @document.at_css('title').content
|
132
137
|
@content = @document.at_css('content').content
|
138
|
+
@formatted_content = @document.xpath('//hatena:formatted-content', hatena: 'http://www.hatena.ne.jp/info/xmlns#')[0]
|
139
|
+
@formatted_content = @formatted_content.content if @formatted_content
|
133
140
|
@draft = @document.at_css('entry app|control app|draft').content
|
134
141
|
@categories = parse_categories
|
135
142
|
if @document.at_css('entry updated')
|
data/lib/hatenablog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hatenablog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Yamamoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
170
|
+
rubygems_version: 3.1.2
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Hatenablog AtomPub API library
|