eac_tools 0.54.0 → 0.55.1

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: 4daef05ed4a65ea9e4d8ec9922eb47d1419ba99d14ec280791f1b387c5bf68df
4
+ data.tar.gz: 69d71f09d7b2d97523f653f463f4c72acaf2625727ccded7aed36223a0e83637
5
5
  SHA512:
6
- metadata.gz: 073ba61cf82fc77a0676ea984e82840d661cd70ccac1faa1af088f1758ecfe9f895aefca5603ed107fe109d9aa3fbf2c0606b954e321994af7cc8d977169e8fb
7
- data.tar.gz: 78cfcc7f331d552ec6e541d752d4d21e87c8eee70083f0257118564987d0dec0eb83849f3c5666439a1223baa2d012f85b2ace8fb751d4da32b8a80734c23e45
6
+ metadata.gz: f1906620490db991897f7a4e7bdff752587d8935884ef5713526999119d201eb82d1a5e6011192133cd9e1e5456f3ecfb22b554ebd72e17354c6a99d63233e00
7
+ data.tar.gz: 6c5efd979d44070f7fd30afe7135b5e99044e0b94fafbdf017979549dda6b5cadfb9a51615e2c5ca3956475dfe3f316bcde05a75a25e81b5a8346e862b167259
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.1)
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, >= 0.145.1)
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.1)
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)
@@ -183,7 +183,7 @@ PATH
183
183
  clipboard (~> 1.3, >= 1.3.6)
184
184
  curb (~> 0.9, >= 0.9.11)
185
185
  eac_git (~> 0.14)
186
- eac_ruby_base0 (~> 0.17, >= 0.17.1)
186
+ eac_ruby_base0 (~> 0.17, >= 0.17.2)
187
187
  eac_templates (~> 0.3, >= 0.3.2)
188
188
  git (~> 1.13, >= 1.13.1)
189
189
  ruby-progressbar (~> 1.11)
@@ -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)
@@ -244,16 +244,16 @@ PATH
244
244
  PATH
245
245
  remote: sub/eac_ruby_base0
246
246
  specs:
247
- eac_ruby_base0 (0.17.1)
248
- avm-eac_ruby_base1 (~> 0.27, >= 0.27.1)
247
+ eac_ruby_base0 (0.17.2)
248
+ avm-eac_ruby_base1 (~> 0.29)
249
249
  eac_cli (~> 0.30)
250
- eac_fs (~> 0.15)
251
- eac_ruby_utils (~> 0.107, >= 0.107.1)
250
+ eac_fs (~> 0.16)
251
+ eac_ruby_utils (~> 0.111)
252
252
 
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.1'
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'
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency 'clipboard', '~> 1.3', '>= 1.3.6'
24
24
  s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
25
25
  s.add_dependency 'eac_git', '~> 0.14'
26
- s.add_dependency 'eac_ruby_base0', '~> 0.17', '>= 0.17.1'
26
+ s.add_dependency 'eac_ruby_base0', '~> 0.17', '>= 0.17.2'
27
27
  s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
28
28
  s.add_dependency 'git', '~> 1.13', '>= 1.13.1'
29
29
  s.add_dependency 'ruby-progressbar', '~> 1.11'
@@ -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.1'
6
6
  end
7
7
  end
@@ -12,10 +12,10 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.27', '>= 0.27.1'
15
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.29'
16
16
  s.add_dependency 'eac_cli', '~> 0.30'
17
- s.add_dependency 'eac_fs', '~> 0.15'
18
- s.add_dependency 'eac_ruby_utils', '~> 0.107', '>= 0.107.1'
17
+ s.add_dependency 'eac_fs', '~> 0.16'
18
+ s.add_dependency 'eac_ruby_utils', '~> 0.111'
19
19
 
20
20
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
21
21
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+ require 'eac_cli/speaker'
5
+ require 'eac_cli/speaker/input_blocked'
6
+ require 'eac_config/node'
7
+ require 'eac_fs/contexts'
8
+ require 'eac_ruby_utils/speaker'
9
+
10
+ module EacRubyBase0
11
+ module Runner
12
+ module Prepend
13
+ def run
14
+ if parsed.version?
15
+ show_version
16
+ else
17
+ run_with_subcommand
18
+ end
19
+ end
20
+
21
+ def run_run
22
+ on_context { super }
23
+ end
24
+ end
25
+ end
26
+ end
@@ -9,10 +9,12 @@ require 'eac_ruby_utils/speaker'
9
9
 
10
10
  module EacRubyBase0
11
11
  module Runner
12
+ require_sub __FILE__
12
13
  enable_speaker
13
14
  common_concern do
14
15
  include ::EacCli::RunnerWith::Help
15
16
  include ::EacCli::RunnerWith::Subcommands
17
+ prepend ::EacRubyBase0::Runner::Prepend
16
18
  runner_definition do
17
19
  bool_opt '-q', '--quiet', 'Quiet mode.'
18
20
  bool_opt '-I', '--no-input', 'Fail if a input is requested.'
@@ -23,16 +25,6 @@ module EacRubyBase0
23
25
  end
24
26
  end
25
27
 
26
- def run
27
- on_context do
28
- if parsed.version?
29
- show_version
30
- else
31
- run_with_subcommand
32
- end
33
- end
34
- end
35
-
36
28
  def application_version
37
29
  runner_context.call(:application).version.to_s
38
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyBase0
4
- VERSION = '0.17.1'
4
+ VERSION = '0.17.2'
5
5
  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.1
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-21 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,34 @@ dependencies:
236
236
  requirements:
237
237
  - - "~>"
238
238
  - !ruby/object:Gem::Version
239
- version: '0.144'
239
+ version: '0.145'
240
+ - - ">="
241
+ - !ruby/object:Gem::Version
242
+ version: 0.145.1
240
243
  type: :runtime
241
244
  prerelease: false
242
245
  version_requirements: !ruby/object:Gem::Requirement
243
246
  requirements:
244
247
  - - "~>"
245
248
  - !ruby/object:Gem::Version
246
- version: '0.144'
249
+ version: '0.145'
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ version: 0.145.1
247
253
  - !ruby/object:Gem::Dependency
248
254
  name: eac_ruby_utils
249
255
  requirement: !ruby/object:Gem::Requirement
250
256
  requirements:
251
257
  - - "~>"
252
258
  - !ruby/object:Gem::Version
253
- version: '0.110'
254
- - - ">="
255
- - !ruby/object:Gem::Version
256
- version: 0.110.1
259
+ version: '0.111'
257
260
  type: :runtime
258
261
  prerelease: false
259
262
  version_requirements: !ruby/object:Gem::Requirement
260
263
  requirements:
261
264
  - - "~>"
262
265
  - !ruby/object:Gem::Version
263
- version: '0.110'
264
- - - ">="
265
- - !ruby/object:Gem::Version
266
- version: 0.110.1
266
+ version: '0.111'
267
267
  - !ruby/object:Gem::Dependency
268
268
  name: eac_ruby_gem_support
269
269
  requirement: !ruby/object:Gem::Requirement
@@ -1176,6 +1176,8 @@ files:
1176
1176
  - sub/avm/lib/avm/source_generators/option_list.rb
1177
1177
  - sub/avm/lib/avm/source_generators/runner.rb
1178
1178
  - sub/avm/lib/avm/sources.rb
1179
+ - sub/avm/lib/avm/sources/auto_commit.rb
1180
+ - sub/avm/lib/avm/sources/auto_commit/for_file.rb
1179
1181
  - sub/avm/lib/avm/sources/base.rb
1180
1182
  - sub/avm/lib/avm/sources/base/application.rb
1181
1183
  - sub/avm/lib/avm/sources/base/configuration.rb
@@ -1614,6 +1616,7 @@ files:
1614
1616
  - sub/eac_ruby_base0/lib/eac_ruby_base0/rspec.rb
1615
1617
  - sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb
1616
1618
  - sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb
1619
+ - sub/eac_ruby_base0/lib/eac_ruby_base0/runner/prepend.rb
1617
1620
  - sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb
1618
1621
  - sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb
1619
1622
  - sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb
@@ -1761,6 +1764,7 @@ files:
1761
1764
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/assert_parent.rb
1762
1765
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_noext.rb
1763
1766
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
1767
+ - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/child_of.rb
1764
1768
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/if_exist.rb
1765
1769
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/mkpath_s.rb
1766
1770
  - sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
@@ -1848,6 +1852,7 @@ files:
1848
1852
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/assert_parent_spec.rb
1849
1853
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
1850
1854
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_sub_spec.rb
1855
+ - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/child_of_spec.rb
1851
1856
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb
1852
1857
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb
1853
1858
  - sub/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb