marked-conductor 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/conductor/condition.rb +10 -8
- data/lib/conductor/string.rb +5 -5
- data/lib/conductor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6a0da9f71e766f19edb6cb13fc27139af3934f3cdf013b0c51164cc3b20d73f
|
4
|
+
data.tar.gz: a0d4c8b2d37653632d8757f0704008fbc370a6edcc89c46e9f1eac8927cab9e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ccaa5df5811bf5433bea16f2ddc5b71c056592250b0757d83119e998a65426eaeb04e291f3b758bc0e74e64b1a6f58bcbcb59ed7a9eccdf5e58dfe26e474886
|
7
|
+
data.tar.gz: 340f3e73ff68f7026f169cc6c686de8dcd6651836c6b685e886e5a3c115f17b676ea889565929a6ec778ad017b914c0c796ac4e8b724fc8808288535bf5da54d
|
data/CHANGELOG.md
CHANGED
data/lib/conductor/condition.rb
CHANGED
@@ -85,6 +85,8 @@ module Conductor
|
|
85
85
|
|
86
86
|
return operator == :not_equal if val1.nil?
|
87
87
|
|
88
|
+
val2 = val2.force_encoding('utf-8')
|
89
|
+
|
88
90
|
if val1.date?
|
89
91
|
if val2.time?
|
90
92
|
date1 = val1.to_date
|
@@ -112,22 +114,22 @@ module Conductor
|
|
112
114
|
else
|
113
115
|
Regexp.escape(val2)
|
114
116
|
end
|
115
|
-
|
117
|
+
val1 = val1.dup.to_s.force_encoding('utf-8')
|
116
118
|
case operator
|
117
119
|
when :contains
|
118
|
-
val1
|
120
|
+
val1 =~ /#{val2}/i
|
119
121
|
when :not_starts_with
|
120
|
-
val1
|
122
|
+
val1 !~ /^#{val2}/i
|
121
123
|
when :not_ends_with
|
122
|
-
val1
|
124
|
+
val1 !~ /#{val2}$/i
|
123
125
|
when :starts_with
|
124
|
-
val1
|
126
|
+
val1 =~ /^#{val2}/i
|
125
127
|
when :ends_with
|
126
|
-
val1
|
128
|
+
val1 =~ /#{val2}$/i
|
127
129
|
when :equal
|
128
|
-
val1
|
130
|
+
val1 =~ /^#{val2}$/i
|
129
131
|
when :not_equal
|
130
|
-
val1
|
132
|
+
val1 !~ /^#{val2}$/i
|
131
133
|
else
|
132
134
|
false
|
133
135
|
end
|
data/lib/conductor/string.rb
CHANGED
@@ -14,19 +14,19 @@ class ::String
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def date?
|
17
|
-
match(/^\d{4}-\d{2}-\d{2}/) ? true : false
|
17
|
+
dup.force_encoding('utf-8').match(/^\d{4}-\d{2}-\d{2}/) ? true : false
|
18
18
|
end
|
19
19
|
|
20
20
|
def time?
|
21
|
-
match(/ \d{1,2}(:\d\d)? *([ap]m)?/i)
|
21
|
+
dup.force_encoding('utf-8').match(/ \d{1,2}(:\d\d)? *([ap]m)?/i)
|
22
22
|
end
|
23
23
|
|
24
24
|
def to_date
|
25
|
-
Chronic.parse(self)
|
25
|
+
Chronic.parse(self.dup.force_encoding('utf-8'))
|
26
26
|
end
|
27
27
|
|
28
28
|
def strip_time
|
29
|
-
sub(/ \d{1,2}(:\d\d)? *([ap]m)?/i, '')
|
29
|
+
dup.force_encoding('utf-8').sub(/ \d{1,2}(:\d\d)? *([ap]m)?/i, '')
|
30
30
|
end
|
31
31
|
|
32
32
|
def to_day(time = :end)
|
@@ -39,7 +39,7 @@ class ::String
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def bool?
|
42
|
-
match(/^(?:y(?:es)?|no?|t(?:rue)?|f(?:alse)?)$/) ? true : false
|
42
|
+
dup.force_encoding('utf-8').match(/^(?:y(?:es)?|no?|t(?:rue)?|f(?:alse)?)$/) ? true : false
|
43
43
|
end
|
44
44
|
|
45
45
|
def to_bool!
|
data/lib/conductor/version.rb
CHANGED