hatenablog_publisher 0.1.4 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37e2c8792b5bbe76b4ccce199f38f5735124d99b233154b9391bc77766cfe811
4
- data.tar.gz: 831043703117de5534eec3336ca5b27e3d17974a472e74a164b99bbd1a157ed9
3
+ metadata.gz: ae5520e6363ca01a3e404687252372c0d3e3cca100ddbc3fcd6adc1ea940a70a
4
+ data.tar.gz: b4489a0d2245d0efb130a589d6f1eefe2430af44469fe0b6112987b357e1c31f
5
5
  SHA512:
6
- metadata.gz: 7d3544c7ddf6cdce4c4a1ab583ea2b2c43afe6087b48ef45b19ba6b2125d5c5ae6d98eee578a82deaae96175e3eea639dffa8d6bd3864a924d629e2d3f53c3b9
7
- data.tar.gz: de39405d441bf011c4137ae82abdb0217eaebfea46e2f32856664eafc349be2db8288b61cb6a6c23935bfdbb94a21b4dde9e9745cc9dca801de6fb4251993676
6
+ metadata.gz: e6fdb7227d35882af116414d1a858bcb5821e16bdaa96feb98db03c994e88db51af52e6b9302b97a067340a60d43b0707e1c72c33a6f7631dd5887c5c7a5455a
7
+ data.tar.gz: 5e071ae5bf18dba02a26840a0b822f804237005178e510a7a4843e2001a6612a03e94d644923a687945388c552dcacd1003143a1aaaec300453a49d3e4f2c06b
@@ -0,0 +1,9 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "daily"
7
+ labels:
8
+ - dependabot
9
+ open-pull-requests-limit: 10
@@ -12,7 +12,7 @@ jobs:
12
12
  - uses: ruby/setup-ruby@v1
13
13
  with:
14
14
  ruby-version: 2.6
15
- - uses: actions/cache@v1
15
+ - uses: actions/cache@v2.1.3
16
16
  with:
17
17
  path: vendor/bundle
18
18
  key: ${{ runner.os }}-gems-${{ hashFiles('./Gemfile.lock') }}
@@ -28,6 +28,8 @@ jobs:
28
28
  HATENABLOG_CONSUMER_SECRET: dummy
29
29
  HATENABLOG_ACCESS_TOKEN_SECRET: dummy
30
30
  HATENABLOG_ACCESS_TOKEN: dummy
31
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
32
+ CI: true
31
33
  run: |
32
34
  bundle exec rspec
33
35
 
@@ -52,3 +54,14 @@ jobs:
52
54
  # with:
53
55
  # github_token: ${{ secrets.GITHUB_TOKEN }}
54
56
  # reporter: github-pr-check
57
+
58
+ slack-notify:
59
+ if: always()
60
+ needs: [test, rubocop]
61
+ name: post slack
62
+ runs-on: ubuntu-latest
63
+ steps:
64
+ - uses: Gamesight/slack-workflow-status@master
65
+ with:
66
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
67
+ slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
data/Gemfile CHANGED
@@ -15,3 +15,4 @@ gem 'rspec', '~> 3.0'
15
15
  gem 'rubocop'
16
16
  gem 'sanitize'
17
17
  gem 'xml-simple'
18
+ gem 'codecov', :require => false, :group => :test
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hatenablog_publisher (0.1.2)
4
+ hatenablog_publisher (0.2.0)
5
5
  activesupport
6
6
  front_matter_parser
7
7
  mime-types
@@ -23,14 +23,19 @@ GEM
23
23
  ast (2.4.0)
24
24
  awesome_print (1.8.0)
25
25
  byebug (11.1.3)
26
+ codecov (0.2.11)
27
+ json
28
+ simplecov
26
29
  coderay (1.1.2)
27
30
  concurrent-ruby (1.1.6)
28
31
  crass (1.0.6)
29
32
  diff-lcs (1.3)
33
+ docile (1.3.2)
30
34
  front_matter_parser (0.2.1)
31
35
  i18n (1.8.2)
32
36
  concurrent-ruby (~> 1.0)
33
37
  jaro_winkler (1.5.4)
38
+ json (2.3.1)
34
39
  method_source (1.0.0)
35
40
  mime-types (3.3.1)
36
41
  mime-types-data (~> 3.2015)
@@ -82,10 +87,14 @@ GEM
82
87
  ansi
83
88
  ast
84
89
  ruby-progressbar (1.10.1)
85
- sanitize (5.1.0)
90
+ sanitize (5.2.1)
86
91
  crass (~> 1.0.2)
87
92
  nokogiri (>= 1.8.0)
88
93
  nokogumbo (~> 2.0)
94
+ simplecov (0.19.0)
95
+ docile (~> 1.1)
96
+ simplecov-html (~> 0.11)
97
+ simplecov-html (0.12.3)
89
98
  thread_safe (0.3.6)
90
99
  tzinfo (1.2.7)
91
100
  thread_safe (~> 0.1)
@@ -100,6 +109,7 @@ DEPENDENCIES
100
109
  activesupport
101
110
  awesome_print
102
111
  bundler
112
+ codecov
103
113
  front_matter_parser
104
114
  hatenablog_publisher!
105
115
  mime-types
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # HatenablogPublisher
2
2
 
3
+ ![ci](https://github.com/swfz/hatenablog_publisher/workflows/ci/badge.svg)
4
+
5
+ [![codecov](https://codecov.io/gh/swfz/hatenablog_publisher/branch/master/graph/badge.svg)](https://codecov.io/gh/swfz/hatenablog_publisher)
6
+
3
7
  Module to manage local markdown and images using Hatena Blog API and PhotoLife API.
4
8
 
5
9
  ## Installation
@@ -19,7 +19,8 @@ module HatenablogPublisher
19
19
  end
20
20
 
21
21
  def add_image_context(image, tag)
22
- syntax = "[#{image['syntax'].first}]"
22
+ # APIのレスポンスをそのまま使用すると記事上でフォトライフへのリンクになってしまうため、管理画面から画像投稿した結果と合わせた(image -> plain)
23
+ syntax = "[#{image['syntax'].first}]".gsub(/:image\]/,':plain]')
23
24
 
24
25
  @hatena ||= {}
25
26
  @hatena[:image] ||= {}
@@ -13,11 +13,15 @@ module HatenablogPublisher
13
13
  def generate
14
14
  markdown = @context.text.dup
15
15
 
16
- replaced_markdown = replace_image(markdown)
16
+ replaced_markdown = remove_textlint_comment(replace_image(markdown))
17
17
 
18
18
  CGI.escapeHTML(replaced_markdown)
19
19
  end
20
20
 
21
+ def remove_textlint_comment(markdown)
22
+ markdown.gsub(/^<!--\s+textlint-(enable|disable).*-->\n/, '')
23
+ end
24
+
21
25
  def replace_image(markdown)
22
26
  markdown.gsub(IMAGE_PATTERN) do |s|
23
27
  image_name = Regexp.last_match(1)
@@ -1,3 +1,3 @@
1
1
  module HatenablogPublisher
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "extends": [
3
3
  "config:base"
4
- ]
4
+ ],
5
+ "minor": {
6
+ "groupName": "all dependencies"
7
+ }
5
8
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hatenablog_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - swfz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-03 00:00:00.000000000 Z
11
+ date: 2020-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -186,6 +186,7 @@ executables:
186
186
  extensions: []
187
187
  extra_rdoc_files: []
188
188
  files:
189
+ - ".github/dependabot.yml"
189
190
  - ".github/workflows/ci.yml"
190
191
  - ".gitignore"
191
192
  - ".rspec"