hatenablog 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/build.yml +31 -0
- data/.gitignore +3 -3
- data/README.md +1 -1
- data/lib/hatenablog/category.rb +4 -2
- data/lib/hatenablog/client.rb +4 -2
- data/lib/hatenablog/entry.rb +6 -2
- data/lib/hatenablog/version.rb +1 -1
- metadata +4 -5
- data/.travis.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8b23d91da870185150a492dc63bc736664a9a267d1d8ce0b7e6be9646bc74222
|
4
|
+
data.tar.gz: 85f6cfe7fb4745e3ec4cefd1de86f9fdd70d49af692953af38f5b2767ec96916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 657a83356b31866fbc825914971b7bd30be38569fea2892b8fe901d1e2bd96791bc50bc5e5f70059481e3920d65122979505a473afccb1d9feb396d28bfbe613
|
7
|
+
data.tar.gz: bee6720833ff60c3298b1aa06e451eb7011e55c72a6b55485012f0ab2c8a554b61c2ecbc0d72719777be0648a2a1c0af5c42f42414a4eebe980c1254250de0f4
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: build
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: ['2.4.x', '2.5.x', '2.6.x']
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v1
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: actions/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
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
|
22
|
+
env:
|
23
|
+
TZ: Asia/Tokyo
|
24
|
+
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/.gitignore
CHANGED
@@ -28,9 +28,9 @@ build/
|
|
28
28
|
|
29
29
|
# for a library or gem, you might want to ignore these files since the code is
|
30
30
|
# intended to run in multiple environments; otherwise, check them in:
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
Gemfile.lock
|
32
|
+
.ruby-version
|
33
|
+
.ruby-gemset
|
34
34
|
|
35
35
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
36
36
|
.rvmrc
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Hatenablog
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/hatenablog.svg)](https://badge.fury.io/rb/hatenablog) [![Build Status](https://
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/hatenablog.svg)](https://badge.fury.io/rb/hatenablog) [![Build Status](https://github.com/kymmt90/hatenablog/workflows/build/badge.svg)](https://github.com/kymmt90/hatenablog/actions?workflow=build)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/kymmt90/hatenablog/badges/gpa.svg)](https://codeclimate.com/github/kymmt90/hatenablog)
|
5
5
|
[![Test Coverage](https://codeclimate.com/github/kymmt90/hatenablog/badges/coverage.svg)](https://codeclimate.com/github/kymmt90/hatenablog/coverage)
|
6
6
|
|
data/lib/hatenablog/category.rb
CHANGED
data/lib/hatenablog/client.rb
CHANGED
@@ -212,10 +212,12 @@ module Hatenablog
|
|
212
212
|
@page = page
|
213
213
|
end
|
214
214
|
|
215
|
-
def each
|
215
|
+
def each(&block)
|
216
|
+
return enum_for(__method__) unless block_given?
|
217
|
+
|
216
218
|
current_page = 0
|
217
219
|
until (@page && current_page > @page) || !(feed = @client.next_feed(feed))
|
218
|
-
feed.entries.each { |entry|
|
220
|
+
feed.entries.each { |entry| block.call(entry) }
|
219
221
|
current_page += 1
|
220
222
|
end
|
221
223
|
end
|
data/lib/hatenablog/entry.rb
CHANGED
@@ -19,6 +19,7 @@ module Hatenablog
|
|
19
19
|
define_method(method) do |*args, &block|
|
20
20
|
result = send(origin_method, *args, &block)
|
21
21
|
send(hook)
|
22
|
+
result
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
@@ -27,8 +28,9 @@ module Hatenablog
|
|
27
28
|
class Entry
|
28
29
|
extend AfterHook
|
29
30
|
|
30
|
-
attr_accessor :uri, :author_name, :title, :content, :draft
|
31
|
+
attr_accessor :uri, :author_name, :title, :content, :draft
|
31
32
|
attr_reader :edit_uri, :id, :updated
|
33
|
+
attr_writer :categories
|
32
34
|
|
33
35
|
def updated=(date)
|
34
36
|
@updated = Time.parse(date)
|
@@ -130,8 +132,10 @@ module Hatenablog
|
|
130
132
|
@content = @document.at_css('content').content
|
131
133
|
@draft = @document.at_css('entry app|control app|draft').content
|
132
134
|
@categories = parse_categories
|
133
|
-
|
135
|
+
if @document.at_css('entry updated')
|
134
136
|
@updated = Time.parse(@document.at_css('entry updated').content)
|
137
|
+
else
|
138
|
+
@updated = nil
|
135
139
|
end
|
136
140
|
end
|
137
141
|
|
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.6.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: 2019-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -130,8 +130,8 @@ executables:
|
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
|
+
- ".github/workflows/build.yml"
|
133
134
|
- ".gitignore"
|
134
|
-
- ".travis.yml"
|
135
135
|
- Gemfile
|
136
136
|
- LICENSE.txt
|
137
137
|
- README.md
|
@@ -167,8 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
|
171
|
-
rubygems_version: 2.6.11
|
170
|
+
rubygems_version: 3.0.3
|
172
171
|
signing_key:
|
173
172
|
specification_version: 4
|
174
173
|
summary: Hatenablog AtomPub API library
|
data/.travis.yml
DELETED