template-ruby 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/publish +1 -1
- data/lib/code/object/string.rb +7 -0
- data/lib/template/version.rb +1 -1
- data/spec/code/string_spec.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2f9d139eea7ab816480641fed6463276e96626401204b5bb11c8a59934abe93
|
4
|
+
data.tar.gz: f571be9f8bc7b9c4187b300e3f4d446deb4e4b427ed1c23b75c0a22ae7d6783b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2840d50f18f3ed0d0ec502c21631a38f0e972ad33979bb7cbc00d63e605532d75eafd48a86e52c93e1206c5ef9b35790608a4479ea76567ad2c5a7796f6e7da9
|
7
|
+
data.tar.gz: d4b6c4bdcced35050f08c6f4095074298751db0bf654b1b799b0b9815583a5d88ccfc66c6ecc996a51cee297a3c051754dc5845dce4f3c38eb8f71a1dbf63368
|
data/bin/publish
CHANGED
data/lib/code/object/string.rb
CHANGED
@@ -25,6 +25,9 @@ class Code
|
|
25
25
|
elsif operator == "reverse"
|
26
26
|
sig(arguments)
|
27
27
|
reverse
|
28
|
+
elsif operator == "include?"
|
29
|
+
sig(arguments) { ::Code::Object::String }
|
30
|
+
include?(value)
|
28
31
|
else
|
29
32
|
super
|
30
33
|
end
|
@@ -83,6 +86,10 @@ class Code
|
|
83
86
|
def reverse
|
84
87
|
::Code::Object::String.new(raw.reverse)
|
85
88
|
end
|
89
|
+
|
90
|
+
def include?(value)
|
91
|
+
::Code::Object::Boolean.new(raw.include?(value.raw))
|
92
|
+
end
|
86
93
|
end
|
87
94
|
end
|
88
95
|
end
|
data/lib/template/version.rb
CHANGED
data/spec/code/string_spec.rb
CHANGED
@@ -15,7 +15,8 @@ RSpec.describe "string" do
|
|
15
15
|
["'Hello \\{name}'", "Hello {name}"],
|
16
16
|
['"Hello \\{name}"', "Hello {name}"],
|
17
17
|
["'Hello {1}'", "Hello 1"],
|
18
|
-
['"Hello {1}"', "Hello 1"]
|
18
|
+
['"Hello {1}"', "Hello 1"],
|
19
|
+
['"Hello".include?("H")', "true"]
|
19
20
|
].each do |input, output|
|
20
21
|
context input do
|
21
22
|
let(:input) { input }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: template-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|