sbsm 1.3.8 → 1.3.9

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: c6cb626e4851ec836b764fb7b362d781d0e63f3e
4
- data.tar.gz: e74535cdcc374099fdc168db3f5e7c6ea2343d12
3
+ metadata.gz: dd930d80bc37cb035451c6cd60025c07d93ecdd4
4
+ data.tar.gz: a885ac42d48f711ed8d66a51d4a3d54032b0571b
5
5
  SHA512:
6
- metadata.gz: 3a00b7d42d498ad395945d082f4a2136bc077989bfeca6c3558f07c5a9679721f4072ce3abffcff42be4b67413359776b26d401d671313f6d5043cbbccfcf7dc
7
- data.tar.gz: a96428befce20e6d19e367345886205036eed9e0af0f241842c7f7f991bf10beb2c4e5d88d8bd768f500af6bb31e5c5812528234d39f162501ef8bbb540e3cef
6
+ metadata.gz: 698df6a49ae0bb42eb7a11bba5b0277a35c29f17e1cfa396a61c1a08c4d047edeec0cbe5f3f10f2099b42c9c5262db5bb13dd8cd8b2bf044746668e665dd9bb8
7
+ data.tar.gz: c5c8f01a38aeb00a104af5998bbc0ef0a48693461a5b404379fa67959d66dd16d9d2dd2fe8cfbffadcb04861e0c0778dde848155168a01ff250fa0bd89301926
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.3.9 / 15.05.2017
2
+
3
+ * Added SBSM.warn and SBSM.error to make lib/sbsm/state.rb happy
4
+
1
5
  === 1.3.8 / 15.05.2017
2
6
 
3
7
  * Reverted some changes to make bbmb and virbac run
data/lib/sbsm/logger.rb CHANGED
@@ -38,6 +38,14 @@ module SBSM
38
38
  info = "#{File.basename(caller[0])} #{msg}"
39
39
  @@logger.info(info) if @@logger
40
40
  end
41
+ def self.error(msg)
42
+ info = "#{File.basename(caller[0])} #{msg}"
43
+ @@logger.error(info) if @@logger
44
+ end
45
+ def self.warn(msg)
46
+ info = "#{File.basename(caller[0])} #{msg}"
47
+ @@logger.warn(info) if @@logger
48
+ end
41
49
  def self.debug(msg)
42
50
  info = "#{File.basename(caller[0])} #{msg}"
43
51
  @@logger.debug(info) if @@logger
data/lib/sbsm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SBSM
2
- VERSION = '1.3.8'
2
+ VERSION = '1.3.9'
3
3
  end
data/test/test_logger.rb CHANGED
@@ -22,7 +22,7 @@
22
22
  # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zürich, Switzerland
23
23
  # hwyss@ywesee.com
24
24
  #
25
- # TestSession -- sbsm -- 22.10.2002 -- hwyss@ywesee.com
25
+ # TestSession -- sbsm -- 22.10.2002 -- hwyss@ywesee.com
26
26
  #++
27
27
 
28
28
  require 'minitest/autorun'
@@ -48,7 +48,7 @@ class TestLogger < Minitest::Test
48
48
  @temp_file.unlink
49
49
  end
50
50
 
51
- def test_default_levels_with_no_loggin
51
+ def test_default_levels_with_no_logging
52
52
  saved_length = File.size(@default_name)
53
53
  SBSM.debug("debug #{__LINE__}")
54
54
  assert_equal(saved_length, File.size(@default_name))
@@ -101,4 +101,23 @@ class TestLogger < Minitest::Test
101
101
  assert_equal(default_saved_length, File.size(@default_name))
102
102
  end
103
103
 
104
- end
104
+ def test_warn
105
+ SBSM.logger = Logger.new(@temp_file.path)
106
+ saved_length = File.size(@temp_file.path)
107
+ assert( !/test_warn/.match(IO.read(@temp_file.path)))
108
+ SBSM.warn("xx #{__LINE__}")
109
+ assert(saved_length < File.size(@temp_file.path))
110
+ content = IO.read(@temp_file.path)
111
+ assert_match(/test_warn/, IO.read(@temp_file.path))
112
+ end
113
+
114
+ def test_error
115
+ SBSM.logger = Logger.new(@temp_file.path)
116
+ saved_length = File.size(@temp_file.path)
117
+ assert( !/test_error/.match(IO.read(@temp_file.path)))
118
+ SBSM.error("xx #{__LINE__}")
119
+ assert(saved_length < File.size(@temp_file.path))
120
+ assert_match(/test_error/, IO.read(@temp_file.path))
121
+ end
122
+
123
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbsm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-15 00:00:00.000000000 Z
11
+ date: 2017-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack