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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abf6b7790e8d6823663584d5e4db749ea42ecc7d2515ebe14c8b5d7eb475e52d
4
- data.tar.gz: bbfd235d53a4af3875bf24c7b77795797a8317c2aac37d255fdc7ac04430fbea
3
+ metadata.gz: c6a0da9f71e766f19edb6cb13fc27139af3934f3cdf013b0c51164cc3b20d73f
4
+ data.tar.gz: a0d4c8b2d37653632d8757f0704008fbc370a6edcc89c46e9f1eac8927cab9e7
5
5
  SHA512:
6
- metadata.gz: 7f702032d3a40695083dd5494ac89a4a1701b551bd0a562337c818e7f65620bdb1ca0c7575a4ad80cd696e0aa079e9f66ca9022b47d62bc965c1878bc5d2de81
7
- data.tar.gz: c44ea2a058bbac4331886524ecb8755c425490c7b04375409cac34a2a092d99eca49880e17e73191318d641d9039c58f76ef249b5d6c4f807de91780aa91f6ee
6
+ metadata.gz: 5ccaa5df5811bf5433bea16f2ddc5b71c056592250b0757d83119e998a65426eaeb04e291f3b758bc0e74e64b1a6f58bcbcb59ed7a9eccdf5e58dfe26e474886
7
+ data.tar.gz: 340f3e73ff68f7026f169cc6c686de8dcd6651836c6b685e886e5a3c115f17b676ea889565929a6ec778ad017b914c0c796ac4e8b724fc8808288535bf5da54d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 1.0.5
2
+
3
+ 2024-04-25 17:00
4
+
5
+ #### FIXED
6
+
7
+ - First-run config creating directory instead of file
8
+ - Frozen string/encoding issue on string comparisons
9
+
1
10
  ### 1.0.3
2
11
 
3
12
  2024-04-25 14:32
@@ -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.to_s =~ /#{val2}/i
120
+ val1 =~ /#{val2}/i
119
121
  when :not_starts_with
120
- val1.to_s !~ /^#{val2}/i
122
+ val1 !~ /^#{val2}/i
121
123
  when :not_ends_with
122
- val1.to_s !~ /#{val2}$/i
124
+ val1 !~ /#{val2}$/i
123
125
  when :starts_with
124
- val1.to_s =~ /^#{val2}/i
126
+ val1 =~ /^#{val2}/i
125
127
  when :ends_with
126
- val1.to_s =~ /#{val2}$/i
128
+ val1 =~ /#{val2}$/i
127
129
  when :equal
128
- val1.to_s =~ /^#{val2}$/i
130
+ val1 =~ /^#{val2}$/i
129
131
  when :not_equal
130
- val1.to_s !~ /^#{val2}$/i
132
+ val1 !~ /^#{val2}$/i
131
133
  else
132
134
  false
133
135
  end
@@ -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!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Conductor
4
- VERSION = '1.0.4'
4
+ VERSION = '1.0.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marked-conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra