rdm 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rdm/package_importer.rb +1 -1
- data/lib/rdm/settings.rb +4 -3
- data/lib/rdm/source_parser.rb +9 -5
- data/lib/rdm/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d4f1afe742a1dea7cacd7a7e66647dc4acfa20d
|
4
|
+
data.tar.gz: 30b2beebd5f215f6eb3f0df0d66d2a525bc34dd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9dd0aed10ef3c1c93661d4b504f15c23009ea6bd804d955f3dc53e05cfd410d3ee19ef8145dddf68270ac53248da3fde0d030411124261dbb5882a8ee4d4611
|
7
|
+
data.tar.gz: 5d9f27592299595921838e289d2086f6419fc305958e999c415378cc9bfc937e9d7f805f072654998f6b216cf74b4f5db52c5d96659a440561dc1b2d5f9fdb6e
|
data/lib/rdm/package_importer.rb
CHANGED
@@ -46,7 +46,7 @@ class Rdm::PackageImporter
|
|
46
46
|
begin
|
47
47
|
require package_name
|
48
48
|
rescue LoadError => e
|
49
|
-
unless Rdm.settings.
|
49
|
+
unless Rdm.settings.silence_missing_package_file
|
50
50
|
package_require_path = "#{package_name}/#{package_subdir_name}/#{package_name}.rb"
|
51
51
|
puts "WARNING: Can't require package #{package_name}, please make sure that file #{package_require_path} exists and it's valid."
|
52
52
|
raise e
|
data/lib/rdm/settings.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
class Rdm::Settings
|
2
2
|
SETTING_KEYS = [
|
3
|
-
:role, :
|
4
|
-
:
|
3
|
+
:role, :package_subdir_name, :configs_dir, :config_path, :role_config_path,
|
4
|
+
:silence_missing_package_file, :silence_missing_package
|
5
5
|
]
|
6
6
|
|
7
7
|
SETTING_VARIABLES = [:role, :configs_dir, :config_path, :role_config_path]
|
8
8
|
|
9
9
|
# Default settings
|
10
10
|
def initialize
|
11
|
-
|
11
|
+
silence_missing_package(false)
|
12
|
+
silence_missing_package_file(false)
|
12
13
|
package_subdir_name("package")
|
13
14
|
configs_dir('configs')
|
14
15
|
end
|
data/lib/rdm/source_parser.rb
CHANGED
@@ -22,11 +22,15 @@ class Rdm::SourceParser
|
|
22
22
|
packages = {}
|
23
23
|
source.package_paths.each do |package_path|
|
24
24
|
package_full_path = File.join(root_path, package_path)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
if File.exists?(package_full_path)
|
26
|
+
package_rb_path = File.join(package_full_path, Rdm::PACKAGE_FILENAME)
|
27
|
+
package_content = File.open(package_rb_path).read
|
28
|
+
package = package_parser.parse(package_content)
|
29
|
+
package.path = package_full_path
|
30
|
+
packages[package.name] = package
|
31
|
+
elsif !settings.silence_missing_package
|
32
|
+
raise "Missing package at folder: #{package_full_path}"
|
33
|
+
end
|
30
34
|
end
|
31
35
|
|
32
36
|
# Init and set configs
|
data/lib/rdm/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Droid Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|