avm-eac_ruby_base1 0.32.1 → 0.33.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: 789c1286e939fea7eaec5d9840fdcdd08e7fb95b1878a07a4778e34cad1658b0
4
- data.tar.gz: 15331da0f7215694e7641414f0f2ce371f1b6c7abc029fa8782f4c4b3e9373fa
3
+ metadata.gz: aafae2abe601eab8b87dea03c99d77a3145131465d0f1bd48a7c783f72dd446b
4
+ data.tar.gz: c62ec5042d1288ab454c0c7c503eb54d76d0af7eee1d8cfd488188142326a992
5
5
  SHA512:
6
- metadata.gz: 22103d338d843d4fc4de1281d74b09b591e00d218c19d076a01bd1ca9116aec6a226f86aab95302d85fa5d841e6d8729236599a039a36aa2e1efac0675ea61bd
7
- data.tar.gz: 247d13c01bb3bb1afe1502465b57aa34897d28ff78391fa4d34991299b689e4aeac51f3493e9b64e5d40329d6585a267e1c71d0ed746c8a43dbc026bd298b471
6
+ metadata.gz: 635538a44e80c47ff7bca00bc3164c87efeaca31195d23313f915331f5e31032213e26d77bff7931817c2d559b51e440450539423673d669c90976043b36ae2c
7
+ data.tar.gz: 6ab7bdc0abb322120ccf71fe1a96d6a7e53b52d54d6c6e04eddd80a4336575a1c337fe9c727019a740d0df11fb0a7780d6adf912a56ad0ada8119bda50520aaf
@@ -104,8 +104,8 @@ module Avm
104
104
  end
105
105
  end
106
106
 
107
- def on_clean_ruby
108
- on_clear_envvars('BUNDLE', 'RUBY') { yield }
107
+ def on_clean_ruby(&block)
108
+ on_clear_envvars('BUNDLE', 'RUBY', &block)
109
109
  end
110
110
 
111
111
  def on_clear_envvars(*start_with_vars)
@@ -59,7 +59,7 @@ module Avm
59
59
 
60
60
  def version_unpublished_check_result
61
61
  ::Avm::Launcher::Publish::CheckResult.pending("#{gem_spec.full_name} not found " \
62
- 'in RubyGems')
62
+ 'in RubyGems')
63
63
  end
64
64
 
65
65
  def source_uncached
@@ -33,7 +33,8 @@ module Avm
33
33
  def find_gem(path)
34
34
  r = ::Avm::EacRubyBase1::Sources::Base.new(path)
35
35
  return r if r.gemfile_path.exist?
36
- return find_gem(path.dirname) unless path.root?
36
+
37
+ find_gem(path.dirname) unless path.root?
37
38
  end
38
39
  end
39
40
  end
@@ -25,7 +25,7 @@ module Avm
25
25
 
26
26
  # @return [Array<Avm::EacRubyBase1::Bundler::Gemfile::Dependency>]
27
27
  def dependencies
28
- lines.lazy.map { |line| DEPENDENCY_LINE_PARSER.parse(line) }.reject(&:blank?)
28
+ lines.lazy.map { |line| DEPENDENCY_LINE_PARSER.parse(line) }.compact_blank
29
29
  .map { |gem_name| dependency(gem_name) }.to_a
30
30
  end
31
31
 
@@ -10,11 +10,11 @@ module Avm
10
10
  module Options
11
11
  common_concern
12
12
 
13
- GEMFILE_LOCK_OPTION = 'gemfile-lock'.to_sym
13
+ GEMFILE_LOCK_OPTION = :'gemfile-lock'
14
14
 
15
15
  OPTIONS = {
16
- 'eac-ruby-utils-version'.to_sym => 'Version for "eac_ruby_utils" gem.',
17
- 'eac-ruby-gem-support-version'.to_sym => 'Version for "eac_ruby_gem_support" gem.',
16
+ :'eac-ruby-utils-version' => 'Version for "eac_ruby_utils" gem.',
17
+ :'eac-ruby-gem-support-version' => 'Version for "eac_ruby_gem_support" gem.',
18
18
  GEMFILE_LOCK_OPTION => 'Run "bundle install" at the end'
19
19
  }.freeze
20
20
 
@@ -44,7 +44,7 @@ module Avm
44
44
 
45
45
  def root_module_close
46
46
  root_module_components.count.times.map do |index|
47
- (IDENT * index) + 'end'
47
+ "#{IDENT * index}end"
48
48
  end.reverse.join("\n")
49
49
  end
50
50
 
@@ -54,7 +54,7 @@ module Avm
54
54
 
55
55
  def root_module_open
56
56
  root_module_components.each_with_index.map do |component, index|
57
- (IDENT * index) + 'module ' + component
57
+ "#{IDENT * index}module #{component}"
58
58
  end.join("\n")
59
59
  end
60
60
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'addressable'
3
4
  require 'avm/eac_generic_base0/sources/base'
4
5
  require 'avm/eac_ruby_base1/sources/base/bundle_command'
5
6
  require 'avm/eac_ruby_base1/sources/bundle_update'
@@ -12,6 +13,9 @@ module Avm
12
13
  module Bundler
13
14
  CONFIGURED_GEMFILE_PATH_ENTRY_KEY = 'ruby.gemfile_path'
14
15
  DEFAULT_GEMFILE_PATH = 'Gemfile'
16
+ GEMFILE_SOURCE_PARSER = /^\s*source\s+['"]([^'"]+)['"]$/.to_parser do |m|
17
+ ::Addressable::URI.parse(m[1])
18
+ end
15
19
 
16
20
  # @return [Avm::EacRubyBase1::Sources::Base::BundleCommand]
17
21
  def bundle(*args)
@@ -52,6 +56,11 @@ module Avm
52
56
  def gemfile_path
53
57
  path.join(configured_gemfile_path || default_gemfile_path)
54
58
  end
59
+
60
+ # @return [Addressable::URI]
61
+ def gemfile_source
62
+ GEMFILE_SOURCE_PARSER.parse!(gemfile_path.read)
63
+ end
55
64
  end
56
65
  end
57
66
  end
@@ -45,7 +45,7 @@ module Avm
45
45
  parts.each_with_index do |_part, index|
46
46
  tabc = (parts.count - 1 - index)
47
47
  tabc -= 1 if index.zero?
48
- s += (' ' * tabc) + "end\n"
48
+ s += "#{' ' * tabc}end\n"
49
49
  end
50
50
  s
51
51
  end
@@ -52,10 +52,9 @@ module Avm
52
52
  end
53
53
 
54
54
  def sibling_gemfile_local_line(sibling)
55
- ["gem '#{sibling.gem_name}'",
56
- "path: ::File.expand_path('" +
57
- sibling.path.relative_path_from(the_source.path).to_path +
58
- "', __dir__)",
55
+ ["gem '#{sibling.gem_name}'", # rubocop:disable Style/StringConcatenation
56
+ ["path: ::File.expand_path('",
57
+ sibling.path.relative_path_from(the_source.path).to_path, "', __dir__)"].join,
59
58
  'require: false'].join(', ') + "\n"
60
59
  end
61
60
 
@@ -54,7 +54,7 @@ module Avm
54
54
  end
55
55
 
56
56
  def print_requirement(req)
57
- infov ' ' + requirement_title(req), requirement_value(req)
57
+ infov " #{requirement_title(req)}", requirement_value(req)
58
58
  end
59
59
 
60
60
  def requirement_stack(req)
@@ -18,7 +18,7 @@ module Avm
18
18
 
19
19
  unless can_remove_gemfile_lock?
20
20
  raise '"bundle install" failed and the Gemfile.lock is part of gem' \
21
- '(Should be changed by developer)'
21
+ '(Should be changed by developer)'
22
22
  end
23
23
 
24
24
  prepare_with_removable_gemfile_lock
@@ -42,7 +42,7 @@ module Avm
42
42
  end
43
43
 
44
44
  def can_remove_gemfile_lock?
45
- !files.include?(gemfile_lock_path.relative_path_from(root))
45
+ files.exclude?(gemfile_lock_path.relative_path_from(root))
46
46
  end
47
47
  end
48
48
  end
@@ -29,7 +29,7 @@ module Avm
29
29
  def format_gemspec
30
30
  source.rubocop_command.ignore_parent_exclusion(true).autocorrect(true)
31
31
  .file(source.gemspec_path)
32
- .execute!(exit_outputs: RUBOCOP_OK_CODES.map { |k| [k, nil] }.to_h)
32
+ .execute!(exit_outputs: RUBOCOP_OK_CODES.index_with { |_k| nil })
33
33
  end
34
34
 
35
35
  # @return [Array<String>]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.32.1'
5
+ VERSION = '0.33.0'
6
6
  end
7
7
  end
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.summary = 'Put here de description.'
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
+ s.required_ruby_version = '>= 2.7'
14
15
 
15
16
  s.add_dependency 'eac_ruby_utils', %%EAC_RUBY_UTILS_VERSION%%
16
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-eac_ruby_base1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.1
4
+ version: 0.33.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-10-24 00:00:00.000000000 Z
11
+ date: 2023-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.80'
33
+ version: '0.81'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.80'
40
+ version: '0.81'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: avm-eac_generic_base0
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -124,14 +124,14 @@ dependencies:
124
124
  requirements:
125
125
  - - "~>"
126
126
  - !ruby/object:Gem::Version
127
- version: 0.6.0
127
+ version: '0.9'
128
128
  type: :development
129
129
  prerelease: false
130
130
  version_requirements: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - "~>"
133
133
  - !ruby/object:Gem::Version
134
- version: 0.6.0
134
+ version: '0.9'
135
135
  description:
136
136
  email:
137
137
  executables: []
@@ -238,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
238
  requirements:
239
239
  - - ">="
240
240
  - !ruby/object:Gem::Version
241
- version: '0'
241
+ version: '2.7'
242
242
  required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  requirements:
244
244
  - - ">="