rdm 0.4.12 → 0.4.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +19 -19
- data/bin/rdm +23 -15
- data/lib/rdm/handlers/dependencies_handler.rb +5 -2
- data/lib/rdm/package_importer.rb +2 -2
- data/lib/rdm/source_modifier.rb +7 -5
- data/lib/rdm/spec_runner.rb +2 -0
- data/lib/rdm/spec_runner/runner.rb +19 -1
- data/lib/rdm/version.rb +1 -1
- data/spec/rdm/cli/dependencies_controller_spec.rb +5 -3
- data/spec/rdm/gen/package_spec.rb +1 -1
- data/spec/rdm/handlers/dependencies_handler_spec.rb +11 -7
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7ef547c24828be0e76ebfead89103580691c5eb09fb7ccae8fbf6e679ceb90c0
|
4
|
+
data.tar.gz: d5bce320cb6593f1ecbe6346acc6b109824f4320ef04300ab842f08cbb316aa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0784e0a54cdd0e0e1a5129460684cea9d5ed3606c997d390902a0393019082ddf163995b6efe44fe929c987d9b3c529377529ccf3e6c049fe10c5e072f499a5
|
7
|
+
data.tar.gz: 070261bcff5bb4be884fc6ad9c7ade948598c091dc141c3181e79d9146d09a5204d935929e15c16f4de6a60674506fac673cc433e5fd7d3c43f8e59db7b1b147
|
data/Gemfile.lock
CHANGED
@@ -1,34 +1,35 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rdm (0.4.
|
4
|
+
rdm (0.4.18)
|
5
5
|
activesupport
|
6
6
|
commander (~> 4.4)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (5.
|
11
|
+
activesupport (5.2.4.4)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
-
i18n (
|
13
|
+
i18n (>= 0.7, < 2)
|
14
14
|
minitest (~> 5.1)
|
15
15
|
tzinfo (~> 1.1)
|
16
16
|
ast (2.3.0)
|
17
17
|
byebug (9.0.6)
|
18
|
-
codecov (0.
|
18
|
+
codecov (0.2.5)
|
19
|
+
colorize
|
19
20
|
json
|
20
21
|
simplecov
|
21
|
-
|
22
|
-
commander (4.
|
23
|
-
highline (~>
|
24
|
-
concurrent-ruby (1.
|
22
|
+
colorize (0.8.1)
|
23
|
+
commander (4.5.2)
|
24
|
+
highline (~> 2.0.0)
|
25
|
+
concurrent-ruby (1.1.7)
|
25
26
|
diff-lcs (1.3)
|
26
|
-
docile (1.
|
27
|
-
highline (
|
28
|
-
i18n (
|
27
|
+
docile (1.3.2)
|
28
|
+
highline (2.0.3)
|
29
|
+
i18n (1.8.5)
|
29
30
|
concurrent-ruby (~> 1.0)
|
30
|
-
json (2.
|
31
|
-
minitest (5.
|
31
|
+
json (2.3.1)
|
32
|
+
minitest (5.14.2)
|
32
33
|
parser (2.3.3.1)
|
33
34
|
ast (~> 2.2)
|
34
35
|
powerpack (0.1.1)
|
@@ -54,16 +55,15 @@ GEM
|
|
54
55
|
ruby-progressbar (~> 1.7)
|
55
56
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
56
57
|
ruby-progressbar (1.8.1)
|
57
|
-
simplecov (0.
|
58
|
-
docile (~> 1.1
|
58
|
+
simplecov (0.17.1)
|
59
|
+
docile (~> 1.1)
|
59
60
|
json (>= 1.8, < 3)
|
60
61
|
simplecov-html (~> 0.10.0)
|
61
|
-
simplecov-html (0.10.
|
62
|
+
simplecov-html (0.10.2)
|
62
63
|
thread_safe (0.3.6)
|
63
|
-
tzinfo (1.2.
|
64
|
+
tzinfo (1.2.7)
|
64
65
|
thread_safe (~> 0.1)
|
65
66
|
unicode-display_width (1.1.2)
|
66
|
-
url (0.3.2)
|
67
67
|
|
68
68
|
PLATFORMS
|
69
69
|
ruby
|
@@ -78,4 +78,4 @@ DEPENDENCIES
|
|
78
78
|
rubocop (~> 0.46)
|
79
79
|
|
80
80
|
BUNDLED WITH
|
81
|
-
1.
|
81
|
+
1.17.3
|
data/bin/rdm
CHANGED
@@ -60,7 +60,7 @@ class RdmCliRunner
|
|
60
60
|
c.action do |args, options|
|
61
61
|
package_name = (args.first || "")
|
62
62
|
defaults = {
|
63
|
-
current_path: `pwd`.chomp,
|
63
|
+
current_path: File.expand_path(`pwd`.chomp),
|
64
64
|
package_name: package_name,
|
65
65
|
path: package_name.downcase.gsub(/\s+/, '_')
|
66
66
|
}
|
@@ -82,7 +82,7 @@ class RdmCliRunner
|
|
82
82
|
c.action do |args, options|
|
83
83
|
revision = (args.first || "HEAD")
|
84
84
|
options = {
|
85
|
-
path: `pwd`.chomp,
|
85
|
+
path: File.expand_path(`pwd`.chomp),
|
86
86
|
revision: revision,
|
87
87
|
}
|
88
88
|
Rdm::CLI::DiffPackage.run(options)
|
@@ -100,7 +100,7 @@ class RdmCliRunner
|
|
100
100
|
c.action do |args, options|
|
101
101
|
package_name = (args.first || "")
|
102
102
|
opts = {
|
103
|
-
project_path: `pwd`.chomp,
|
103
|
+
project_path: File.expand_path(`pwd`.chomp),
|
104
104
|
package_name: package_name,
|
105
105
|
compile_path: options.path
|
106
106
|
}
|
@@ -125,7 +125,7 @@ class RdmCliRunner
|
|
125
125
|
|
126
126
|
Rdm::CLI::TemplateGenerator.run(
|
127
127
|
template_name: template_name,
|
128
|
-
current_path: `pwd`.chomp,
|
128
|
+
current_path: File.expand_path(`pwd`.chomp),
|
129
129
|
local_path: options_hash.delete(:path),
|
130
130
|
locals: options_hash
|
131
131
|
)
|
@@ -143,7 +143,7 @@ class RdmCliRunner
|
|
143
143
|
|
144
144
|
Rdm::CLI::DependenciesController.run(
|
145
145
|
package_name: package_name,
|
146
|
-
project_path: `pwd`.chomp
|
146
|
+
project_path: File.expand_path(`pwd`.chomp)
|
147
147
|
)
|
148
148
|
end
|
149
149
|
end
|
@@ -162,14 +162,14 @@ class RdmCliRunner
|
|
162
162
|
|
163
163
|
Rdm::CLI::Config.run(
|
164
164
|
config_name: config_name,
|
165
|
-
current_path: `pwd`.chomp,
|
165
|
+
current_path: File.expand_path(`pwd`.chomp),
|
166
166
|
config_data: options_hash
|
167
167
|
)
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
171
171
|
command :"rspec.run" do |c|
|
172
|
-
c.syntax = 'rdm rspec.run PACKAGE_NAME SPEC_MATCHER'
|
172
|
+
c.syntax = 'rdm rspec.run PACKAGE_NAME SPEC_MATCHER --from=START_FROM_PACKAGE_NAME'
|
173
173
|
c.description = 'run tests for specified package and spec file matcher'
|
174
174
|
c.summary = '> ' + c.description
|
175
175
|
|
@@ -179,20 +179,28 @@ class RdmCliRunner
|
|
179
179
|
'rdm rspec.run mailing_system'
|
180
180
|
c.example 'run tests for `mailing_system` package and files, matches `events` string',
|
181
181
|
'rdm rspec.run mailing_system events'
|
182
|
+
c.example 'run tests for all packages from cache_system',
|
183
|
+
'rdm rspec.run --from=cache_system'
|
184
|
+
|
185
|
+
c.option '--from [FROM_PACKAGE_NAME]', String, 'Rspec will start for all package from passed package_name'
|
182
186
|
|
183
187
|
c.action do |args, options|
|
184
188
|
package_name = args[0]
|
185
189
|
spec_matcher = args[1]
|
186
190
|
|
187
191
|
ENV['RUBY_ENV'] = 'test'
|
192
|
+
|
193
|
+
options_hash = options.__hash__
|
194
|
+
options_hash.delete(:trace)
|
188
195
|
|
189
|
-
Rdm.root(`pwd`.chomp)
|
196
|
+
Rdm.root(File.expand_path(`pwd`.chomp))
|
190
197
|
Rdm::SpecRunner.run(
|
191
|
-
package:
|
192
|
-
spec_matcher:
|
193
|
-
path:
|
194
|
-
skip_ignored_packages:
|
195
|
-
show_missing_packages:
|
198
|
+
package: package_name,
|
199
|
+
spec_matcher: spec_matcher,
|
200
|
+
path: File.expand_path(`pwd`.chomp),
|
201
|
+
skip_ignored_packages: true,
|
202
|
+
show_missing_packages: true,
|
203
|
+
from: options_hash[:from]
|
196
204
|
)
|
197
205
|
end
|
198
206
|
end
|
@@ -213,11 +221,11 @@ class RdmCliRunner
|
|
213
221
|
revision = args[0]
|
214
222
|
|
215
223
|
ENV['RUBY_ENV'] = 'test'
|
216
|
-
Rdm.root(`pwd`.chomp)
|
224
|
+
Rdm.root(File.expand_path(`pwd`.chomp))
|
217
225
|
|
218
226
|
Rdm::CLI::DiffSpecRunner.run(
|
219
227
|
revision: revision,
|
220
|
-
path: `pwd`.chomp
|
228
|
+
path: File.expand_path(`pwd`.chomp)
|
221
229
|
)
|
222
230
|
end
|
223
231
|
end
|
@@ -2,6 +2,9 @@ module Rdm
|
|
2
2
|
module Handlers
|
3
3
|
class DependenciesHandler
|
4
4
|
ALREADY_MENTIONED_DEPS = '...'
|
5
|
+
HYPHEN = "\xE2\x94\x80" * 2
|
6
|
+
CORNER = "\xE2\x94\x80" + HYPHEN + " "
|
7
|
+
MIDDLE_CORNER = "\xE2\x94\x9C" + HYPHEN + " "
|
5
8
|
|
6
9
|
class << self
|
7
10
|
def show_names(package_name:, project_path:)
|
@@ -67,10 +70,10 @@ module Rdm
|
|
67
70
|
local_dependencies.delete(k)
|
68
71
|
|
69
72
|
if local_dependencies.empty?
|
70
|
-
tmp_self_predicate = child_predicate +
|
73
|
+
tmp_self_predicate = child_predicate + CORNER
|
71
74
|
tmp_child_predicate = child_predicate + ' '
|
72
75
|
else
|
73
|
-
tmp_self_predicate = child_predicate +
|
76
|
+
tmp_self_predicate = child_predicate + MIDDLE_CORNER
|
74
77
|
tmp_child_predicate = child_predicate + '| '
|
75
78
|
end
|
76
79
|
|
data/lib/rdm/package_importer.rb
CHANGED
@@ -62,14 +62,14 @@ class Rdm::PackageImporter
|
|
62
62
|
|
63
63
|
# also import local dependencies
|
64
64
|
package.local_dependencies(group).each do |dependency|
|
65
|
-
import_package(dependency, source: source)
|
65
|
+
import_package(dependency, source: source, group: group)
|
66
66
|
end
|
67
67
|
|
68
68
|
# also import config dependencies
|
69
69
|
package.config_dependencies(group).each do |dependency|
|
70
70
|
import_config(dependency, source: source)
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
# only after importing dependencies - require package itself
|
74
74
|
begin
|
75
75
|
require package_name
|
data/lib/rdm/source_modifier.rb
CHANGED
@@ -22,7 +22,7 @@ class Rdm::SourceModifier
|
|
22
22
|
|
23
23
|
def add_package(package_path)
|
24
24
|
rebuild_file do
|
25
|
-
@package_lines.push "package
|
25
|
+
@package_lines.push "package '#{package_path}'"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -36,12 +36,14 @@ class Rdm::SourceModifier
|
|
36
36
|
|
37
37
|
def rebuild_file
|
38
38
|
File.open(@source_path).each_line do |line|
|
39
|
+
line.gsub!("\n", '')
|
40
|
+
|
39
41
|
case line
|
40
42
|
when PACKAGE_LINE_REGEX
|
41
43
|
@package_lines.push line
|
42
44
|
when CONFIG_LINE_REGEX
|
43
45
|
@config_lines.push line
|
44
|
-
when "
|
46
|
+
when ""
|
45
47
|
# DO NOTHING
|
46
48
|
else
|
47
49
|
@setup_lines.push line
|
@@ -51,13 +53,13 @@ class Rdm::SourceModifier
|
|
51
53
|
yield
|
52
54
|
|
53
55
|
File.open(@source_path, 'w') do |file|
|
54
|
-
file.write @setup_lines.join
|
56
|
+
file.write @setup_lines.join("\n")
|
55
57
|
file.write(RDM_CONTENT_SPACES)
|
56
58
|
|
57
|
-
file.write @config_lines.join
|
59
|
+
file.write @config_lines.join("\n")
|
58
60
|
file.write(RDM_CONTENT_SPACES)
|
59
61
|
|
60
|
-
file.write @package_lines.join
|
62
|
+
file.write @package_lines.join("\n")
|
61
63
|
end
|
62
64
|
|
63
65
|
@package_lines = []
|
data/lib/rdm/spec_runner.rb
CHANGED
@@ -3,6 +3,7 @@ module Rdm::SpecRunner
|
|
3
3
|
path: nil,
|
4
4
|
package: nil,
|
5
5
|
spec_matcher: nil,
|
6
|
+
from: nil,
|
6
7
|
show_missing_packages: true,
|
7
8
|
skip_ignored_packages: false,
|
8
9
|
stdout: STDOUT,
|
@@ -13,6 +14,7 @@ module Rdm::SpecRunner
|
|
13
14
|
path: path,
|
14
15
|
package: package,
|
15
16
|
spec_matcher: spec_matcher,
|
17
|
+
from: from,
|
16
18
|
show_missing_packages: show_missing_packages,
|
17
19
|
skip_ignored_packages: skip_ignored_packages,
|
18
20
|
show_output: show_output,
|
@@ -10,6 +10,7 @@ class Rdm::SpecRunner::Runner
|
|
10
10
|
package: nil,
|
11
11
|
spec_matcher: nil,
|
12
12
|
path: nil,
|
13
|
+
from: nil,
|
13
14
|
show_missing_packages: true,
|
14
15
|
skip_ignored_packages: false,
|
15
16
|
stdout: STDOUT,
|
@@ -26,6 +27,7 @@ class Rdm::SpecRunner::Runner
|
|
26
27
|
@skipped_packages = []
|
27
28
|
@stdout = stdout
|
28
29
|
@show_output = show_output
|
30
|
+
@from = from
|
29
31
|
end
|
30
32
|
|
31
33
|
def run
|
@@ -164,6 +166,22 @@ class Rdm::SpecRunner::Runner
|
|
164
166
|
.reject { |cmd_params| @skipped_packages.include?(cmd_params.package_name) }
|
165
167
|
.sort_by { |cmd_params| cmd_params.package_name }
|
166
168
|
|
169
|
+
if @from
|
170
|
+
start_from = running_packages.index {|cmd_params| cmd_params.package_name == @from}
|
171
|
+
|
172
|
+
if start_from.nil?
|
173
|
+
puts "Package :#{@from} does not exists"
|
174
|
+
exit(1)
|
175
|
+
end
|
176
|
+
|
177
|
+
if @skipped_packages.include?(start_from)
|
178
|
+
puts "Package :#{@from} skipped by .runignore file"
|
179
|
+
exit(1)
|
180
|
+
end
|
181
|
+
|
182
|
+
running_packages = running_packages[start_from..-1]
|
183
|
+
end
|
184
|
+
|
167
185
|
if @run_all
|
168
186
|
puts <<~EOF
|
169
187
|
Rspec tests will run for packages:
|
@@ -173,7 +191,7 @@ class Rdm::SpecRunner::Runner
|
|
173
191
|
|
174
192
|
running_packages
|
175
193
|
.map(&:command)
|
176
|
-
.join('
|
194
|
+
.join('; ')
|
177
195
|
end
|
178
196
|
|
179
197
|
def display_missing_specs
|
data/lib/rdm/version.rb
CHANGED
@@ -18,12 +18,14 @@ describe Rdm::CLI::DependenciesController do
|
|
18
18
|
stdout: stdout
|
19
19
|
)
|
20
20
|
|
21
|
+
mod = Rdm::Handlers::DependenciesHandler
|
22
|
+
|
21
23
|
expect(stdout.output.last).to match(
|
22
24
|
[
|
23
25
|
"web",
|
24
|
-
"
|
25
|
-
"|
|
26
|
-
"
|
26
|
+
"#{mod::MIDDLE_CORNER}core",
|
27
|
+
"| #{mod::CORNER}repository",
|
28
|
+
"#{mod::CORNER}repository (test)"
|
27
29
|
]
|
28
30
|
)
|
29
31
|
end
|
@@ -62,12 +62,14 @@ describe Rdm::Handlers::DependenciesHandler do
|
|
62
62
|
)
|
63
63
|
}
|
64
64
|
it "returns hash structure of dependencies" do
|
65
|
+
mod = Rdm::Handlers::DependenciesHandler
|
66
|
+
|
65
67
|
expect(result).to match(
|
66
68
|
[
|
67
69
|
"web",
|
68
|
-
"
|
69
|
-
"|
|
70
|
-
"
|
70
|
+
"#{mod::MIDDLE_CORNER}core",
|
71
|
+
"| #{mod::CORNER}repository",
|
72
|
+
"#{mod::CORNER}repository (test)"
|
71
73
|
]
|
72
74
|
)
|
73
75
|
end
|
@@ -89,13 +91,15 @@ describe Rdm::Handlers::DependenciesHandler do
|
|
89
91
|
}
|
90
92
|
|
91
93
|
it "use one at time" do
|
94
|
+
mod = Rdm::Handlers::DependenciesHandler
|
95
|
+
|
92
96
|
expect(result).to match(
|
93
97
|
[
|
94
98
|
"web",
|
95
|
-
"
|
96
|
-
"|
|
97
|
-
"|
|
98
|
-
"
|
99
|
+
"#{mod::MIDDLE_CORNER}core",
|
100
|
+
"| #{mod::CORNER}web",
|
101
|
+
"| #{mod::CORNER}...",
|
102
|
+
"#{mod::CORNER}repository (test)"
|
99
103
|
]
|
100
104
|
)
|
101
105
|
end
|
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.
|
4
|
+
version: 0.4.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Droid Labs
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '4.4'
|
111
111
|
description: Ruby Dependency Manager
|
112
|
-
email:
|
112
|
+
email:
|
113
113
|
executables:
|
114
114
|
- rdm
|
115
115
|
- rubocop
|
@@ -280,10 +280,10 @@ files:
|
|
280
280
|
- spec/rdm/templates/template_detector_spec.rb
|
281
281
|
- spec/rdm/templates/template_renderer_spec.rb
|
282
282
|
- spec/spec_helper.rb
|
283
|
-
homepage:
|
283
|
+
homepage:
|
284
284
|
licenses: []
|
285
285
|
metadata: {}
|
286
|
-
post_install_message:
|
286
|
+
post_install_message:
|
287
287
|
rdoc_options: []
|
288
288
|
require_paths:
|
289
289
|
- lib
|
@@ -298,9 +298,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
- !ruby/object:Gem::Version
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
|
-
|
302
|
-
|
303
|
-
signing_key:
|
301
|
+
rubygems_version: 3.0.8
|
302
|
+
signing_key:
|
304
303
|
specification_version: 4
|
305
304
|
summary: Ruby Dependency Manager
|
306
305
|
test_files:
|