marked-conductor 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '079981390f00381e4d8a8e72d4601689bfbd337a53c08a82fbb03f00e92e4fbf'
4
- data.tar.gz: afded28efba89f40cb679d186dd073d1f7c021bf187d3dae69a755c82a0ed5e9
3
+ metadata.gz: b8baea5f97cf53a0a8ff79a8ccb0f6fc06ce84192f708291f2e07ebd85e3c393
4
+ data.tar.gz: 43c20bc158834e03ca7a8d2e5e52bde33ff27b7397183b2eece3adeb77162991
5
5
  SHA512:
6
- metadata.gz: b73034fc92df9060a6544ce9b259af347a1388121d2497f57011f58fdbb4e180bea986297e7383a55743cb391d9736f009351fc9b838df2c40b7ce39fd04c33a
7
- data.tar.gz: c42bbcee82174272b59eeda49b6632c4437038ddc260c0597ce20003dfc73bc56c7640651953d7e2ee6239ab5cc338d7a7998bc3ef95397f8bdc78b2722d97d5
6
+ metadata.gz: 4672bd627a2d34dfc578ff80f9a3360d8a5319428c8b4746442a77adae4e7555f68c91797a0be91b4ddc2e384fb8dd84164682643d64342b580db4dd79921b76
7
+ data.tar.gz: 1ba57715e5ad4d0844f654a3792551d9d7bd333385a4018b0a0a00f1a90e67f3105798a89be2fb2be0f453ee5c88f170e5e6d183196213e4f258de7b8d59007e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.0.3
2
+
3
+ 2024-04-25 14:32
4
+
5
+ #### FIXED
6
+
7
+ - YAML true/false testing
8
+
1
9
  ### 1.0.2
2
10
 
3
11
  2024-04-25 14:15
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # True class
4
+ class ::TrueClass
5
+ def bool?
6
+ true
7
+ end
8
+ end
9
+
10
+ # False class
11
+ class ::FalseClass
12
+ def bool?
13
+ true
14
+ end
15
+ end
@@ -150,7 +150,7 @@ module Conductor
150
150
  def test_truthy(value1, value2, operator)
151
151
  return false unless value2.bool?
152
152
 
153
- value2.to_bool!
153
+ value2 = value2.to_bool if value2.is_a?(String)
154
154
 
155
155
  res = value1 == value2
156
156
 
@@ -185,14 +185,15 @@ module Conductor
185
185
  content = IO.read(@env[:filepath]).force_encoding('utf-8')
186
186
  return false unless content =~ /^---/
187
187
 
188
- yaml = YAML.safe_load(content.split(/(---|\.\.\.)/)[1])
188
+ yaml = YAML.safe_load(content.split(/^(?:---|\.\.\.)/)[1])
189
+
189
190
  return false unless yaml
190
191
  if m[2]
191
192
  value1 = yaml[m[2]]
192
193
  value1 = value1.join(',') if value1.is_a?(Array)
193
194
  if %i[type_of not_type_of].include?(operator)
194
195
  test_type(value1, value, operator)
195
- elsif value1.is_a?(Boolean)
196
+ elsif value1.bool?
196
197
  test_truthy(value1, value, operator)
197
198
  elsif value1.number? && value2.number? && %i[gt lt equal not_equal].include?(operator)
198
199
  test_operator(value1, value, operator)
data/lib/conductor/env.rb CHANGED
@@ -28,11 +28,11 @@ module Conductor
28
28
  css_path: '/Applications/Marked 2.app/Contents/Resources/swiss.css',
29
29
  ext: 'md',
30
30
  includes: [],
31
- origin: '/Users/ttscoff/Dropbox/Work/Oracle/oci-ai-industry-dbsolutions/text-analysis-and-translation/',
32
- filepath: '/Users/ttscoff/Dropbox/Work/Oracle/oci-ai-industry-dbsolutions/text-analysis-and-translation/README.md',
31
+ origin: '/Users/ttscoff/Dropbox/Writing/brettterpstra.com/_drafts/',
32
+ filepath: '/Users/ttscoff/Dropbox/Writing/brettterpstra.com/_drafts/marked-2-and-obsidian.md',
33
33
  phase: 'PREPROCESS',
34
34
  outline: 'NONE',
35
- path: '/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/ttscoff/Dropbox/Work/Oracle/oci-ai-industry-dbsolutions/text-analysis-and-translation/'
35
+ path: '/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/ttscoff/Dropbox/Writing/brettterpstra.com/_drafts/'
36
36
  }
37
37
  end
38
38
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Conductor
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
data/lib/conductor.rb CHANGED
@@ -11,6 +11,7 @@ require_relative 'conductor/env'
11
11
  require_relative 'conductor/config'
12
12
  require_relative 'conductor/hash'
13
13
  require_relative 'conductor/array'
14
+ require_relative 'conductor/boolean'
14
15
  require_relative 'conductor/string'
15
16
  require_relative 'conductor/script'
16
17
  require_relative 'conductor/command'
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.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -88,6 +88,7 @@ files:
88
88
  - images/preferences.jpg
89
89
  - lib/conductor.rb
90
90
  - lib/conductor/array.rb
91
+ - lib/conductor/boolean.rb
91
92
  - lib/conductor/command.rb
92
93
  - lib/conductor/condition.rb
93
94
  - lib/conductor/config.rb