rdm 0.4.20 → 0.5.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 +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +12 -15
- data/README.md +11 -4
- data/bin/rdm +5 -5
- data/lib/rdm/cli/compile_package.rb +2 -2
- data/lib/rdm/handlers/template_handler.rb +1 -1
- data/lib/rdm/packages/compiler_service.rb +2 -2
- data/lib/rdm/source_parser.rb +1 -1
- data/lib/rdm/spec_runner/spec_filename_matcher.rb +1 -1
- data/lib/rdm/templates/template_detector.rb +1 -1
- data/lib/rdm/version.rb +1 -1
- data/rdm.gemspec +1 -1
- data/spec/rdm/config_manager_spec.rb +10 -10
- data/spec/rdm/package/compiler_service_spec.rb +6 -6
- data/spec/rdm/spec_runner/spec_filename_matcher_spec.rb +2 -2
- data/spec/rdm/spec_runner_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e2a496f156083649520c2b31ec5d3b879dd7b82f5d9a0c0d135600c60f2ddfe5
|
|
4
|
+
data.tar.gz: 1c7f46a201ef145fc4a121a5ab6819d0adf8c80ab54efe6817c9b1e010ce62f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 727b35ff518220400fa69d43c95c3bb8fd9f6409d560d426479cab6b7ad4337749cd0c21a249b307e4e89d4660cfb8e5a6c3a6ac1bd6a1654887850a3b594a9a
|
|
7
|
+
data.tar.gz: 49025fb2d65a5e7e131761c6d1814b7568df3b32e34d040faac1205c440e127296bd4dd92cbae5db4d6eaecabba4de1f0b1bfbda9f2f20e90ce41790ce6856cd
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.1.2
|
data/Gemfile.lock
CHANGED
|
@@ -3,17 +3,16 @@ PATH
|
|
|
3
3
|
specs:
|
|
4
4
|
rdm (0.4.20)
|
|
5
5
|
activesupport
|
|
6
|
-
commander (~> 4.
|
|
6
|
+
commander (~> 4.6)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
activesupport (
|
|
11
|
+
activesupport (7.0.4.3)
|
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
13
|
-
i18n (>=
|
|
14
|
-
minitest (
|
|
15
|
-
tzinfo (~>
|
|
16
|
-
zeitwerk (~> 2.2, >= 2.2.2)
|
|
13
|
+
i18n (>= 1.6, < 2)
|
|
14
|
+
minitest (>= 5.1)
|
|
15
|
+
tzinfo (~> 2.0)
|
|
17
16
|
ast (2.4.1)
|
|
18
17
|
byebug (9.0.6)
|
|
19
18
|
codecov (0.2.5)
|
|
@@ -21,16 +20,16 @@ GEM
|
|
|
21
20
|
json
|
|
22
21
|
simplecov
|
|
23
22
|
colorize (0.8.1)
|
|
24
|
-
commander (4.
|
|
23
|
+
commander (4.6.0)
|
|
25
24
|
highline (~> 2.0.0)
|
|
26
|
-
concurrent-ruby (1.
|
|
25
|
+
concurrent-ruby (1.2.2)
|
|
27
26
|
diff-lcs (1.3)
|
|
28
27
|
docile (1.3.2)
|
|
29
28
|
highline (2.0.3)
|
|
30
|
-
i18n (1.
|
|
29
|
+
i18n (1.13.0)
|
|
31
30
|
concurrent-ruby (~> 1.0)
|
|
32
31
|
json (2.3.1)
|
|
33
|
-
minitest (5.
|
|
32
|
+
minitest (5.18.0)
|
|
34
33
|
parallel (1.19.2)
|
|
35
34
|
parser (2.7.2.0)
|
|
36
35
|
ast (~> 2.4.1)
|
|
@@ -68,11 +67,9 @@ GEM
|
|
|
68
67
|
json (>= 1.8, < 3)
|
|
69
68
|
simplecov-html (~> 0.10.0)
|
|
70
69
|
simplecov-html (0.10.2)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
thread_safe (~> 0.1)
|
|
70
|
+
tzinfo (2.0.6)
|
|
71
|
+
concurrent-ruby (~> 1.0)
|
|
74
72
|
unicode-display_width (1.7.0)
|
|
75
|
-
zeitwerk (2.4.0)
|
|
76
73
|
|
|
77
74
|
PLATFORMS
|
|
78
75
|
ruby
|
|
@@ -87,4 +84,4 @@ DEPENDENCIES
|
|
|
87
84
|
rubocop (~> 0.93)
|
|
88
85
|
|
|
89
86
|
BUNDLED WITH
|
|
90
|
-
2.
|
|
87
|
+
2.4.13
|
data/README.md
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
# Rdm (Ruby
|
|
2
|
-
[](https://travis-ci.org/ddd-ruby/rdm)
|
|
1
|
+
# Rdm (Ruby Dependency Manager)
|
|
3
2
|
[](https://codeclimate.com/github/ddd-ruby/rdm)
|
|
4
|
-
[](https://codecov.io/gh/ddd-ruby/rdm)
|
|
5
|
-
[](https://gemnasium.com/ddd-ruby/rdm)
|
|
6
3
|
|
|
7
4
|
|
|
8
5
|
Ruby dependency manager, helps managing local package dependencies.
|
|
9
6
|
See sample application in "example" folder.
|
|
10
7
|
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# For Ruby >= 3.0
|
|
13
|
+
gem install rdm
|
|
14
|
+
|
|
15
|
+
# For Ruby < 3.0
|
|
16
|
+
gem install rdm -v 0.4.20
|
|
17
|
+
```
|
|
11
18
|
|
|
12
19
|
## Setup
|
|
13
20
|
You can initialize a project with `rdm`:
|
data/bin/rdm
CHANGED
|
@@ -39,7 +39,7 @@ class RdmCliRunner
|
|
|
39
39
|
options_hash.delete(:trace)
|
|
40
40
|
|
|
41
41
|
options_with_defaults = defaults.merge!(options_hash)
|
|
42
|
-
Rdm::CLI::Init.run(options_with_defaults)
|
|
42
|
+
Rdm::CLI::Init.run(**options_with_defaults)
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -68,7 +68,7 @@ class RdmCliRunner
|
|
|
68
68
|
options_hash.delete(:trace)
|
|
69
69
|
|
|
70
70
|
options_with_defaults = defaults.merge!(options_hash)
|
|
71
|
-
Rdm::CLI::GenPackage.run(options_with_defaults)
|
|
71
|
+
Rdm::CLI::GenPackage.run(**options_with_defaults)
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
|
|
@@ -79,7 +79,7 @@ class RdmCliRunner
|
|
|
79
79
|
c.example 'show list of modified packages from master',
|
|
80
80
|
'rdm git.diff master'
|
|
81
81
|
|
|
82
|
-
c.action do |args,
|
|
82
|
+
c.action do |args, _|
|
|
83
83
|
revision = (args.first || "HEAD")
|
|
84
84
|
options = {
|
|
85
85
|
path: File.expand_path(`pwd`.chomp),
|
|
@@ -138,7 +138,7 @@ class RdmCliRunner
|
|
|
138
138
|
c.summary = '> ' + c.description
|
|
139
139
|
c.example 'show dependencies for `commands` package', 'rdm gen.deps commands'
|
|
140
140
|
|
|
141
|
-
c.action do |args,
|
|
141
|
+
c.action do |args, _|
|
|
142
142
|
package_name = args.first || ""
|
|
143
143
|
|
|
144
144
|
Rdm::CLI::DependenciesController.run(
|
|
@@ -217,7 +217,7 @@ class RdmCliRunner
|
|
|
217
217
|
c.example 'run tests for packages modified from specified branch',
|
|
218
218
|
'rdm rspec.diff_run master'
|
|
219
219
|
|
|
220
|
-
c.action do |args,
|
|
220
|
+
c.action do |args, _|
|
|
221
221
|
revision = args[0]
|
|
222
222
|
|
|
223
223
|
ENV['RUBY_ENV'] = 'test'
|
|
@@ -5,7 +5,7 @@ module Rdm
|
|
|
5
5
|
|
|
6
6
|
class << self
|
|
7
7
|
def compile(opts = {})
|
|
8
|
-
Rdm::CLI::CompilePackage.new(opts).compile
|
|
8
|
+
Rdm::CLI::CompilePackage.new(**opts).compile
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
|
|
@@ -32,7 +32,7 @@ module Rdm
|
|
|
32
32
|
return
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
if Dir.
|
|
35
|
+
if Dir.exist?(@compile_path)
|
|
36
36
|
puts "Destination directory exists. Overwrite it? (y/n)"
|
|
37
37
|
return unless @overwrite_directory.call
|
|
38
38
|
end
|
|
@@ -80,7 +80,7 @@ module Rdm
|
|
|
80
80
|
rendered_abs_path = Rdm::Templates::TemplateRenderer.handle(get_destination_path(path), @locals)
|
|
81
81
|
rendered_rel_path = Pathname.new(rendered_abs_path).relative_path_from Pathname.new(project_path)
|
|
82
82
|
|
|
83
|
-
if File.file?(rendered_abs_path) && File.
|
|
83
|
+
if File.file?(rendered_abs_path) && File.exist?(rendered_abs_path)
|
|
84
84
|
@stdout.puts "Warning! #{rendered_rel_path} already exists. Skipping file creation..."
|
|
85
85
|
next
|
|
86
86
|
end
|
|
@@ -20,7 +20,7 @@ module Rdm
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def compile
|
|
23
|
-
FileUtils.rm_rf(@compile_path) if Dir.
|
|
23
|
+
FileUtils.rm_rf(@compile_path) if Dir.exist?(@compile_path)
|
|
24
24
|
FileUtils.mkdir_p(@compile_path)
|
|
25
25
|
|
|
26
26
|
dependent_packages = Rdm::Handlers::DependenciesHandler.show_packages(
|
|
@@ -57,7 +57,7 @@ module Rdm
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
FileUtils.cp_r(File.join(@project_path, 'configs'), File.join(@compile_path, 'configs'))
|
|
60
|
-
if Dir.
|
|
60
|
+
if Dir.exist?(File.join(@project_path, Rdm.settings.env_files_dir))
|
|
61
61
|
FileUtils.cp_r(
|
|
62
62
|
File.join(@project_path, Rdm.settings.env_files_dir),
|
|
63
63
|
File.join(@compile_path, Rdm.settings.env_files_dir)
|
data/lib/rdm/source_parser.rb
CHANGED
|
@@ -72,7 +72,7 @@ class Rdm::SourceParser
|
|
|
72
72
|
def init_and_set_env_variables(source)
|
|
73
73
|
return unless settings.read_setting(:env_file_name)
|
|
74
74
|
|
|
75
|
-
unless File.
|
|
75
|
+
unless File.exist?(env_file_path)
|
|
76
76
|
@stdout.puts "WARNING! Environment file '#{settings.read_setting(:env_file_name)}' was not found. Please, add #{env_file_path} file..."
|
|
77
77
|
return
|
|
78
78
|
end
|
|
@@ -13,7 +13,7 @@ class Rdm::SpecRunner::SpecFilenameMatcher
|
|
|
13
13
|
def find_matches
|
|
14
14
|
expected_filename = File.join(@package_path, @spec_matcher)
|
|
15
15
|
|
|
16
|
-
if File.
|
|
16
|
+
if File.exist?(expected_filename)
|
|
17
17
|
return Rdm::Utils::FileUtils.relative_path(path: expected_filename, from: @package_path).split
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -29,7 +29,7 @@ module Rdm
|
|
|
29
29
|
def template_file_path(template_name, relative_path)
|
|
30
30
|
file_path = [detect_template_folder(template_name), DEFAULT_TEMPLATES_DIRECTORY]
|
|
31
31
|
.map {|folder| File.join(folder, relative_path)}
|
|
32
|
-
.detect {|file| File.
|
|
32
|
+
.detect {|file| File.exist?(file)}
|
|
33
33
|
|
|
34
34
|
raise Rdm::Errors::TemplateFileDoesNotExists if file_path.nil?
|
|
35
35
|
|
data/lib/rdm/version.rb
CHANGED
data/rdm.gemspec
CHANGED
|
@@ -55,7 +55,7 @@ describe Rdm::ConfigManager do
|
|
|
55
55
|
|
|
56
56
|
describe "#update_using_hash" do
|
|
57
57
|
before :each do
|
|
58
|
-
subject.update_using_hash(
|
|
58
|
+
subject.update_using_hash({
|
|
59
59
|
database: {
|
|
60
60
|
username: "foo",
|
|
61
61
|
password: "bar"
|
|
@@ -65,7 +65,7 @@ describe Rdm::ConfigManager do
|
|
|
65
65
|
published: true,
|
|
66
66
|
draft: false,
|
|
67
67
|
features: ["dependency_manager", "config_manager"]
|
|
68
|
-
)
|
|
68
|
+
})
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
it "returns given value for string" do
|
|
@@ -96,12 +96,12 @@ describe Rdm::ConfigManager do
|
|
|
96
96
|
|
|
97
97
|
context "when already has config" do
|
|
98
98
|
before :each do
|
|
99
|
-
subject.update_using_hash(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
subject.update_using_hash({
|
|
100
|
+
database: {
|
|
101
|
+
username: "new_username",
|
|
102
|
+
password: "new_password"
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
it "keeps old configs" do
|
|
@@ -116,13 +116,13 @@ describe Rdm::ConfigManager do
|
|
|
116
116
|
|
|
117
117
|
describe "to_h" do
|
|
118
118
|
before :each do
|
|
119
|
-
subject.update_using_hash(
|
|
119
|
+
subject.update_using_hash({
|
|
120
120
|
site_name: "Sample app",
|
|
121
121
|
database: {
|
|
122
122
|
username: "username",
|
|
123
123
|
password: "password"
|
|
124
124
|
}
|
|
125
|
-
)
|
|
125
|
+
})
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
it "returns attributes in root scope" do
|
|
@@ -45,7 +45,7 @@ describe Rdm::Packages::CompilerService do
|
|
|
45
45
|
|
|
46
46
|
it "deletes old unused package from file structure" do
|
|
47
47
|
expect(
|
|
48
|
-
File.
|
|
48
|
+
File.exist?(File.join(fixed_compile_path, 'application/web/package/web.rb'))
|
|
49
49
|
).to be false
|
|
50
50
|
end
|
|
51
51
|
|
|
@@ -72,16 +72,16 @@ describe Rdm::Packages::CompilerService do
|
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
it "creates folder" do
|
|
75
|
-
expect(Dir.
|
|
75
|
+
expect(Dir.exist?(compile_path('repository'))).to be true
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
it "creates Rdm.packges" do
|
|
79
|
-
expect(File.
|
|
79
|
+
expect(File.exist?(source_path('repository'))).to be true
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
it "copies files structure from original package" do
|
|
83
83
|
expect(
|
|
84
|
-
File.
|
|
84
|
+
File.exist?(File.join(compile_path('repository'), 'infrastructure/repository/package/repository.rb'))
|
|
85
85
|
).to be true
|
|
86
86
|
end
|
|
87
87
|
|
|
@@ -108,11 +108,11 @@ describe Rdm::Packages::CompilerService do
|
|
|
108
108
|
|
|
109
109
|
it "copies files structure for each dependent package" do
|
|
110
110
|
expect(
|
|
111
|
-
File.
|
|
111
|
+
File.exist?(File.join(compile_path('web'), 'domain/core/package/core.rb'))
|
|
112
112
|
).to be true
|
|
113
113
|
|
|
114
114
|
expect(
|
|
115
|
-
File.
|
|
115
|
+
File.exist?(File.join(compile_path('web'), 'application/web/package/web.rb'))
|
|
116
116
|
).to be true
|
|
117
117
|
end
|
|
118
118
|
|
|
@@ -15,7 +15,7 @@ describe Rdm::SpecRunner::SpecFilenameMatcher do
|
|
|
15
15
|
it 'returns array with file_path matches' do
|
|
16
16
|
expect(
|
|
17
17
|
subject.find_matches(package_path: package_path, spec_matcher: existing_file)
|
|
18
|
-
).to
|
|
18
|
+
).to match_array([existing_file])
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ describe Rdm::SpecRunner::SpecFilenameMatcher do
|
|
|
23
23
|
it 'returns array of relative to package matches' do
|
|
24
24
|
expect(
|
|
25
25
|
subject.find_matches(package_path: package_path, spec_matcher: short_filename)
|
|
26
|
-
).to
|
|
26
|
+
).to match_array(["spec/core/sample_service_spec.rb", "spec/core/one_more_spec.rb"])
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
end
|
|
@@ -33,7 +33,7 @@ describe Rdm::SpecRunner do
|
|
|
33
33
|
stdin: SpecLogger.new(stdin: "exit\n")
|
|
34
34
|
)
|
|
35
35
|
|
|
36
|
-
expect(stdout.output).to match(["Following specs match your input:", "1. spec/core/
|
|
36
|
+
expect(stdout.output).to match(["Following specs match your input:", "1. spec/core/one_more_spec.rb\n2. spec/core/sample_service_spec.rb", "Enter space-separated file numbers, ex: '1 2': "])
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rdm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Droid Labs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -100,14 +100,14 @@ dependencies:
|
|
|
100
100
|
requirements:
|
|
101
101
|
- - "~>"
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '4.
|
|
103
|
+
version: '4.6'
|
|
104
104
|
type: :runtime
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
108
|
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: '4.
|
|
110
|
+
version: '4.6'
|
|
111
111
|
description: Ruby Dependency Manager
|
|
112
112
|
email:
|
|
113
113
|
executables:
|
|
@@ -118,6 +118,7 @@ extra_rdoc_files: []
|
|
|
118
118
|
files:
|
|
119
119
|
- ".gitignore"
|
|
120
120
|
- ".rubocop.yml"
|
|
121
|
+
- ".ruby-version"
|
|
121
122
|
- ".travis.yml"
|
|
122
123
|
- Gemfile
|
|
123
124
|
- Gemfile.lock
|
|
@@ -299,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
299
300
|
- !ruby/object:Gem::Version
|
|
300
301
|
version: '0'
|
|
301
302
|
requirements: []
|
|
302
|
-
rubygems_version: 3.
|
|
303
|
+
rubygems_version: 3.3.7
|
|
303
304
|
signing_key:
|
|
304
305
|
specification_version: 4
|
|
305
306
|
summary: Ruby Dependency Manager
|