synvert 1.4.4 → 1.4.6

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: 9cffb41703a7b7b1c4e796a4f82b38b43bc1c9123ee333d7ee1b94631cdb71f4
4
- data.tar.gz: ceb033680e64a5c85091346f6061ce2791ae0f1568d02fdfd1c1d9a85daa8906
3
+ metadata.gz: a942de5f8a6e4eec684585bf3bb37c1cadceeba0a0c580a3d94908e8ac73b584
4
+ data.tar.gz: 4414547d4d2bae57d34a3616bae182d450c14e0cf5dffc4a4c3e0d63f4b30dce
5
5
  SHA512:
6
- metadata.gz: 765b5c8dd1fdf627177996d3efc5898625fab3a5f6d59b5892519b7f53cb4f03050e2788247338e09b91fbb29382cd6681246627581bd2feaf8c556bfd693ff5
7
- data.tar.gz: 00240dc2fb032f828cf913204ab9bb8c3f3abb64d2edbf5a0870ea07641a69f9d8cf9517d60b864319ae5a1b3686d103a3202a9e258962d8448d936f20e27fb0
6
+ metadata.gz: 7555cf4ad97597997620a17ff843e53fffe7dec9e8dc8c7e48e0707a32105204a8fc651849d55c9784461a264aa6bb7eac180efc7bea6fa960b9eb8280d80a8f
7
+ data.tar.gz: dfd3b9c58df5508c651c99074f4399e90dc4aef1e188720c0d46bcfc4afdaa757847e6353e635cd7d5f19bb3a8095f8f92ab2602225644e36b4fe08d421c577e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.4.6 (2023-07-03)
4
+
5
+ * Read helpers before execute/test/run a snippet
6
+
7
+ ## 1.4.5 (2023-07-01)
8
+
9
+ * Explicitly require `parser`
10
+
3
11
  ## 1.4.4 (2023-06-06)
4
12
 
5
13
  * Update `synvert-core` to 1.28.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synvert (1.4.4)
4
+ synvert (1.4.6)
5
5
  synvert-core (>= 1.28.0)
6
6
 
7
7
  GEM
data/lib/synvert/cli.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'optparse'
4
4
  require 'fileutils'
5
+ require 'parser'
5
6
 
6
7
  module Synvert
7
8
  # Synvert command line interface.
@@ -41,11 +42,14 @@ module Synvert
41
42
  when 'generate'
42
43
  generate_snippet
43
44
  when 'execute'
45
+ read_helpers
44
46
  execute_snippet(@options[:execute_command])
45
47
  when 'test'
48
+ read_helpers
46
49
  rewriter = Synvert::Core::Utils.eval_snippet(@options[:snippet_name])
47
50
  test_snippet(rewriter)
48
51
  when 'run'
52
+ read_helpers
49
53
  rewriter = Synvert::Core::Utils.eval_snippet(@options[:snippet_name])
50
54
  run_snippet(rewriter)
51
55
  else
@@ -154,6 +158,11 @@ module Synvert
154
158
  Dir.glob(File.join(default_snippets_home, 'lib/**/*.rb')).each { |file| require file }
155
159
  end
156
160
 
161
+ # read all helpers.
162
+ def read_helpers
163
+ Dir.glob(File.join(default_snippets_home, 'lib/helpers/**/*.rb')).each { |file| require file }
164
+ end
165
+
157
166
  # List and print all available rewriters.
158
167
  def list_available_rewriters
159
168
  if Core::Rewriter.availables.empty?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Synvert
4
- VERSION = '1.4.4'
4
+ VERSION = '1.4.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synvert
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-06 00:00:00.000000000 Z
11
+ date: 2023-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: synvert-core