html-pipeline-mrkdwn 0.1.5 → 0.1.7

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: 24d6c10bc08b82e72a2a1d47aa069c7a3d1d4a923d446a9f1793433b346d2e4d
4
- data.tar.gz: db99716f93d2b48fff95b782c8eef9b4485ef33a72d0b53305dd24c7f93f1863
3
+ metadata.gz: 8092f7a5b7d9db66b5f96159588d223efa8ca46b3ab93c2fbf5dc8a0787c4f1d
4
+ data.tar.gz: c09ec4a6dcd19b0ad7703d2893f69b09de8fe561b2d6faaccf6fefbc53074208
5
5
  SHA512:
6
- metadata.gz: c51c9141772ac9b1c76e67b56d8bbb4d79bfddcc43b2daff3b6657c195e3621093bb8df19632cf792705449040b06b1d540725253ec7e47873a23a9024441e42
7
- data.tar.gz: cb6bd0b954492199966c648b7053a7d58db2dca59047c09881f84a4fe39e460e40f070e930676ec6fd860741621ae5612315ba7dfdc5e99f1143aebf58a69d67
6
+ metadata.gz: de6ff152605c2e2fd70007bdd54a8eda41d44695d071f7760cff3c4ea27dd226fb87c4f183f83d23697709e545f54e30682dd2e721282170c60adb699270e5af
7
+ data.tar.gz: d8956ee86a4b0bd220a12140bd35e2da8530d9f604e03408c3ccdbaefe00b3b403547800efe3555520ce5cf2aae57c2c6a1c3b18ed8dbbbeed0fa68825c2f062
data/.rubocop.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.7
3
+ NewCops: enable
4
+ SuggestExtensions: false
3
5
 
4
6
  Style/EmptyElse:
5
7
  EnforcedStyle: empty
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.7] - 2023-01-19
4
+
5
+ - Fix superclass in version.rb
6
+
7
+ ## [0.1.6] - 2023-01-19
8
+
9
+ - Add test_helper.rb
10
+ - Move all dev deps from Gemfile to gemspec
11
+ - Switch test filename convention to test_*
12
+
13
+ ## [0.1.5] - 2023-01-17
14
+
15
+ - Add *.gem to .gitignore
16
+ - Switch from RSpec to Minitest
17
+
3
18
  ## [0.1.4] - 2022-12-28
4
19
 
5
20
  - Move pipeline.rb into /helpers
data/Gemfile CHANGED
@@ -4,7 +4,3 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in html-pipeline-mrkdwn.gemspec
6
6
  gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rubocop", "~> 1.21"
data/Rakefile CHANGED
@@ -1,18 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
+ require "rake/testtask"
4
5
 
5
- require "rubocop/rake_task"
6
-
7
- RuboCop::RakeTask.new
8
-
9
- require "minitest/test_task"
10
-
11
- Minitest::TestTask.create(:test) do |t|
6
+ Rake::TestTask.new(:test) do |t|
12
7
  t.libs << "test"
13
8
  t.libs << "lib"
14
- t.warning = false
15
- t.test_globs = ["test/**/*_test.rb"]
9
+ t.test_files = FileList["test/**/test_*.rb"]
16
10
  end
17
11
 
18
- task default: :test
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
@@ -1,12 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "html/pipeline"
4
3
  require "gemoji"
5
4
 
6
5
  module HTML
7
6
  class Pipeline
8
7
  # HTML Filter for converting Slack's `mrkdwn` markup language.
9
- #https://api.slack.com/reference/surfaces/formatting#basics
8
+ # https://api.slack.com/reference/surfaces/formatting#basics
10
9
  #
11
10
  # Context options:
12
11
  # :emoji_image_tag - a Proc that returns an `img` tag for custom Emoji
@@ -124,7 +123,7 @@ module HTML
124
123
  content.gsub CODE_PATTERN do |match|
125
124
  text = Regexp.last_match[1]
126
125
 
127
- if text&.match(/\A[`]+\Z/) # ignore runs of backquotes
126
+ if text&.match(/\A`+\Z/) # ignore runs of backquotes
128
127
  match
129
128
  else
130
129
  "<code>#{text}</code>"
@@ -148,10 +147,10 @@ module HTML
148
147
  (text, klass, prefix) =
149
148
  case mention
150
149
  when /\A#(C.+)\Z/ # slack channels
151
- [context.dig(:slack_channels, Regexp.last_match[1]) || Regexp.last_match[1], "channel", "#"]
150
+ [@slack_channels.dig(Regexp.last_match[1]) || Regexp.last_match[1], "channel", "#"]
152
151
 
153
152
  when /\A@([UB].+)\Z/ # slack users or bots
154
- [context.dig(:slack_users, Regexp.last_match[1]) || Regexp.last_match[1], "user", "@"]
153
+ [@slack_users.dig(Regexp.last_match[1]) || Regexp.last_match[1], "user", "@"]
155
154
 
156
155
  when /\A!(here|channel|everyone)\Z/ # special mentions
157
156
  [Regexp.last_match[1], "mention", "@"]
@@ -185,7 +184,7 @@ module HTML
185
184
  emoji = Emoji.find_by_alias(Regexp.last_match[1])
186
185
 
187
186
  if emoji
188
- emoji.raw || context.dig(:emoji_image_tag)&.call(emoji) || match
187
+ emoji.raw || @emoji_image_tag.call(emoji) || match
189
188
  else
190
189
  match
191
190
  end
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "html/pipeline"
4
+
3
5
  module HTML
4
6
  class Pipeline
5
7
  class Mrkdwn < Filter
6
- VERSION = "0.1.5"
8
+ VERSION = "0.1.7"
7
9
  end
8
10
  end
9
11
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "html/pipeline"
3
4
  require_relative "mrkdwn/mrkdwn_filter"
4
5
  require_relative "mrkdwn/version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-pipeline-mrkdwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Gorst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-17 00:00:00.000000000 Z
11
+ date: 2023-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: escape_utils
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.14.3
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.4.4
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.4.4
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: minitest
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,34 @@ dependencies:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
96
  version: 5.2.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 13.0.6
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 13.0.6
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 1.43.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 1.43.0
83
125
  description: An HTML::Pipeline filter for Slack's mrkdwn markup language.
84
126
  email: jason.gorst@me.com
85
127
  executables:
@@ -91,13 +133,11 @@ files:
91
133
  - CHANGELOG.md
92
134
  - CODE_OF_CONDUCT.md
93
135
  - Gemfile
94
- - Gemfile.lock
95
136
  - LICENSE.txt
96
137
  - README.md
97
138
  - Rakefile
98
139
  - bin/mrkdwn
99
140
  - lib/html/pipeline/mrkdwn.rb
100
- - lib/html/pipeline/mrkdwn/helpers/pipeline.rb
101
141
  - lib/html/pipeline/mrkdwn/mrkdwn_filter.rb
102
142
  - lib/html/pipeline/mrkdwn/version.rb
103
143
  homepage: https://github.com/jasongorst/html-pipeline-mrkdwn
@@ -107,6 +147,7 @@ metadata:
107
147
  homepage_uri: https://github.com/jasongorst/html-pipeline-mrkdwn
108
148
  source_code_uri: https://github.com/jasongorst/html-pipeline-mrkdwn.git
109
149
  changelog_uri: https://github.com/jasongorst/html-pipeline-mrkdwn/blob/main/CHANGELOG.md
150
+ rubygems_mfa_required: 'true'
110
151
  post_install_message:
111
152
  rdoc_options: []
112
153
  require_paths:
@@ -122,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
163
  - !ruby/object:Gem::Version
123
164
  version: '0'
124
165
  requirements: []
125
- rubygems_version: 3.4.1
166
+ rubygems_version: 3.4.4
126
167
  signing_key:
127
168
  specification_version: 4
128
169
  summary: An HTML::Pipeline filter for Slack's mrkdwn markup language.
data/Gemfile.lock DELETED
@@ -1,70 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- html-pipeline-mrkdwn (0.1.4)
5
- escape_utils (~> 1.3.0)
6
- gemoji (~> 4.0.1)
7
- html-pipeline (~> 2.14.3)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- activesupport (7.0.4)
13
- concurrent-ruby (~> 1.0, >= 1.0.2)
14
- i18n (>= 1.6, < 2)
15
- minitest (>= 5.1)
16
- tzinfo (~> 2.0)
17
- ast (2.4.2)
18
- concurrent-ruby (1.1.10)
19
- escape_utils (1.3.0)
20
- gemoji (4.0.1)
21
- html-pipeline (2.14.3)
22
- activesupport (>= 2)
23
- nokogiri (>= 1.4)
24
- i18n (1.12.0)
25
- concurrent-ruby (~> 1.0)
26
- json (2.6.3)
27
- mini_portile2 (2.8.1)
28
- minitest (5.17.0)
29
- minitest-rg (5.2.0)
30
- minitest (~> 5.0)
31
- nokogiri (1.13.10)
32
- mini_portile2 (~> 2.8.0)
33
- racc (~> 1.4)
34
- parallel (1.22.1)
35
- parser (3.1.3.0)
36
- ast (~> 2.4.1)
37
- racc (1.6.2)
38
- rainbow (3.1.1)
39
- rake (13.0.6)
40
- regexp_parser (2.6.1)
41
- rexml (3.2.5)
42
- rubocop (1.41.1)
43
- json (~> 2.3)
44
- parallel (~> 1.10)
45
- parser (>= 3.1.2.1)
46
- rainbow (>= 2.2.2, < 4.0)
47
- regexp_parser (>= 1.8, < 3.0)
48
- rexml (>= 3.2.5, < 4.0)
49
- rubocop-ast (>= 1.23.0, < 2.0)
50
- ruby-progressbar (~> 1.7)
51
- unicode-display_width (>= 1.4.0, < 3.0)
52
- rubocop-ast (1.24.0)
53
- parser (>= 3.1.1.0)
54
- ruby-progressbar (1.11.0)
55
- tzinfo (2.0.5)
56
- concurrent-ruby (~> 1.0)
57
- unicode-display_width (2.3.0)
58
-
59
- PLATFORMS
60
- arm64-darwin-22
61
-
62
- DEPENDENCIES
63
- html-pipeline-mrkdwn!
64
- minitest (~> 5.17.0)
65
- minitest-rg (~> 5.2.0)
66
- rake (~> 13.0)
67
- rubocop (~> 1.21)
68
-
69
- BUNDLED WITH
70
- 2.4.1
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # A default pipeline for Slack messages using mrkdwn.
4
-
5
- require "bundler/setup"
6
- require_relative "../../mrkdwn"
7
-
8
- PIPELINE = HTML::Pipeline.new [
9
- HTML::Pipeline::PlainTextInputFilter,
10
- HTML::Pipeline::Mrkdwn
11
- ]