bleetz 1.4 → 1.5

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.
Files changed (3) hide show
  1. data/lib/bleetz.rb +2 -2
  2. data/lib/bleetz/conf.rb +7 -3
  3. metadata +2 -2
@@ -6,7 +6,7 @@ require 'bleetz/object.rb'
6
6
 
7
7
  class Bleetz
8
8
 
9
- VERSION = "1.4"
9
+ VERSION = "1.5"
10
10
 
11
11
  USAGE = <<-EOF
12
12
  Usage: bleetz [-c conf_file -h -l -s][[-t -v -c conf_file] action]
@@ -32,7 +32,7 @@ EOF
32
32
  rescue TypeError
33
33
  abort "Didn't you make a mistake in .bleetz file ?"
34
34
  rescue BleetzException => e
35
- abort e.message
35
+ abort "Problem during configuration loading: #{e.message}"
36
36
  rescue ArgumentError
37
37
  abort "Did you configure attribute like this: 'attribute: <value>'"
38
38
  rescue Exception => e
@@ -22,7 +22,11 @@ module Conf
22
22
  begin
23
23
  yield
24
24
  rescue Exception => e
25
- raise BleetzException.new("Conf error: #{e.class}: #{e.message} in #{e.backtrace[0]}")
25
+ if e.class.eql? RuntimeError
26
+ raise BleetzException.new(e.message)
27
+ else
28
+ raise BleetzException.new("#{e.class}: #{e.message} in #{e.backtrace[0]}")
29
+ end
26
30
  end
27
31
  h = { action.to_sym => @cmds }
28
32
  t = { action.to_sym => desc.to_s }
@@ -51,12 +55,12 @@ module Conf
51
55
 
52
56
  def check_main_call(func)
53
57
  method = caller[2][/`([^']*)'/, 1]
54
- raise "Main configuration function, you cannot call '#{func}' in '#{method}'." unless method.eql?("load")
58
+ raise "#{caller[1].split(" ")[0]} '#{func}'. Main functions cannot be called in functions." unless method.eql?("load")
55
59
  end
56
60
 
57
61
  def check_sub_call(func)
58
62
  method = caller[2][/`([^']*)'/, 1]
59
- raise "'#{func}' has to be called in 'action' function." unless method.eql?("action")
63
+ raise "#{caller[1].split(" ")[0]} '#{func}'. '#{func}' has to be called in 'action' function." unless method.eql?("action")
60
64
  end
61
65
 
62
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bleetz
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.4'
4
+ version: '1.5'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-26 00:00:00.000000000 Z
12
+ date: 2012-12-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline