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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35b42b35fcc5367b1c18ae0f1b6d8033f009df34
4
- data.tar.gz: b6fca01a756586a5eb6d05226e29acff193ce7b8
3
+ metadata.gz: 3d4f1afe742a1dea7cacd7a7e66647dc4acfa20d
4
+ data.tar.gz: 30b2beebd5f215f6eb3f0df0d66d2a525bc34dd0
5
5
  SHA512:
6
- metadata.gz: 54310892fb7010fd6bb359a9003dd03b646e41b9df44d4f9077d44d3d5f5e6ff26e66cafa264dfdd3aa7fda65046c22479b3c7792c3c77454f24b79b952792a4
7
- data.tar.gz: 1bafac3c332def046b7b40d0307c5c2ad2af0574b9a4d53080e3f94ce9c2d47a8b3e61263e66fe96a7f8433c4b60a42f61ea98ee2d0695e4e647894e4f536aa9
6
+ metadata.gz: f9dd0aed10ef3c1c93661d4b504f15c23009ea6bd804d955f3dc53e05cfd410d3ee19ef8145dddf68270ac53248da3fde0d030411124261dbb5882a8ee4d4611
7
+ data.tar.gz: 5d9f27592299595921838e289d2086f6419fc305958e999c415378cc9bfc937e9d7f805f072654998f6b216cf74b4f5db52c5d96659a440561dc1b2d5f9fdb6e
@@ -46,7 +46,7 @@ class Rdm::PackageImporter
46
46
  begin
47
47
  require package_name
48
48
  rescue LoadError => e
49
- unless Rdm.settings.silence_missing_package_file_exception
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, :silence_missing_package_file_exception, :package_subdir_name,
4
- :configs_dir, :config_path, :role_config_path
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
- silence_missing_package_file_exception(false)
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
@@ -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
- package_rb_path = File.join(package_full_path, Rdm::PACKAGE_FILENAME)
26
- package_content = File.open(package_rb_path).read
27
- package = package_parser.parse(package_content)
28
- package.path = package_full_path
29
- packages[package.name] = package
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
@@ -1,3 +1,3 @@
1
1
  module Rdm
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rdm'
2
2
 
3
3
  Rdm.setup do
4
- silence_missing_package_file_exception(true)
4
+ silence_missing_package_file(true)
5
5
  end
6
6
 
7
7
  RSpec.configure do |config|
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.0
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-09 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler