eac_tools 0.54.0 → 0.55.0

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: fa6e9611db77983e7a2e2c85a80c76b1f862a1f1995a787396bb162819379e54
4
- data.tar.gz: 11b3d60caf8f8cac1ada36e41cf280f01ea7ac6b37e79284193ff09f9a06bbf8
3
+ metadata.gz: ae856818c701f2192ec09610cac0d471e150e435c7700028e93f2b3e511e49f5
4
+ data.tar.gz: 9214f069183c0b48d954c883e3a1f2e0f59d7a3227c1089b4315c70464a9028f
5
5
  SHA512:
6
- metadata.gz: 073ba61cf82fc77a0676ea984e82840d661cd70ccac1faa1af088f1758ecfe9f895aefca5603ed107fe109d9aa3fbf2c0606b954e321994af7cc8d977169e8fb
7
- data.tar.gz: 78cfcc7f331d552ec6e541d752d4d21e87c8eee70083f0257118564987d0dec0eb83849f3c5666439a1223baa2d012f85b2ace8fb751d4da32b8a80734c23e45
6
+ metadata.gz: b0b1c879ce8f91b853f1677f217c2e4c89f63a63de8a3525e9ce422a47a819a94cd83aee66d4edbc8d8a8ada4b7f153098eb2f365bd4a5e3e304d6bc7c4a1f45
7
+ data.tar.gz: 4b8ec43cea4942df3538d83fa40627d53e668066d6961d4b3bf1a26c2f2a0922890b3d846f56e501d64c0fb81e1e11e727b6f347a613886d442c52fcedd399c8
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.54.0)
5
- avm (~> 0.61)
4
+ eac_tools (0.55.0)
5
+ avm (~> 0.62)
6
6
  avm-eac_asciidoctor_base0 (~> 0.15)
7
7
  avm-eac_generic_base0 (~> 0.10)
8
8
  avm-eac_latex_base0 (~> 0.3)
@@ -16,8 +16,8 @@ PATH
16
16
  avm-eac_ruby_base1 (~> 0.29)
17
17
  avm-eac_webapp_base0 (~> 0.13, >= 0.13.1)
18
18
  avm-eac_wordpress_base0 (~> 0.3)
19
- avm-tools (~> 0.144)
20
- eac_ruby_utils (~> 0.110, >= 0.110.1)
19
+ avm-tools (~> 0.145)
20
+ eac_ruby_utils (~> 0.111)
21
21
 
22
22
  PATH
23
23
  remote: sub/aranha-parsers
@@ -173,9 +173,9 @@ PATH
173
173
  PATH
174
174
  remote: sub/avm-tools
175
175
  specs:
176
- avm-tools (0.144.0)
176
+ avm-tools (0.145.0)
177
177
  aranha-parsers (~> 0.14, >= 0.14.4)
178
- avm (~> 0.61)
178
+ avm (~> 0.62)
179
179
  avm-eac_ruby_base1 (~> 0.29)
180
180
  avm-eac_ubuntu_base0 (~> 0.4)
181
181
  avm-files (~> 0.6)
@@ -191,14 +191,14 @@ PATH
191
191
  PATH
192
192
  remote: sub/avm
193
193
  specs:
194
- avm (0.61.0)
194
+ avm (0.62.0)
195
195
  aranha-parsers (~> 0.14, >= 0.14.4)
196
196
  eac_cli (~> 0.30)
197
197
  eac_config (~> 0.12)
198
198
  eac_docker (~> 0.5)
199
199
  eac_fs (~> 0.16)
200
200
  eac_git (~> 0.14)
201
- eac_ruby_utils (~> 0.110, >= 0.110.1)
201
+ eac_ruby_utils (~> 0.111)
202
202
  eac_templates (~> 0.3, >= 0.3.2)
203
203
  filesize (~> 0.2)
204
204
  htmlbeautifier (~> 1.4, >= 1.4.2)
@@ -253,7 +253,7 @@ PATH
253
253
  PATH
254
254
  remote: sub/eac_ruby_utils
255
255
  specs:
256
- eac_ruby_utils (0.110.1)
256
+ eac_ruby_utils (0.111.0)
257
257
  activesupport (>= 4, < 7)
258
258
  addressable (~> 2.8, >= 2.8.1)
259
259
  bundler
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.54.0'
4
+ VERSION = '0.55.0'
5
5
  end
data/sub/avm/avm.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency 'eac_docker', '~> 0.5'
19
19
  s.add_dependency 'eac_fs', '~> 0.16'
20
20
  s.add_dependency 'eac_git', '~> 0.14'
21
- s.add_dependency 'eac_ruby_utils', '~> 0.110', '>= 0.110.1'
21
+ s.add_dependency 'eac_ruby_utils', '~> 0.111'
22
22
  s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
23
23
  s.add_dependency 'filesize', '~> 0.2'
24
24
  s.add_dependency 'htmlbeautifier', '~> 1.4', '>= 1.4.2'
@@ -14,7 +14,7 @@ module Avm
14
14
  end
15
15
 
16
16
  def class_name
17
- file_format.file_resource_name(path)
17
+ file_format.file_resource_name(relative_path)
18
18
  end
19
19
 
20
20
  def commit_message
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Sources
7
+ module AutoCommit
8
+ class ForFile
9
+ common_constructor :source, :path, :rules
10
+
11
+ delegate :run, to: :scm_auto_commit
12
+
13
+ # @return [Pathname]
14
+ def path_for_auto_commit
15
+ path.relative_path_from(source_for_auto_commit.path)
16
+ end
17
+
18
+ # @return [Avm::Scms::AutoCommit::ForFile]
19
+ def scm_auto_commit
20
+ ::Avm::Scms::AutoCommit::ForFile.new(source_for_auto_commit.scm, path_for_auto_commit,
21
+ rules)
22
+ end
23
+
24
+ # @return [Avm::Sources::Base]
25
+ def source_for_auto_commit
26
+ source.sub_for_path(path) || source
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Sources
7
+ module AutoCommit
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -12,6 +12,11 @@ module Avm
12
12
  SUBS_EXCLUDE_PATHS_DEFAULT = [].freeze
13
13
  SUBS_INCLUDE_PATHS_DEFAULT = ['sub/*'].freeze
14
14
 
15
+ # @return [Avm::Sources::Base, nil]
16
+ def sub_for_path(path)
17
+ subs.lazy.map { |sub| path.expand_path.child_of?(sub.path) ? sub : nil }.find(&:present?)
18
+ end
19
+
15
20
  # @return [Enumerable<Avm::Sources::Base>]
16
21
  def subs
17
22
  subs_paths_to_search
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.61.0'
4
+ VERSION = '0.62.0'
5
5
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
16
16
 
17
17
  s.add_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.4'
18
- s.add_dependency 'avm', '~> 0.61'
18
+ s.add_dependency 'avm', '~> 0.62'
19
19
  s.add_dependency 'avm-eac_ruby_base1', '~> 0.29'
20
20
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.4'
21
21
  s.add_dependency 'avm-files', '~> 0.6'
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'eac_cli/core_ext'
4
4
  require 'avm/file_formats/search_formatter'
5
- require 'avm/scms/auto_commit/for_file'
6
5
  require 'avm/scms/auto_commit/rules'
6
+ require 'avm/sources/auto_commit/for_file'
7
7
 
8
8
  module Avm
9
9
  module Tools
@@ -21,7 +21,7 @@ module Avm
21
21
  def run
22
22
  format_files
23
23
  files.each do |file|
24
- ::Avm::Scms::AutoCommit::ForFile.new(runner_context.call(:source).scm, file, rules)
24
+ ::Avm::Sources::AutoCommit::ForFile.new(runner_context.call(:source), file, rules)
25
25
  .run
26
26
  end
27
27
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.144.0'
5
+ VERSION = '0.145.0'
6
6
  end
7
7
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pathname'
4
+
5
+ class Pathname
6
+ # Indicate if +self+ is child of +parent_path+.
7
+ #
8
+ # @return [Boolean]
9
+ def child_of?(parent_path)
10
+ self_parts = expand_path.each_filename.to_a
11
+ parent_parts = parent_path.expand_path.each_filename.to_a
12
+ return false if self_parts == parent_parts
13
+
14
+ parent_parts.zip(self_parts).all? { |x, y| x == y }
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.110.1'
4
+ VERSION = '0.111.0'
5
5
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/patches/pathname/child_of'
4
+
5
+ RSpec.describe ::Pathname do
6
+ describe 'child_of?' do
7
+ [
8
+ ['/foo/bar/baz', '/foo/bar', true],
9
+ ['/foo/../foo/bar/../bar/baz', '/foo/bar', true],
10
+ ['/foo/bar/baz', '/foo/../foo/bar/../bar', true],
11
+ ['/foo/bar/baz', '/boink', false],
12
+ ['/foo/bar/../not_bar/baz', '/foo/bar', false],
13
+ ['/foo/bar/../bar_not/baz', '/foo/bar', false],
14
+ ['/foo', '/foo/bar', false],
15
+ ['/foo', '/bar', false],
16
+ ['/foo', '/foo', false]
17
+ ].each do |test_values|
18
+ child_path, parent_path, expected_value = test_values
19
+ context "when child=\"#{child_path}\" and parent=\"#{parent_path}\"" do
20
+ it do
21
+ expect(Pathname(child_path).child_of?(Pathname(parent_path))).to be(expected_value)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.54.0
4
+ version: 0.55.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2023-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.61'
19
+ version: '0.62'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.61'
26
+ version: '0.62'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: avm-eac_asciidoctor_base0
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -236,34 +236,28 @@ dependencies:
236
236
  requirements:
237
237
  - - "~>"
238
238
  - !ruby/object:Gem::Version
239
- version: '0.144'
239
+ version: '0.145'
240
240
  type: :runtime
241
241
  prerelease: false
242
242
  version_requirements: !ruby/object:Gem::Requirement
243
243
  requirements:
244
244
  - - "~>"
245
245
  - !ruby/object:Gem::Version
246
- version: '0.144'
246
+ version: '0.145'
247
247
  - !ruby/object:Gem::Dependency
248
248
  name: eac_ruby_utils
249
249
  requirement: !ruby/object:Gem::Requirement
250
250
  requirements:
251
251
  - - "~>"
252
252
  - !ruby/object:Gem::Version
253
- version: '0.110'
254
- - - ">="
255
- - !ruby/object:Gem::Version
256
- version: 0.110.1
253
+ version: '0.111'
257
254
  type: :runtime
258
255
  prerelease: false
259
256
  version_requirements: !ruby/object:Gem::Requirement
260
257
  requirements:
261
258
  - - "~>"
262
259
  - !ruby/object:Gem::Version
263
- version: '0.110'
264
- - - ">="
265
- - !ruby/object:Gem::Version
266
- version: 0.110.1
260
+ version: '0.111'
267
261
  - !ruby/object:Gem::Dependency
268
262
  name: eac_ruby_gem_support
269
263
  requirement: !ruby/object:Gem::Requirement
@@ -1176,6 +1170,8 @@ files:
1176
1170
  - sub/avm/lib/avm/source_generators/option_list.rb
1177
1171
  - sub/avm/lib/avm/source_generators/runner.rb
1178
1172
  - sub/avm/lib/avm/sources.rb
1173
+ - sub/avm/lib/avm/sources/auto_commit.rb
1174
+ - sub/avm/lib/avm/sources/auto_commit/for_file.rb
1179
1175
  - sub/avm/lib/avm/sources/base.rb
1180
1176
  - sub/avm/lib/avm/sources/base/application.rb
1181
1177
  - sub/avm/lib/avm/sources/base/configuration.rb
@@ -1761,6 +1757,7 @@ files:
1761
1757
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/assert_parent.rb
1762
1758
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_noext.rb
1763
1759
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
1760
+ - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/child_of.rb
1764
1761
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/if_exist.rb
1765
1762
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/mkpath_s.rb
1766
1763
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
@@ -1848,6 +1845,7 @@ files:
1848
1845
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/assert_parent_spec.rb
1849
1846
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
1850
1847
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_sub_spec.rb
1848
+ - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/child_of_spec.rb
1851
1849
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb
1852
1850
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb
1853
1851
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb