code-ruby 0.15.7 → 0.15.8

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: 9d6911c3f589574fc7de30da9671e3d104c22a291d258c2e3413466d91c1fa25
4
- data.tar.gz: c48d44f2d4b40b532970946cdf8268680271f828645daec849e616b1700e29fa
3
+ metadata.gz: 8f1a4ed575315f69d84456b831cf2a7af666a59bb38731d9556d94800b194d3c
4
+ data.tar.gz: e20431b754a5f8313d523b55a18308377f281946af28d142c4b7ce055d095d91
5
5
  SHA512:
6
- metadata.gz: ea68423505a7a3ceede3745f24ad2df6f696bfd54158f99f0b86f520ed6a85694620b3333711a4431fba8e54f1210221b890c701e6728bdd87f0bbe348cfc75a
7
- data.tar.gz: cbb894ccba3bc62b55e2949f9dcc889eb6dbc8e8cf209439937d5b297bcb3b88bbe68614a9e1bcbeeea5bebb32cca6ae3f6e3d34c58a8d9c5081e6edc7600e94
6
+ metadata.gz: 8616cf15597d618371da4ce000055f80ebf37f711d7d0e26b3396e07c79c2ab5dc1b408710e56a3b454c26e966d8b8f033d571762f066c75dda5eac84798c78b
7
+ data.tar.gz: 121bef5797084dfa8dca67d770b0bacd7d65383e62f2730d4033b2ce8d9d23e44c622ec0729d4e33f2f41c0e0a6b4f4e59e6d1a6ba16db22283b3c58aed89b10
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code-ruby (0.15.7)
4
+ code-ruby (0.15.8)
5
5
  activesupport
6
6
  bigdecimal
7
7
  did-you-mean
@@ -18,7 +18,7 @@ class Code
18
18
 
19
19
  class Text < Node
20
20
  def initialize(parsed)
21
- return if parsed.blank?
21
+ return if parsed.nil?
22
22
 
23
23
  @text = parsed
24
24
  end
@@ -39,12 +39,12 @@ class Code
39
39
  end
40
40
 
41
41
  def initialize(parsed)
42
- return if parsed.blank?
42
+ return if parsed.nil?
43
43
 
44
44
  if parsed.key?(:text)
45
- @part = Node::String::Part::Text.new(parsed.delete(:text).presence)
45
+ @part = Node::String::Part::Text.new(parsed.delete(:text))
46
46
  elsif parsed.key?(:code)
47
- @part = Node::String::Part::Code.new(parsed.delete(:code).presence)
47
+ @part = Node::String::Part::Code.new(parsed.delete(:code))
48
48
  end
49
49
  end
50
50
 
@@ -28,14 +28,14 @@ class Code
28
28
  href ||= Nothing.new
29
29
 
30
30
  String.new(<<~LINK.strip)
31
- <a href="#{CGI.escape(href.raw.to_s)}">#{CGI.escape(text.raw.to_s)}</a>
31
+ <a href="#{CGI.escapeHTML(href.raw.to_s)}">#{CGI.escapeHTML(text.raw.to_s)}</a>
32
32
  LINK
33
33
  end
34
34
 
35
35
  def self.code_escape(string = nil)
36
36
  string ||= Nothing.new
37
37
 
38
- String.new(CGI.escape(string.raw.to_s))
38
+ String.new(CGI.escapeHTML(string.raw.to_s))
39
39
  end
40
40
  end
41
41
  end
data/lib/code/version.rb CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require_relative "../code"
4
4
 
5
- Code::Version = Gem::Version.new("0.15.7")
5
+ Code::Version = Gem::Version.new("0.15.8")
data/spec/code_spec.rb CHANGED
@@ -302,6 +302,7 @@ RSpec.describe Code do
302
302
  ["[1, 2].join(',')", "'1,2'"],
303
303
  ["[nothing, 2].join(',')", "',2'"],
304
304
  ["[nothing, nothing].join", "''"],
305
+ ["'{1} {2}'", "'1 2'"],
305
306
  ["", ""]
306
307
  ].each do |input, expected|
307
308
  it "#{input} == #{expected}" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.7
4
+ version: 0.15.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-17 00:00:00.000000000 Z
11
+ date: 2024-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport