scrolls 0.3.7 → 0.3.8

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: 0dd730a76cce1b9b08ea5dfe7bae8edb9bed2fc3
4
- data.tar.gz: 1d48b1371bff58dc40ce28148ce95f91c756aefa
3
+ metadata.gz: 034a31a03289b207b07627691c1b34e94269391b
4
+ data.tar.gz: 128743101d71f87a8d880b50b75291411fc113d6
5
5
  SHA512:
6
- metadata.gz: 587412cda539145df827237b30a54d651ab67641689b972fe21bf75fcb79702b9263e7bc646b298301d95bcee75e7951be28e294179de3d77e1b3f93b8198b95
7
- data.tar.gz: db5eb2c16f307861ffaa1f9ab724e0eae99e675017736466a8e819f358a42cacba914473ce3291f640112ad3bde4d35045e824d78a1ee11e1e2484e5b271441a
6
+ metadata.gz: a9b2e61cdb5ddbb617d541a250120427e874546819936c6cc00ac516b36827589635f20211c1814dd53204d93eb2de7206b9d5ad573eb334b5ddfd7a2e3991ff
7
+ data.tar.gz: b2ed49f6e31c968b303ca419a211eb07c47f8d25647e9baa6f3d5de2de6fbe23bacb57ffc458cbb6109980edf83281ea09a2300afd102d8064862b740aa82005
@@ -248,7 +248,7 @@ module Scrolls
248
248
  # => nil
249
249
  #
250
250
  def debug(data, &blk)
251
- data = data.merge(:level => "debug")
251
+ data = data.merge(:level => "debug") if data.is_a?(Hash)
252
252
  Log.log(data, &blk)
253
253
  end
254
254
 
@@ -266,7 +266,7 @@ module Scrolls
266
266
  # => nil
267
267
  #
268
268
  def error(data, &blk)
269
- data = data.merge(:level => "warning")
269
+ data = data.merge(:level => "warning") if data.is_a?(Hash)
270
270
  Log.log(data, &blk)
271
271
  end
272
272
 
@@ -284,7 +284,7 @@ module Scrolls
284
284
  # => nil
285
285
  #
286
286
  def fatal(data, &blk)
287
- data = data.merge(:level => "error")
287
+ data = data.merge(:level => "error") if data.is_a?(Hash)
288
288
  Log.log(data, &blk)
289
289
  end
290
290
 
@@ -302,7 +302,7 @@ module Scrolls
302
302
  # => nil
303
303
  #
304
304
  def info(data, &blk)
305
- data = data.merge(:level => "info")
305
+ data = data.merge(:level => "info") if data.is_a?(Hash)
306
306
  Log.log(data, &blk)
307
307
  end
308
308
 
@@ -320,7 +320,7 @@ module Scrolls
320
320
  # => nil
321
321
  #
322
322
  def warn(data, &blk)
323
- data = data.merge(:level => "notice")
323
+ data = data.merge(:level => "notice") if data.is_a?(Hash)
324
324
  Log.log(data, &blk)
325
325
  end
326
326
 
@@ -338,7 +338,7 @@ module Scrolls
338
338
  # => nil
339
339
  #
340
340
  def unknown(data, &blk)
341
- data = data.merge(:level => "alert")
341
+ data = data.merge(:level => "alert") if data.is_a?(Hash)
342
342
  Log.log(data, &blk)
343
343
  end
344
344
 
@@ -1,3 +1,3 @@
1
1
  module Scrolls
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
@@ -3,7 +3,7 @@ require_relative "test_helper"
3
3
  class TestScrolls < Test::Unit::TestCase
4
4
  def setup
5
5
  @out = StringIO.new
6
- Scrolls.stream = @out
6
+ Scrolls.init(:stream => @out)
7
7
  end
8
8
 
9
9
  def teardown
@@ -204,4 +204,24 @@ class TestScrolls < Test::Unit::TestCase
204
204
  assert_equal "t=t level=alert\n", @out.string
205
205
  end
206
206
 
207
+ def test_sending_string_error
208
+ Scrolls.error("error")
209
+ assert_equal "log_message=error\n", @out.string
210
+ end
211
+
212
+ def test_sending_string_fatal
213
+ Scrolls.fatal("fatal")
214
+ assert_equal "log_message=fatal\n", @out.string
215
+ end
216
+
217
+ def test_sending_string_warn
218
+ Scrolls.warn("warn")
219
+ assert_equal "log_message=warn\n", @out.string
220
+ end
221
+
222
+ def test_sending_string_unknown
223
+ Scrolls.unknown("unknown")
224
+ assert_equal "log_message=unknown\n", @out.string
225
+ end
226
+
207
227
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrolls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Curt Micol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-10 00:00:00.000000000 Z
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Logging, easier, more consistent.
14
14
  email: