bmc-daemon-lib 0.5.1 → 0.5.2

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: 9d60ad0e1a7fef22c3f0e864e2bb3f22f6ba598a
4
- data.tar.gz: 48d07a96593b70a1693d52cde23f990f72f5d9a7
3
+ metadata.gz: 2ddcc817ee80f36f44c6f1d09ce65f22b62ad098
4
+ data.tar.gz: 738b5f166e3c1427af3146ef2af8bcb37f33a4eb
5
5
  SHA512:
6
- metadata.gz: 0f3383b01b91dadd6a6a83f2951b308ecf0a24ec419e5904b97ab9e9ca302cbbb7eab90a3602640a76b03e6defab9e22464758817471b9e06bba06df0ead4234
7
- data.tar.gz: e797000c902b243c932eed29bc74ba3ffb5fe2b45838f46e71b9b724cd477353becb86fbacd4b1f6696b4909fd648dbf536234535ca8c065ff982aa41dbb5970
6
+ metadata.gz: 6b18a234dcfb0dca1f8c5e9b99cd31245b009aa9bdc8131431d92b1f29448b5dbe7951214145d43198c41680a5a1d1627429bef03a02fb26daf1bcc41e2f4ea9
7
+ data.tar.gz: de31a6793da38fb8b5113acf80aca05663922398befde420a4e2909a3a83109bcf6d617b895523bef2a209c666292979836bf695f04e2a9d9c64a8739ff19b71
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bmc-daemon-lib (0.5.1)
4
+ bmc-daemon-lib (0.5.2)
5
5
  chamber (~> 2.9.1)
6
6
 
7
7
  GEM
@@ -26,7 +26,7 @@ GEM
26
26
  diff-lcs (>= 1.2.0, < 2.0)
27
27
  rspec-support (~> 3.5.0)
28
28
  rspec-support (3.5.0)
29
- thor (0.19.1)
29
+ thor (0.19.4)
30
30
 
31
31
  PLATFORMS
32
32
  ruby
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  # Project version
4
- spec.version = "0.5.1"
4
+ spec.version = "0.5.2"
5
5
 
6
6
  # Project description
7
7
  spec.name = "bmc-daemon-lib"
@@ -5,8 +5,10 @@ module BmcDaemonLib
5
5
  class ConfigMissingParameter < StandardError; end
6
6
  class ConfigOtherError < StandardError; end
7
7
  class ConfigParseError < StandardError; end
8
- class ConfigMultipleGemspec < StandardError; end
9
- class ConfigMissingGemspec < StandardError; end
8
+
9
+ class ConfigGemspecNotUnique < StandardError; end
10
+ class ConfigGemspecMissing < StandardError; end
11
+ class ConfigGemspecInvalid < StandardError; end
10
12
 
11
13
  class Conf
12
14
  extend Chamber
@@ -37,14 +39,18 @@ module BmcDaemonLib
37
39
 
38
40
  # Store and clean app_root
39
41
  @app_root = File.expand_path(app_root)
42
+ gemspec_path = "#{@app_root}/*.gemspec"
40
43
 
41
44
  # Try to find any gemspec file
42
- matches = Dir["#{@app_root}/*.gemspec"]
43
- fail ConfigMissingGemspec, "gemspec file not found: #{gemspec_path}" if matches.size < 1
44
- fail ConfigMultipleGemspec, "gemspec file not found: #{gemspec_path}" if matches.size > 1
45
+ matches = Dir[gemspec_path]
46
+ fail ConfigGemspecMissing, "gemspec file not found: #{gemspec_path}" if matches.size < 1
47
+ fail ConfigGemspecNotUnique, "gemspec file not found: #{gemspec_path}" if matches.size > 1
45
48
 
46
49
  # Load Gemspec (just the only match)
47
50
  @spec = Gem::Specification::load(matches.first)
51
+ fail ConfigGemspecInvalid, "gemspec not readable: #{gemspec_path}" unless @spec
52
+
53
+ # Extract useful information from gemspec
48
54
  @app_name = @spec.name
49
55
  @app_ver = @spec.version
50
56
  fail ConfigMissingParameter, "gemspec: missing name" unless @app_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmc-daemon-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-07 00:00:00.000000000 Z
11
+ date: 2016-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler