avm-eac_ruby_base1 0.15.0 → 0.16.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: d998e1a738a8b6ff66e1c1b386201de3b9a23d790e7c5d9178eced111bfb997c
4
- data.tar.gz: 2fcb8e8d90e99639732b645751803a8c97c03d8485e67b497d4c975cf4462ae5
3
+ metadata.gz: 73cf66a72fcc24c0128fc2d9706c58ec009ecdd963b75efe0fe34000a2d4f4b3
4
+ data.tar.gz: 5a28a9b29acbf660057f7c181531cbbba8432c86294fce4c67f4d1ac136d83ce
5
5
  SHA512:
6
- metadata.gz: 61b70292057fcc31581ac7ab06d648fb66c1599c4fbdd32be2d64afbdbf2c4fbeb380c7ffb8f33993b6fe5810e2faa183444d49697cc1334e0852c4be5c55d2c
7
- data.tar.gz: 90e49b0129671bb8a660f7264edab2d5674f22f8259075a7b47b1b3ede650200b47693079db33d477669544fd340e092d419ae8335864e94e9448791c44c3d65
6
+ metadata.gz: c3f075d27166477bab4968a99af4af651eb3cb3445b5a549e8956f7467dbcf2ed49abbde04dc493bd582d4f3ddd51b61d22f6243a56a88de3763aca8aa228969
7
+ data.tar.gz: 026c88f853df55a243cdb78baeb43328c59472a8f2570dda7f21bf452290be0f2b8f4165fed5024e3ed9328a971d73b3d8f088ebc9f8519395aa8fe8afee2788
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Sources
8
+ module Runners
9
+ class Bundler
10
+ class GemfileLocal
11
+ runner_with :help do
12
+ bool_opt '-w', '--write', 'Write the Gemfile.local file.'
13
+ end
14
+
15
+ def run
16
+ start_banner
17
+ run_bundle
18
+ siblings_banner
19
+ write_gemfile_local
20
+ end
21
+
22
+ private
23
+
24
+ def gemfile_local_path
25
+ the_source.path.join('Gemfile.local')
26
+ end
27
+
28
+ def gemfile_local_content
29
+ siblings.map { |s| sibling_gemfile_local_line(s) }.join
30
+ end
31
+
32
+ def run_bundle
33
+ the_source.bundle.execute!
34
+ rescue ::RuntimeError
35
+ the_source.bundle('update').execute!
36
+ end
37
+
38
+ def sibling_gemfile_local_line(sibling)
39
+ ["gem '#{sibling.gem_name}'",
40
+ "path: ::File.expand_path('" +
41
+ sibling.path.relative_path_from(the_source.path).to_path +
42
+ "', __dir__)"].join(', ') + "\n"
43
+ end
44
+
45
+ def start_banner
46
+ runner_context.call(:source_banner)
47
+ infov 'Parent', the_source.parent
48
+ end
49
+
50
+ def siblings_banner
51
+ infov 'Siblings', siblings.count
52
+ siblings.each do |sibling|
53
+ infov ' * ', sibling.relative_path
54
+ end
55
+ end
56
+
57
+ def write_gemfile_local
58
+ return unless parsed.write?
59
+
60
+ infom "Writing #{gemfile_local_path}..."
61
+ gemfile_local_path.write(gemfile_local_content)
62
+ end
63
+
64
+ def siblings_uncached
65
+ the_source.parent.if_present([]) do |v|
66
+ v.subs.select { |sub| dependency_sub?(sub) }
67
+ end
68
+ end
69
+
70
+ def the_source
71
+ runner_context.call(:source)
72
+ end
73
+
74
+ def dependency_sub?(sub)
75
+ sub.is_a?(::Avm::EacRubyBase1::Sources::Base) &&
76
+ sub.gem_name != the_source.gem_name &&
77
+ the_source.gemfile_lock_gem_version(sub.gem_name).present?
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.15.0'
5
+ VERSION = '0.16.0'
6
6
  end
7
7
  end
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.15.0
4
+ version: 0.16.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: 2022-08-05 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -131,6 +131,7 @@ files:
131
131
  - lib/avm/eac_ruby_base1/sources/base/version_bump.rb
132
132
  - lib/avm/eac_ruby_base1/sources/runners.rb
133
133
  - lib/avm/eac_ruby_base1/sources/runners/bundler.rb
134
+ - lib/avm/eac_ruby_base1/sources/runners/bundler/gemfile_local.rb
134
135
  - lib/avm/eac_ruby_base1/sources/runners/bundler/incompatible.rb
135
136
  - lib/avm/eac_ruby_base1/sources/tests.rb
136
137
  - lib/avm/eac_ruby_base1/sources/tests/base.rb