nasty 0.0.1388163382 → 0.0.1388163823

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: baa4bbae5d22895154e7c35f860c80c24e95d005
4
- data.tar.gz: a5bfb7f4d6389d90293c1fd99828100e95b5dc5d
3
+ metadata.gz: 5a2d747b1ab039657b72106eed7dc22577b620cd
4
+ data.tar.gz: 1dcf0df9929bdc939d48a44b5adb701ddd8e6efd
5
5
  SHA512:
6
- metadata.gz: 91e5df95f1bd96a7c42da49fa7c64ad1e6b51a6d69926818f26705e18245f2f936d81f1723721457c8743f0cd97e19192564782616723ca58bcb9caa45196468
7
- data.tar.gz: 889ec59d0482027d3537fb88a37781dd8cff695cf9c85421b315e9417afcefca94cc90fe3541c2dd1c7fe998c03b92c61a8891157aa3db4d996753b47c92fba0
6
+ metadata.gz: 6cac89a27e056642ab1862fcd78609d3d14de84dd1d58ccaf27205f52616a37c451dba5364263f68f324c3c43686fbef0e5e2741b555ee8900dcadb228353408
7
+ data.tar.gz: 292f3f11c7e2d0672702dca327ff8428a17bc4fc36764bc7035a96c91e94079f5caa1a1f4e4c128891bc5d039d76f3ff77ad292e176ce632ae73874f6b569aab
data/lib/nasty.rb CHANGED
@@ -3,6 +3,7 @@ require "nasty/command"
3
3
  require "nasty/composite_command"
4
4
  require "nasty/kernel"
5
5
  require "nasty/log"
6
+ require "nasty/object"
6
7
  require "nasty/lambda_behaviours"
7
8
  require "nasty/version"
8
9
 
data/lib/nasty/log.rb CHANGED
@@ -8,7 +8,9 @@ module Nasty
8
8
  end
9
9
 
10
10
  def for(target)
11
- @@log_factory || ConsoleLogFactory.new
11
+ unless class_variable_defined? :@@log_factory
12
+ @@log_factory = ConsoleLogFactory.new
13
+ end
12
14
  @@log_factory.create_for(target)
13
15
  end
14
16
  end
@@ -0,0 +1,3 @@
1
+ class Object
2
+ include Nasty::Logging
3
+ end
@@ -28,5 +28,11 @@ module Nasty
28
28
  logger.should have_received(:debug).with("hi there")
29
29
  end
30
30
  end
31
+
32
+ context "logger" do
33
+ it "should be able to call the logger from anywhere" do
34
+ logger.debug("blah")
35
+ end
36
+ end
31
37
  end
32
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nasty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1388163382
4
+ version: 0.0.1388163823
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan
@@ -86,6 +86,7 @@ files:
86
86
  - lib/nasty/kernel.rb
87
87
  - lib/nasty/lambda_behaviours.rb
88
88
  - lib/nasty/log.rb
89
+ - lib/nasty/object.rb
89
90
  - lib/nasty/version.rb
90
91
  - nasty.gemspec
91
92
  - spec/spec_helper.rb