marked-conductor 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/conductor/boolean.rb +15 -0
- data/lib/conductor/condition.rb +4 -3
- data/lib/conductor/config.rb +1 -1
- data/lib/conductor/env.rb +3 -3
- data/lib/conductor/version.rb +1 -1
- data/lib/conductor.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abf6b7790e8d6823663584d5e4db749ea42ecc7d2515ebe14c8b5d7eb475e52d
|
4
|
+
data.tar.gz: bbfd235d53a4af3875bf24c7b77795797a8317c2aac37d255fdc7ac04430fbea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f702032d3a40695083dd5494ac89a4a1701b551bd0a562337c818e7f65620bdb1ca0c7575a4ad80cd696e0aa079e9f66ca9022b47d62bc965c1878bc5d2de81
|
7
|
+
data.tar.gz: c44ea2a058bbac4331886524ecb8755c425490c7b04375409cac34a2a092d99eca49880e17e73191318d641d9039c58f76ef249b5d6c4f807de91780aa91f6ee
|
data/CHANGELOG.md
CHANGED
data/lib/conductor/condition.rb
CHANGED
@@ -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(
|
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.
|
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/config.rb
CHANGED
@@ -18,7 +18,7 @@ module Conductor
|
|
18
18
|
|
19
19
|
def create_config(config_file)
|
20
20
|
config_dir = File.dirname(config_file)
|
21
|
-
scripts_dir = File.dirname(File.join(
|
21
|
+
scripts_dir = File.dirname(File.join(config_dir, 'scripts'))
|
22
22
|
FileUtils.mkdir_p(config_dir) unless File.directory?(config_dir)
|
23
23
|
FileUtils.mkdir_p(scripts_dir) unless File.directory?(scripts_dir)
|
24
24
|
File.open(config_file, 'w') { |f| f.puts sample_config }
|
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/
|
32
|
-
filepath: '/Users/ttscoff/Dropbox/
|
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/
|
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
|
|
data/lib/conductor/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.4
|
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
|