html-pipeline-mrkdwn 0.1.4 → 0.1.6

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: 5fa08004974ddecb7531d6e9f6cf1288b20daae7fb557c497cae6d37d8e86394
4
- data.tar.gz: d8a756a7f14c306db26c65c6bc567d6e1cb46eedf7b2999cd9d8fa3e46738256
3
+ metadata.gz: 2ad6c12052b9c8061380dcf42787ee664e577f77429634aabe4ae61fa911273a
4
+ data.tar.gz: b93112abcd6b677bcf95163e9280571808b7f97c626e6edd8ccacf480b4e1613
5
5
  SHA512:
6
- metadata.gz: e27a62005069af4424bf958a29e57fa601912b6ae122959416b1951fe08889576d0569c8bab74e82bf62b1ee6264d0454e666fecdfb80be955fb2fec582dbddc
7
- data.tar.gz: 65ce9b45d51fc9c45144d07dc0547914dd244735c73885d7a7bac902ada33e9b717fa698f4bc71667a0e4abe94b1e40c6e2e85b5464afe65d49cada068671c06
6
+ metadata.gz: 2e3028d346895108b8ab924367ba21738d1c931d06654d669744f71580e2cc4a7d590637bff2e0c189358ccb7f364f65f87b3a74ce135e6424c478de71985117
7
+ data.tar.gz: accd551e6c889a17df9695d8bb8aca76b2bef5226d62d27e6e0c7bda41437e54eb15f9fc5ab21ef55ee86268da663a4beb5358eca7114f73b6d87988ce63710b
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,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.6] - 2023-01-19
4
+
5
+ - Add test_helper.rb
6
+ - Move all dev deps from Gemfile to gemspec
7
+ - Switch test filename convention to test_*
8
+
9
+ ## [0.1.5] - 2023-01-17
10
+
11
+ - Add *.gem to .gitignore
12
+ - Switch from RSpec to Minitest
13
+
3
14
  ## [0.1.4] - 2022-12-28
4
15
 
5
16
  - 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,12 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
+ end
5
11
 
6
12
  require "rubocop/rake_task"
7
13
 
8
14
  RuboCop::RakeTask.new
9
15
 
10
- RSpec::Core::RakeTask.new(:spec)
11
-
12
- task :default => :spec
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
@@ -2,8 +2,8 @@
2
2
 
3
3
  module HTML
4
4
  class Pipeline
5
- class Mrkdwn < Filter
6
- VERSION = "0.1.4"
5
+ class Mrkdwn
6
+ VERSION = "0.1.6"
7
7
  end
8
8
  end
9
9
  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.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Gorst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-29 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
@@ -53,33 +53,75 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.14.3
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec
56
+ name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.12.0
61
+ version: 2.4.4
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.12.0
68
+ version: 2.4.4
69
69
  - !ruby/object:Gem::Dependency
70
- name: simplecov
70
+ name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.22.0
75
+ version: 5.17.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.22.0
82
+ version: 5.17.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest-rg
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 5.2.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
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:
@@ -87,12 +129,10 @@ executables:
87
129
  extensions: []
88
130
  extra_rdoc_files: []
89
131
  files:
90
- - ".rspec"
91
132
  - ".rubocop.yml"
92
133
  - CHANGELOG.md
93
134
  - CODE_OF_CONDUCT.md
94
135
  - Gemfile
95
- - Gemfile.lock
96
136
  - LICENSE.txt
97
137
  - README.md
98
138
  - Rakefile
@@ -108,6 +148,7 @@ metadata:
108
148
  homepage_uri: https://github.com/jasongorst/html-pipeline-mrkdwn
109
149
  source_code_uri: https://github.com/jasongorst/html-pipeline-mrkdwn.git
110
150
  changelog_uri: https://github.com/jasongorst/html-pipeline-mrkdwn/blob/main/CHANGELOG.md
151
+ rubygems_mfa_required: 'true'
111
152
  post_install_message:
112
153
  rdoc_options: []
113
154
  require_paths:
@@ -123,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
164
  - !ruby/object:Gem::Version
124
165
  version: '0'
125
166
  requirements: []
126
- rubygems_version: 3.4.1
167
+ rubygems_version: 3.4.4
127
168
  signing_key:
128
169
  specification_version: 4
129
170
  summary: An HTML::Pipeline filter for Slack's mrkdwn markup language.
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/Gemfile.lock DELETED
@@ -1,89 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- html-pipeline-mrkdwn (0.1.3)
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
- diff-lcs (1.5.0)
20
- docile (1.4.0)
21
- escape_utils (1.3.0)
22
- gemoji (4.0.1)
23
- html-pipeline (2.14.3)
24
- activesupport (>= 2)
25
- nokogiri (>= 1.4)
26
- i18n (1.12.0)
27
- concurrent-ruby (~> 1.0)
28
- json (2.6.3)
29
- mini_portile2 (2.8.1)
30
- minitest (5.16.3)
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
- rspec (3.12.0)
43
- rspec-core (~> 3.12.0)
44
- rspec-expectations (~> 3.12.0)
45
- rspec-mocks (~> 3.12.0)
46
- rspec-core (3.12.0)
47
- rspec-support (~> 3.12.0)
48
- rspec-expectations (3.12.1)
49
- diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.12.0)
51
- rspec-mocks (3.12.1)
52
- diff-lcs (>= 1.2.0, < 2.0)
53
- rspec-support (~> 3.12.0)
54
- rspec-support (3.12.0)
55
- rubocop (1.41.1)
56
- json (~> 2.3)
57
- parallel (~> 1.10)
58
- parser (>= 3.1.2.1)
59
- rainbow (>= 2.2.2, < 4.0)
60
- regexp_parser (>= 1.8, < 3.0)
61
- rexml (>= 3.2.5, < 4.0)
62
- rubocop-ast (>= 1.23.0, < 2.0)
63
- ruby-progressbar (~> 1.7)
64
- unicode-display_width (>= 1.4.0, < 3.0)
65
- rubocop-ast (1.24.0)
66
- parser (>= 3.1.1.0)
67
- ruby-progressbar (1.11.0)
68
- simplecov (0.22.0)
69
- docile (~> 1.1)
70
- simplecov-html (~> 0.11)
71
- simplecov_json_formatter (~> 0.1)
72
- simplecov-html (0.12.3)
73
- simplecov_json_formatter (0.1.4)
74
- tzinfo (2.0.5)
75
- concurrent-ruby (~> 1.0)
76
- unicode-display_width (2.3.0)
77
-
78
- PLATFORMS
79
- arm64-darwin-22
80
-
81
- DEPENDENCIES
82
- html-pipeline-mrkdwn!
83
- rake (~> 13.0)
84
- rspec (~> 3.12.0)
85
- rubocop (~> 1.21)
86
- simplecov (~> 0.22.0)
87
-
88
- BUNDLED WITH
89
- 2.4.1