marked-conductor 1.0.37 → 1.0.39

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: ecb00aeb3e1cbd137378b4b4f236ebf7c9b0a1a24a9e9bff5c5788eacb327730
4
- data.tar.gz: 6bd4a657d14378e9e65acf704162dc3f79163f87e48840fe93d6e7047eb14455
3
+ metadata.gz: afa046834bd1aa489d0b5e30a4a20e954c958d01fec5a825ede7f6bd4160c926
4
+ data.tar.gz: 13c549beca3c2a1034a37275c7aa5254df2ea86a348d1f24b39bf826b6a51045
5
5
  SHA512:
6
- metadata.gz: d7b041001f2ae096a66d9efa3aa359d20e2f8b1ea0bb35a11e455c6e171b3746d97c678bfb1272b7d1d0328045a552023eeef85a131538524c936213d83a7163
7
- data.tar.gz: 99c1e9653fd7feffdae8def8ee3b37a79cb3a4e6fc9d2c221cbe41c8ecd9ca39a5971bfc15d140dec867e172da6ed1477d82777530856c53578de9e94a559f12
6
+ metadata.gz: 0350024a2c2481624e537b2b75f30d5b70b957d68ef1664050d2211412fbb0ff4d20c69d314e702b1592ae9024126dd0218d647c74d4147ab9bb726a54023dc9
7
+ data.tar.gz: ea0c11aa9377089252cb71e1efeb0c863f0c08d89d99cd5596b206e2deb8e4dde222869f53452bcd2919d4546b29a665375fdd5fff2dc82a8098d90d43f4161d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ### 1.0.39
2
+
3
+ 2025-01-01 13:55
4
+
5
+ #### FIXED
6
+
7
+ - Inert_file messing up file extensions
8
+
9
+ ### 1.0.38
10
+
11
+ 2024-08-23 11:20
12
+
1
13
  ### 1.0.37
2
14
 
3
15
  2024-08-23 11:04
data/Gemfile.lock ADDED
@@ -0,0 +1,104 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ marked-conductor (1.0.39)
5
+ chronic (~> 0.10.2)
6
+ tty-which (~> 0.5.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ansi (1.5.0)
12
+ ast (2.4.2)
13
+ awesome_print (1.9.2)
14
+ chronic (0.10.2)
15
+ coderay (1.1.3)
16
+ diff-lcs (1.5.1)
17
+ docile (1.4.0)
18
+ gem-release (2.2.2)
19
+ json (2.7.2)
20
+ language_server-protocol (3.17.0.3)
21
+ method_source (1.1.0)
22
+ multi_json (1.15.0)
23
+ parallel (1.24.0)
24
+ parse_gemspec (1.0.0)
25
+ parse_gemspec-cli (1.0.0)
26
+ multi_json
27
+ parse_gemspec
28
+ thor
29
+ parser (3.3.1.0)
30
+ ast (~> 2.4.1)
31
+ racc
32
+ pry (0.14.2)
33
+ coderay (~> 1.1)
34
+ method_source (~> 1.0)
35
+ racc (1.7.3)
36
+ rainbow (3.1.1)
37
+ rake (13.2.1)
38
+ regexp_parser (2.9.0)
39
+ rexml (3.2.6)
40
+ rspec (3.13.0)
41
+ rspec-core (~> 3.13.0)
42
+ rspec-expectations (~> 3.13.0)
43
+ rspec-mocks (~> 3.13.0)
44
+ rspec-core (3.13.0)
45
+ rspec-support (~> 3.13.0)
46
+ rspec-expectations (3.13.1)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.13.0)
49
+ rspec-mocks (3.13.1)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.13.0)
52
+ rspec-support (3.13.1)
53
+ rubocop (1.62.1)
54
+ json (~> 2.3)
55
+ language_server-protocol (>= 3.17.0)
56
+ parallel (~> 1.10)
57
+ parser (>= 3.3.0.2)
58
+ rainbow (>= 2.2.2, < 4.0)
59
+ regexp_parser (>= 1.8, < 3.0)
60
+ rexml (>= 3.2.5, < 4.0)
61
+ rubocop-ast (>= 1.31.1, < 2.0)
62
+ ruby-progressbar (~> 1.7)
63
+ unicode-display_width (>= 2.4.0, < 3.0)
64
+ rubocop-ast (1.31.2)
65
+ parser (>= 3.3.0.4)
66
+ ruby-progressbar (1.13.0)
67
+ simplecov (0.22.0)
68
+ docile (~> 1.1)
69
+ simplecov-html (~> 0.11)
70
+ simplecov_json_formatter (~> 0.1)
71
+ simplecov-console (0.9.1)
72
+ ansi
73
+ simplecov
74
+ terminal-table
75
+ simplecov-html (0.12.3)
76
+ simplecov_json_formatter (0.1.4)
77
+ terminal-table (3.0.2)
78
+ unicode-display_width (>= 1.1.1, < 3)
79
+ thor (1.3.1)
80
+ tty-which (0.5.0)
81
+ unicode-display_width (2.5.0)
82
+ yard (0.9.36)
83
+
84
+ PLATFORMS
85
+ arm64-darwin-20
86
+ arm64-darwin-24
87
+ x86_64-darwin-20
88
+
89
+ DEPENDENCIES
90
+ awesome_print (~> 1.9.2)
91
+ bundler (~> 2.0)
92
+ gem-release (~> 2.2)
93
+ marked-conductor!
94
+ parse_gemspec-cli (~> 1.0)
95
+ pry (~> 0.14.2)
96
+ rake (~> 13.0)
97
+ rspec (~> 3.0)
98
+ rubocop (~> 1.21)
99
+ simplecov (~> 0.21)
100
+ simplecov-console (~> 0.9)
101
+ yard (~> 0.9, >= 0.9.26)
102
+
103
+ BUNDLED WITH
104
+ 2.2.29
data/README.md CHANGED
@@ -1,10 +1,17 @@
1
1
 
2
+
2
3
  [![RubyGems.org](https://img.shields.io/gem/v/marked-conductor)](https://rubygems.org/gems/marked-conductor)
3
4
 
4
5
  # Marked Conductor
5
6
 
6
7
  A "train conductor" for [Marked 2](https://marked2app.com) (Mac only). Conductor can be set up as a Custom Preprocessor or Custom Processor for Marked, and can run different commands and scripts based on conditions in a YAML configuration file, allowing you to have multiple processors that run based on predicates.
7
8
 
9
+ Conductor configuration uses "natural language," allowing for complex
10
+ operations without having to write any code. A condition can look like
11
+ "name contains work-" to match a file named `work-project1.md`. The
12
+ actions you can take include scripts, commands, and built in filters for
13
+ an array of common operations.
14
+
8
15
  ## Installation
9
16
 
10
17
  $ gem install marked-conductor
data/bin/conductor CHANGED
@@ -1,29 +1,53 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env ruby -W1
2
2
  # frozen_string_literal: true
3
3
 
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'conductor' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
14
-
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
16
-
17
- if File.file?(bundle_binstub)
18
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
- load(bundle_binstub)
20
- else
21
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
4
+ require_relative "../lib/conductor"
5
+ require "optparse"
6
+
7
+ optparse = OptionParser.new do |opts|
8
+ opts.banner = "Called from Marked 2 as a Custom Pre/Processor"
9
+
10
+ opts.on("-v", "--version", "Show version number") do
11
+ puts "conductor v#{Conductor::VERSION}"
12
+ Process.exit 0
13
+ end
14
+
15
+ opts.on("-h", "--help", "Display this screen") do
16
+ puts opts
17
+ exit
23
18
  end
24
19
  end
25
20
 
26
- require "rubygems"
27
- require "bundler/setup"
21
+ optparse.parse!
22
+
23
+ config = Conductor::Config.new
24
+ res = config.configure
25
+
26
+ Process.exit 0 unless res
28
27
 
29
- load Gem.bin_path("marked-conductor", "conductor")
28
+ Conductor.stdin
29
+ Conductor.original_input = Conductor.stdin
30
+
31
+ tracks = config.tracks
32
+ res, condition = Conductor.conduct(tracks)
33
+
34
+ ##
35
+ ## Clean up conditions for output
36
+ ##
37
+ ## @param condition The condition
38
+ ##
39
+ def clean_condition(condition)
40
+ condition.join("").sub(/ *(->|,) *$/, "")
41
+ end
42
+
43
+ if res.nil?
44
+ warn "No conditions satisfied"
45
+ # puts Conductor::Env
46
+ puts "NOCUSTOM"
47
+ elsif res == Conductor.original_input
48
+ warn "No change in output"
49
+ puts "NOCUSTOM"
50
+ else
51
+ warn "Met condition: #{clean_condition(condition)}"
52
+ puts res
53
+ end
@@ -12,13 +12,14 @@ class ::String
12
12
  def find_file_in(paths, filename, ext)
13
13
  return filename if File.exist?(filename)
14
14
 
15
+ ext = ext.sub(/^\./, "")
16
+
15
17
  filename = File.basename(filename, ".#{ext}")
16
18
 
17
19
  paths.each do |path|
18
20
  exp = File.join(File.expand_path("~/.config/conductor/"), path, "#{filename}.#{ext}")
19
21
  return exp if File.exist?(exp)
20
22
  end
21
-
22
23
  "#{filename}.#{ext}"
23
24
  end
24
25
 
@@ -180,13 +181,13 @@ class ::String
180
181
  lines = utf8.split(/\n/)
181
182
  max = max.to_i&.positive? ? " max#{max}" : ""
182
183
  line = case after.to_sym
183
- when :h2
184
- first_h2.nil? ? 0 : first_h2 + 1
185
- when :h1
186
- first_h1.nil? ? 0 : first_h1 + 1
187
- else
188
- meta_insert_point.positive? ? meta_insert_point + 1 : 0
189
- end
184
+ when :h2
185
+ first_h2.nil? ? 0 : first_h2 + 1
186
+ when :h1
187
+ first_h1.nil? ? 0 : first_h1 + 1
188
+ else
189
+ meta_insert_point.positive? ? meta_insert_point + 1 : 0
190
+ end
190
191
 
191
192
  lines.insert(line, "\n<!--toc#{max}-->\n").join("\n")
192
193
  end
@@ -272,21 +273,21 @@ class ::String
272
273
  path = path.strip
273
274
 
274
275
  path = if path =~ %r{^[.~/]}
275
- File.expand_path(path)
276
- else
277
- find_file_in(%w[files], path, File.extname(path))
278
- end
276
+ File.expand_path(path)
277
+ else
278
+ find_file_in(%w[files], path, File.extname(path))
279
+ end
279
280
 
280
281
  warn "File not found: #{path}" unless File.exist?(path)
281
282
 
282
283
  out = case type
283
- when :code
284
- "<<(#{path})"
285
- when :raw
286
- "<<{#{path}}"
287
- else
288
- "<<[#{path}]"
289
- end
284
+ when :code
285
+ "<<(#{path})"
286
+ when :raw
287
+ "<<{#{path}}"
288
+ else
289
+ "<<[#{path}]"
290
+ end
290
291
  out = "\n#{out}\n"
291
292
 
292
293
  case position
@@ -363,10 +364,10 @@ class ::String
363
364
  return insert_raw_javascript(path) if path =~ /\(.*?\)/
364
365
 
365
366
  path = if path =~ %r{^[~/.]}
366
- File.expand_path(path)
367
- else
368
- find_file_in(%w[javascript javascripts js scripts], path.sub(/(\.js)?$/, ".js"), "js")
369
- end
367
+ File.expand_path(path)
368
+ else
369
+ find_file_in(%w[javascript javascripts js scripts], path.sub(/(\.js)?$/, ".js"), "js")
370
+ end
370
371
 
371
372
  if File.exist?(path)
372
373
  insert_javascript(path)
@@ -381,7 +382,7 @@ class ::String
381
382
  filename.sub!(/-?\d{4}-\d{2}-\d{2}-?/, "")
382
383
  filename.sub!(/\bdot\b/, ".")
383
384
  filename.sub!(/ dash /, "-")
384
- filename.gsub(/-/, ' ')
385
+ filename.gsub(/-/, " ")
385
386
  end
386
387
 
387
388
  def read_title
@@ -512,7 +513,7 @@ class ::String
512
513
  lines = utf8.split(/\n/)
513
514
  lines[meta_insert_point..].join("\n")
514
515
  else
515
- gsub(/(\n|^)<!--\n[\w\d\s]+: ([\w\d\s]+)\n-->\n/m, '')
516
+ gsub(/(\n|^)<!--\n[\w\d\s]+: ([\w\d\s]+)\n-->\n/m, "")
516
517
  end
517
518
  end
518
519
 
@@ -697,10 +698,10 @@ module Conductor
697
698
  amt = 0
698
699
  if @params
699
700
  amt = if @params[0] =~ /^[yts]/
700
- 1
701
- else
702
- @params[0].to_i
703
- end
701
+ 1
702
+ else
703
+ @params[0].to_i
704
+ end
704
705
  end
705
706
  content.insert_title(shift: amt)
706
707
  when /(insert|add|inject)script/
@@ -713,19 +714,19 @@ module Conductor
713
714
  m = Regexp.last_match
714
715
 
715
716
  position = if @params.count == 2
716
- @params[1].normalize_position
717
- else
718
- m[1].normalize_position
719
- end
717
+ @params[1].normalize_position
718
+ else
719
+ m[1].normalize_position
720
+ end
720
721
  content.insert_file(@params[0], m[2].normalize_include_type, position)
721
722
  when /inserttoc/
722
723
  max = @params.nil? || @params.empty? ? nil : @params[0]
723
724
 
724
725
  after = if @params && @params.count == 2
725
- @params[1] =~ /2/ ? :h2 : :h1
726
- else
727
- :start
728
- end
726
+ @params[1] =~ /2/ ? :h2 : :h1
727
+ else
728
+ :start
729
+ end
729
730
 
730
731
  content.insert_toc(max, after)
731
732
  when /(add|set)meta/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Conductor
4
- VERSION = '1.0.37'
4
+ VERSION = '1.0.39'
5
5
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/conductor/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "marked-conductor"
7
+ spec.version = Conductor::VERSION
8
+ spec.authors = ["Brett Terpstra"]
9
+ spec.email = ["me@brettterpstra.com"]
10
+
11
+ spec.summary = "A custom processor manager for Marked 2 (Mac)"
12
+ spec.description = "Conductor allows easy configuration of multiple scripts" \
13
+ "which are run as custom pre/processors for Marked based on conditional statements."
14
+ spec.homepage = "https://github.com/ttscoff/marked-conductor"
15
+ spec.license = "MIT"
16
+ spec.required_ruby_version = ">= 2.6.0"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = "https://github.com/ttscoff/marked-conductor"
20
+ spec.metadata["changelog_uri"] = "https://github.com/ttscoff/marked-conductor/CHANGELOG.md"
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
+ `git ls-files -z`.split("\x0").reject do |f|
26
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
27
+ end
28
+ end
29
+ spec.bindir = "bin"
30
+ spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ spec.add_development_dependency "awesome_print", "~> 1.9.2"
34
+ spec.add_development_dependency "bundler", "~> 2.0"
35
+ spec.add_development_dependency "gem-release", "~> 2.2"
36
+ spec.add_development_dependency "parse_gemspec-cli", "~> 1.0"
37
+ spec.add_development_dependency "pry", "~> 0.14.2"
38
+ spec.add_development_dependency "rake", "~> 13.0"
39
+ spec.add_development_dependency "rspec", "~> 3.0"
40
+ spec.add_development_dependency "simplecov", "~> 0.21"
41
+ spec.add_development_dependency "simplecov-console", "~> 0.9"
42
+ spec.add_development_dependency "yard", "~> 0.9", ">= 0.9.26"
43
+
44
+ spec.add_development_dependency "rubocop", "~> 1.21"
45
+
46
+
47
+ # Uncomment to register a new dependency of your gem
48
+ spec.add_dependency "chronic", "~> 0.10.2"
49
+ spec.add_dependency "tty-which", "~> 0.5.0"
50
+ # For more information and examples about making a new gem, checkout our
51
+ # guide at: https://bundler.io/guides/creating_gem.html
52
+ end
data/src/_README.md CHANGED
@@ -1,10 +1,17 @@
1
1
  <!--README-->
2
+ <!--GITHUB-->
2
3
  [![RubyGems.org](https://img.shields.io/gem/v/marked-conductor)](https://rubygems.org/gems/marked-conductor)
3
4
 
4
5
  # Marked Conductor
5
-
6
+ <!--END GITHUB-->
6
7
  A "train conductor" for [Marked 2](https://marked2app.com) (Mac only). Conductor can be set up as a Custom Preprocessor or Custom Processor for Marked, and can run different commands and scripts based on conditions in a YAML configuration file, allowing you to have multiple processors that run based on predicates.
7
8
 
9
+ <!--JEKYLL {% img alignright /images/projecticons/conductor.png 146 174 "Conductor icon" %}-->Conductor configuration uses "natural language," allowing for complex
10
+ operations without having to write any code. A condition can look like
11
+ "name contains work-" to match a file named `work-project1.md`. The
12
+ actions you can take include scripts, commands, and built in filters for
13
+ an array of common operations.
14
+
8
15
  ## Installation
9
16
 
10
17
  $ gem install marked-conductor
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marked-conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.37
4
+ version: 1.0.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-23 00:00:00.000000000 Z
10
+ date: 2025-01-01 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: awesome_print
@@ -212,6 +211,7 @@ files:
212
211
  - CHANGELOG.md
213
212
  - CODE_OF_CONDUCT.md
214
213
  - Gemfile
214
+ - Gemfile.lock
215
215
  - LICENSE.txt
216
216
  - README.md
217
217
  - README.rdoc
@@ -232,6 +232,7 @@ files:
232
232
  - lib/conductor/string.rb
233
233
  - lib/conductor/version.rb
234
234
  - lib/conductor/yui_compressor.rb
235
+ - marked-conductor.gemspec
235
236
  - src/_README.md
236
237
  - test.sh
237
238
  homepage: https://github.com/ttscoff/marked-conductor
@@ -241,7 +242,6 @@ metadata:
241
242
  homepage_uri: https://github.com/ttscoff/marked-conductor
242
243
  source_code_uri: https://github.com/ttscoff/marked-conductor
243
244
  changelog_uri: https://github.com/ttscoff/marked-conductor/CHANGELOG.md
244
- post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths:
247
247
  - lib
@@ -256,8 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.0.3.1
260
- signing_key:
259
+ rubygems_version: 3.6.2
261
260
  specification_version: 4
262
261
  summary: A custom processor manager for Marked 2 (Mac)
263
262
  test_files: []