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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65babe0e674018bc13bbca51788d45b2d1c3a2fcc315903d45dde0b4af8875e3
4
- data.tar.gz: 92a5636ee330dace1043388cb2be0b0854c10ba013c069386c4ca4cc61c82e33
3
+ metadata.gz: e2a496f156083649520c2b31ec5d3b879dd7b82f5d9a0c0d135600c60f2ddfe5
4
+ data.tar.gz: 1c7f46a201ef145fc4a121a5ab6819d0adf8c80ab54efe6817c9b1e010ce62f3
5
5
  SHA512:
6
- metadata.gz: fe7228f97194c0831598fec83af8cd9de397a273df269c7e261bbe6ee61484501b2a4d3006a57c6a7626387a7003b011578a05db36e4b63d1799d244595679bb
7
- data.tar.gz: 9dd347fbb14ce3d30bc8685056d4144388108773def8dfa5088a15e77de0fb368224a6fec76cbaca06603a8285bdae732d1b7824ad23e22c4b47d5bfeba81e4d
6
+ metadata.gz: 727b35ff518220400fa69d43c95c3bb8fd9f6409d560d426479cab6b7ad4337749cd0c21a249b307e4e89d4660cfb8e5a6c3a6ac1bd6a1654887850a3b594a9a
7
+ data.tar.gz: 49025fb2d65a5e7e131761c6d1814b7568df3b32e34d040faac1205c440e127296bd4dd92cbae5db4d6eaecabba4de1f0b1bfbda9f2f20e90ce41790ce6856cd
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ Package.rb.lock
3
3
  pkg
4
4
  coverage/
5
5
  .byebug_history
6
+ .idea
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.4)
6
+ commander (~> 4.6)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.0.3.4)
11
+ activesupport (7.0.4.3)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
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.5.2)
23
+ commander (4.6.0)
25
24
  highline (~> 2.0.0)
26
- concurrent-ruby (1.1.7)
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.8.5)
29
+ i18n (1.13.0)
31
30
  concurrent-ruby (~> 1.0)
32
31
  json (2.3.1)
33
- minitest (5.14.2)
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
- thread_safe (0.3.6)
72
- tzinfo (1.2.7)
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.1.4
87
+ 2.4.13
data/README.md CHANGED
@@ -1,13 +1,20 @@
1
- # Rdm (Ruby Dependecy Manager)
2
- [![Build Status](https://travis-ci.org/ddd-ruby/rdm.png)](https://travis-ci.org/ddd-ruby/rdm)
1
+ # Rdm (Ruby Dependency Manager)
3
2
  [![Code Climate](https://codeclimate.com/github/ddd-ruby/rdm/badges/gpa.svg)](https://codeclimate.com/github/ddd-ruby/rdm)
4
- [![codecov](https://codecov.io/gh/ddd-ruby/rdm/branch/master/graph/badge.svg)](https://codecov.io/gh/ddd-ruby/rdm)
5
- [![Dependency Status](https://gemnasium.com/ddd-ruby/rdm.png)](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, options|
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, options|
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, options|
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.exists?(@compile_path)
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.exists?(rendered_abs_path)
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.exists?(@compile_path)
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.exists?(File.join(@project_path, Rdm.settings.env_files_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)
@@ -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.exists?(env_file_path)
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.exists?(expected_filename)
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.exists?(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
@@ -1,3 +1,3 @@
1
1
  module Rdm
2
- VERSION = '0.4.20'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
data/rdm.gemspec CHANGED
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "byebug"
23
23
  spec.add_development_dependency "codecov"
24
24
  spec.add_dependency "activesupport"
25
- spec.add_dependency "commander", "~> 4.4"
25
+ spec.add_dependency "commander", "~> 4.6"
26
26
  end
@@ -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
- database: {
101
- username: "new_username",
102
- password: "new_password"
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.exists?(File.join(fixed_compile_path, 'application/web/package/web.rb'))
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.exists?(compile_path('repository'))).to be true
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.exists?(source_path('repository'))).to be true
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.exists?(File.join(compile_path('repository'), 'infrastructure/repository/package/repository.rb'))
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.exists?(File.join(compile_path('web'), 'domain/core/package/core.rb'))
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.exists?(File.join(compile_path('web'), 'application/web/package/web.rb'))
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 eq([existing_file])
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 match(["spec/core/sample_service_spec.rb", "spec/core/one_more_spec.rb"])
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/sample_service_spec.rb\n2. spec/core/one_more_spec.rb", "Enter space-separated file numbers, ex: '1 2': "])
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
@@ -33,7 +33,7 @@ RSpec.configure do |config|
33
33
  end
34
34
 
35
35
  def ensure_exists(file)
36
- expect(File.exists?(file)).to be true
36
+ expect(File.exist?(file)).to be true
37
37
  end
38
38
 
39
39
  def ensure_content(file, content)
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.20
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: 2020-10-13 00:00:00.000000000 Z
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.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.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.0.8
303
+ rubygems_version: 3.3.7
303
304
  signing_key:
304
305
  specification_version: 4
305
306
  summary: Ruby Dependency Manager