synvert-core 1.9.1 → 1.9.2

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: 0bd7dcc7605d1a18cc68ebfba86d5947960bd1320da0b5f7ae41abc8638fed62
4
- data.tar.gz: 3023d5fb8a740da0ce0191bdd08f7435cc931e690714d2195391cf03586efa70
3
+ metadata.gz: 737e801df5a1d686045b99ff8038cd64bd2d39e96813fec4abdedb4473b6f943
4
+ data.tar.gz: 4adcef7e1eaff7297f35ce5b4df40a3d3edbe447c1354c2a0e7c5e279ec2b60f
5
5
  SHA512:
6
- metadata.gz: a3c7f43d890a491a7bb3356ec1695a79278a8c19cf61df4f296a1ea6562cbbcfa27764b36cbb22e06f9f27cd53157e2276392bba42856d58212fddb68e92ffac
7
- data.tar.gz: 9959f0f8290157b96c83011ef770d59b40b845b236e0f8facf24cb6795cd7a837936a8969e380910df2892604dd25f569c66b9ff0c7aa5649e441b5ddf72b32a
6
+ metadata.gz: 1ad2b3a8e7baa9d158e9a7bdbb0dbc9f46b5924ccd7c18867c41ba40192b2e3b57ae500e25edfdf7d0735161abb953bdb833aacbb0e2403321d692c1ae070dd1
7
+ data.tar.gz: aafdeaa9f19a732c6386bec43c3fafbd56398d9f543e316875d3fa7038a91b1fdc153c1d2c530259a2b8fb137fcecd1ff9ab936723d5bfbdd0cf71d7fd175d28
@@ -1,17 +1,10 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: CI
1
+ name: Test & deploy documentation
9
2
 
10
3
  on:
11
4
  push:
12
- branches: [ master ]
5
+ branches: [ main ]
13
6
  pull_request:
14
- branches: [ master ]
7
+ branches: [ main ]
15
8
 
16
9
  jobs:
17
10
  test:
@@ -29,3 +22,22 @@ jobs:
29
22
  bundler-cache: true
30
23
  - name: Run tests
31
24
  run: bundle exec rake
25
+
26
+ deploy:
27
+ runs-on: ubuntu-latest
28
+ needs: test
29
+ name: Update gh-pages to docs
30
+ steps:
31
+ - uses: actions/checkout@v2
32
+ - uses: actions/setup-ruby@v1
33
+ with:
34
+ ruby-version: '3.1'
35
+ - name: Install required gem dependencies
36
+ run: gem install yard redcarpet github-markup --no-document
37
+ - name: Build YARD Ruby Documentation
38
+ run: yardoc --output-dir docs
39
+ - name: Deploy
40
+ uses: peaceiris/actions-gh-pages@v3
41
+ with:
42
+ deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
43
+ publish_dir: ./docs
data/.yardopts ADDED
@@ -0,0 +1,2 @@
1
+ --markup-provider=redcarpet
2
+ --markup=markdown
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.9.2 (2022-10-03)
4
+
5
+ * Fix `test` in sub_snippets
6
+
3
7
  ## 1.9.1 (2022-09-23)
4
8
 
5
9
  * Read / write absolute path
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synvert-core (1.9.1)
4
+ synvert-core (1.9.2)
5
5
  activesupport (< 7.0.0)
6
6
  erubis
7
7
  node_mutation
@@ -49,10 +49,10 @@ GEM
49
49
  method_source (1.0.0)
50
50
  minitest (5.16.3)
51
51
  nenv (0.3.0)
52
- node_mutation (1.4.1)
52
+ node_mutation (1.4.4)
53
53
  activesupport (< 7.0.0)
54
54
  erubis
55
- node_query (1.6.0)
55
+ node_query (1.7.0)
56
56
  activesupport (< 7.0.0)
57
57
  notiffany (0.1.3)
58
58
  nenv (~> 0.1)
@@ -85,7 +85,7 @@ GEM
85
85
  thor (1.2.1)
86
86
  tzinfo (2.0.5)
87
87
  concurrent-ruby (~> 1.0)
88
- zeitwerk (2.6.0)
88
+ zeitwerk (2.6.1)
89
89
 
90
90
  PLATFORMS
91
91
  ruby
@@ -74,11 +74,14 @@ module Synvert::Core
74
74
  # @param name [String] the rewriter name.
75
75
  # @param options [Hash]
76
76
  # @option options [Boolean] :run_instance (true) process the instance.
77
+ # @option options [String] :execute_command ('process') process or test the rewriter
77
78
  # @return [Synvert::Core::Rewriter] the registered rewriter.
78
79
  # @raise [Synvert::Core::RewriterNotFound] if the registered rewriter is not found.
79
- def call(group, name, options = { run_instance: true })
80
+ def call(group, name, options = { run_instance: true, execute_command: 'process' })
80
81
  rewriter = fetch(group, name)
81
- if options[:run_instance]
82
+ if options[:execute_command] == 'test'
83
+ rewriter.test
84
+ elsif options[:run_instance]
82
85
  rewriter.process
83
86
  else
84
87
  rewriter.process_with_sandbox
@@ -121,7 +124,9 @@ module Synvert::Core
121
124
  # @return [Rewriter::RubyVersion] the ruby version
122
125
  # @!attribute [r] gem_spec
123
126
  # @return [Rewriter::GemSpec] the gem spec
124
- attr_reader :group, :name, :sub_snippets, :helpers, :warnings, :affected_files, :ruby_version, :gem_spec
127
+ # @!attribute [r] test_results
128
+ # @return [Object] the test results
129
+ attr_reader :group, :name, :sub_snippets, :helpers, :warnings, :affected_files, :ruby_version, :gem_spec, :test_results
125
130
 
126
131
  # Initialize a Rewriter.
127
132
  # When a rewriter is initialized, it is already registered.
@@ -138,7 +143,7 @@ module Synvert::Core
138
143
  @warnings = []
139
144
  @affected_files = Set.new
140
145
  @redo_until_no_change = false
141
- @options = { run_instance: true, write_to_file: true }
146
+ @options = { run_instance: true, execute_command: 'process', write_to_file: true }
142
147
  @test_results = []
143
148
  self.class.register(@group, @name, self)
144
149
  end
@@ -165,6 +170,7 @@ module Synvert::Core
165
170
 
166
171
  def test
167
172
  @options[:write_to_file] = false
173
+ @options[:execute_command] = 'test'
168
174
  begin
169
175
  @affected_files = Set.new
170
176
  instance_eval(&@block)
@@ -174,6 +180,7 @@ module Synvert::Core
174
180
  end
175
181
  ensure
176
182
  @options[:write_to_file] = true
183
+ @options[:execute_command] = 'process'
177
184
  end
178
185
  @test_results
179
186
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '1.9.1'
5
+ VERSION = '1.9.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synvert-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-23 00:00:00.000000000 Z
11
+ date: 2022-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -104,6 +104,7 @@ files:
104
104
  - ".github/workflows/main.yml"
105
105
  - ".gitignore"
106
106
  - ".rspec"
107
+ - ".yardopts"
107
108
  - CHANGELOG.md
108
109
  - Gemfile
109
110
  - Gemfile.lock