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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b23d91da870185150a492dc63bc736664a9a267d1d8ce0b7e6be9646bc74222
4
- data.tar.gz: 85f6cfe7fb4745e3ec4cefd1de86f9fdd70d49af692953af38f5b2767ec96916
3
+ metadata.gz: 2f5ba2be4110aba1299f43e9392477651511fc8f25b833fa0cbbadf19ead23b9
4
+ data.tar.gz: afbde859959d37d364e249e22b4a02206db70bd274040fb62068227f74e9447e
5
5
  SHA512:
6
- metadata.gz: 657a83356b31866fbc825914971b7bd30be38569fea2892b8fe901d1e2bd96791bc50bc5e5f70059481e3920d65122979505a473afccb1d9feb396d28bfbe613
7
- data.tar.gz: bee6720833ff60c3298b1aa06e451eb7011e55c72a6b55485012f0ab2c8a554b61c2ecbc0d72719777be0648a2a1c0af5c42f42414a4eebe980c1254250de0f4
6
+ metadata.gz: 3578cefbfeddc8cd8d7ebd143fc581daea4e76a8299acb2d1de0004b18ead98969f7245cd9569c216664163e0940ae54a85f0a3a73d9edeb83be8e054b5ca4d9
7
+ data.tar.gz: 34c100e0157ae121c65baf6c71cbd13b50fbcad17a6fe3e330bb4413f290632568a287c33562b72a1dc7c49eb924f93b29415f8e67544684722a1cd2bc506174
@@ -1,31 +1,32 @@
1
1
  name: build
2
2
 
3
- on: [push]
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.x', '2.5.x', '2.6.x']
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@v1
13
- - name: Set up Ruby
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
- - name: Install Bundler
18
- run: gem install bundler
19
- - name: Install dependencies
20
- run: bundle install -j4
21
- - name: Run test
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
@@ -1,8 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  group :test do
4
- gem 'simplecov'
5
- gem 'codeclimate-test-reporter', '~> 1.0.0'
4
+ gem 'simplecov', '~> 0.17.1'
6
5
  end
7
6
 
8
7
  # Specify your gem's dependencies in hatenablog.gemspec
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 #=> 'Example Title'
196
- entry.content #=> 'This is the **example** entry.'
197
- entry.draft #=> 'yes'
198
- entry.draft? #=> true
199
- entry.categories #=> ['Ruby', 'Rails']
200
- entry.updated # Updated datetime
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,
@@ -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')
@@ -1,3 +1,3 @@
1
1
  module Hatenablog
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
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.6.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: 2019-12-20 00:00:00.000000000 Z
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.0.3
170
+ rubygems_version: 3.1.2
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Hatenablog AtomPub API library