log_buddy 0.4.10 → 0.4.12

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.
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ .tm_last_run_ruby
2
+ *.log
3
+ doc/*
4
+ pkg/*
5
+ coverage
6
+ TAGS
7
+ coverage/
data/.treasure_map.rb ADDED
@@ -0,0 +1,17 @@
1
+ map_for(:log_buddy) do |wizard|
2
+
3
+ wizard.keep_a_watchful_eye_for 'lib', 'examples'
4
+
5
+ wizard.prepare_spell_for %r%examples/(.*)_example\.rb% do |spell_component|
6
+ ["examples/#{spell_component[1]}_example.rb"]
7
+ end
8
+
9
+ wizard.prepare_spell_for %r%examples/example_helper\.rb% do |spell_component|
10
+ Dir["examples/**/*_example.rb"]
11
+ end
12
+
13
+ wizard.prepare_spell_for %r%lib/(.*)\.rb% do |spell_component|
14
+ ["examples/#{spell_component[1]}_example.rb"]
15
+ end
16
+
17
+ end
data/CHANGELOG ADDED
@@ -0,0 +1,31 @@
1
+ v0.4.10 Switch to jeweler; remove dependencies that were superfluous
2
+
3
+ v0.4.9 Added gem logging for debugging help when tracking down Gem activation errors
4
+
5
+ v0.2.3 Updating Micronaut
6
+
7
+ v0.2.0. Better log output of objects based on their type, very similar to Logger/irb behavior; update to micronaut 0.1.0
8
+
9
+ v0.1.5. Clean up specs and remove noise from spec run
10
+
11
+ v0.1.4. Micronauts Unite! Test Suite now runs via Micronaut - http://github.com/spicycode/micronaut/
12
+
13
+ v0.1.3. Use plain old echoe; really fix rubygems errors (I hope)
14
+
15
+ v0.1.2. Attempting to fix rubygems errors
16
+
17
+ v0.1.1. Handle exceptions from within the block
18
+
19
+ v0.1.0. Specify, clean up
20
+
21
+ v0.0.6. changed to mixing to Object by default - set ENV["SAFE_LOG_BUDDY"] = true to override
22
+
23
+ v0.0.5. update echoe dependency to work with github
24
+
25
+ v0.0.4. add dev dependencies, remove gem calls from rdoc task
26
+
27
+ v0.0.3. specs and tweaks
28
+
29
+ v0.0.2. rdocs; support for multiple statements in one "d" call separated by semicolons
30
+
31
+ v0.0.1. Initial release to github; Birthday
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  begin
3
2
  require 'jeweler'
4
3
  Jeweler::Tasks.new do |gem|
@@ -8,16 +7,15 @@ begin
8
7
  gem.email = "rsanheim@gmail.com"
9
8
  gem.homepage = "http://github.com/relevance/log_buddy"
10
9
  gem.authors = ["Rob Sanheim"]
11
- gem.add_development_dependency "spicycode-micronaut"
12
- gem.rubyforge_project = 'thinkrelevance'
13
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
10
+ gem.add_development_dependency "micronaut", ">= 0.3.0"
11
+ gem.add_development_dependency "mocha", ">= 0.3.0"
14
12
  end
13
+ Jeweler::GemcutterTasks.new
15
14
  rescue LoadError
16
- puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
15
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
17
16
  end
18
17
 
19
18
  begin
20
- gem "spicycode-micronaut"
21
19
  require 'micronaut/rake_task'
22
20
 
23
21
  Micronaut::RakeTask.new(:examples) do |examples|
@@ -27,18 +25,21 @@ begin
27
25
 
28
26
  Micronaut::RakeTask.new(:rcov) do |examples|
29
27
  examples.pattern = 'examples/**/*_example.rb'
30
- examples.rcov_opts = %[-Ilib -Iexamples --exclude "gems/*,/Library/Ruby/*,config/*" --text-summary --sort coverage --no-validator-links]
28
+ examples.rcov_opts = %[-Ilib -Iexamples --exclude "gems/*,/Library/Ruby/*,config/*" --text-summary --sort coverage]
31
29
  examples.rcov = true
32
30
  end
33
31
 
34
- task :default => 'rcov'
35
- rescue LoadError
32
+ task :default => [:check_dependencies, :rcov]
33
+ rescue LoadError => e
36
34
  puts "Micronaut not available to run tests. Install it with: sudo gem install spicycode-micronaut -s http://gems.github.com"
35
+ puts e
36
+ puts e.backtrace
37
37
  end
38
38
 
39
39
  require 'rake/rdoctask'
40
40
  Rake::RDocTask.new do |rdoc|
41
41
  if File.exist?('VERSION.yml')
42
+ require 'yaml'
42
43
  config = YAML.load(File.read('VERSION.yml'))
43
44
  version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
44
45
  else
@@ -49,4 +50,4 @@ Rake::RDocTask.new do |rdoc|
49
50
  rdoc.title = "log_buddy #{version}"
50
51
  rdoc.rdoc_files.include('README*')
51
52
  rdoc.rdoc_files.include('lib/**/*.rb')
52
- end
53
+ end
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 4
4
- :patch: 10
4
+ :patch: 12
@@ -1,7 +1,4 @@
1
1
  require 'logger'
2
- require 'rubygems'
3
- gem "spicycode-micronaut", ">= 0.2.0"
4
- gem 'mocha'
5
2
  require "mocha"
6
3
  require 'micronaut'
7
4
  require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib", "log_buddy"))
@@ -17,7 +14,6 @@ Micronaut.configure do |config|
17
14
  config.mock_with :mocha
18
15
  config.formatter = :documentation
19
16
  config.color_enabled = true
17
+ config.alias_example_to :fit, :focused => true
20
18
  config.filter_run :options => { :focused => true }
21
19
  end
22
-
23
- puts RUBY_VERSION if ENV["RUN_CODE_RUN"]
@@ -10,36 +10,40 @@ describe LogBuddy::GemLogger do
10
10
  end
11
11
 
12
12
  end
13
-
14
- describe "Gem#activation monkey patching for logging" do
13
+
14
+ if RUBY_VERSION != '1.9.1'
15
15
 
16
- before do
17
- LogBuddy.init
18
- LogBuddy::GemLogger.log_gems!
19
- end
16
+ describe "Gem#activation monkey patching for logging" do
17
+
18
+ before do
19
+ LogBuddy.init
20
+ LogBuddy::GemLogger.log_gems!
21
+ end
20
22
 
21
- it "should log the gem name and version and where it was called from" do
22
- Gem.stubs(:activate_without_logging)
23
+ it "should log the gem name and version and where it was called from" do
24
+ Gem.stubs(:activate_without_logging)
25
+
26
+ LogBuddy.expects(:debug).with do |msg|
27
+ msg.should include(%[Gem activation for gem: 'gem-name' version: '0.5' called from:\n])
28
+ gem_calling_line = __LINE__ + 3
29
+ msg.should include(%[examples/log_buddy/gem_logger_example.rb:#{gem_calling_line}])
30
+ end
31
+ gem "gem-name", "0.5"
32
+ end
23
33
 
24
- LogBuddy.expects(:debug).with do |msg|
25
- msg.should include(%[Gem activation for gem: 'gem-name' version: '0.5' called from:\n])
26
- gem_calling_line = __LINE__ + 3
27
- msg.should include(%[examples/log_buddy/gem_logger_example.rb:#{gem_calling_line}])
34
+ it "should do the original gem activation call" do
35
+ LogBuddy.stubs(:debug)
36
+ Gem.expects(:activate_without_logging).with('gem-name', ">= 1.0.0")
37
+ gem "gem-name", ">= 1.0.0"
28
38
  end
29
- gem "gem-name", "0.5"
30
- end
31
-
32
- it "should do the original gem activation call" do
33
- LogBuddy.stubs(:debug)
34
- Gem.expects(:activate_without_logging).with('gem-name', ">= 1.0.0")
35
- gem "gem-name", ">= 1.0.0"
36
- end
37
-
38
- it "should add alias gem_without_logging" do
39
- Gem.should respond_to(:activate)
40
- Gem.should respond_to(:activate_without_logging)
41
- end
42
39
 
40
+ it "should add alias gem_without_logging" do
41
+ Gem.should respond_to(:activate)
42
+ Gem.should respond_to(:activate_without_logging)
43
+ end
44
+
45
+ end
46
+
43
47
  end
44
48
 
45
- end
49
+ end
data/examples.rb ADDED
@@ -0,0 +1,31 @@
1
+ require 'lib/log_buddy'
2
+ LogBuddy.init
3
+
4
+ a = "foo"
5
+ @a = "my var"
6
+ @@bar = "class var!"
7
+ def bark
8
+ "woof!"
9
+ end
10
+
11
+ module Foo;
12
+ def self.module_method
13
+ "hi!!"
14
+ end
15
+ end
16
+
17
+
18
+ # LogBuddy calls and their output:
19
+
20
+ d "hi" # hi
21
+ d { a } # a = "foo"
22
+ d { @a } # @a = "my var"
23
+ d { @@bar } # @@bar = "class var!"
24
+ d { bark } # bark = "woof!"
25
+ d { Foo::module_method } # Foo::module_method = "hi!!"
26
+
27
+ hsh = {:foo => "bar", "key" => "value"}
28
+ array = [1,2,3,4,"5"]
29
+
30
+ d { hsh }
31
+ d { array }
data/init.rb ADDED
@@ -0,0 +1,2 @@
1
+ require File.join(File.dirname(__FILE__), *%w[lib log_buddy])
2
+ LogBuddy.init unless ENV["SAFE_LOG_BUDDY"]
@@ -4,7 +4,7 @@ module LogBuddy
4
4
  BACKTRACE_SIZE = 0..5
5
5
 
6
6
  def self.log_gems!
7
- Gem.send :include, LogBuddy::GemLogger
7
+ ::Gem.send :include, LogBuddy::GemLogger
8
8
  end
9
9
 
10
10
  def self.included(mod)
@@ -21,4 +21,4 @@ module LogBuddy
21
21
 
22
22
  end
23
23
  end
24
- end
24
+ end
data/log_buddy.gemspec ADDED
@@ -0,0 +1,64 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{log_buddy}
5
+ s.version = "0.4.12"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Rob Sanheim"]
9
+ s.date = %q{2009-05-22}
10
+ s.description = %q{Log statements along with their name easily. Mixin a logger everywhere when you need it.}
11
+ s.email = %q{rsanheim@gmail.com}
12
+ s.extra_rdoc_files = [
13
+ "LICENSE",
14
+ "README.markdown"
15
+ ]
16
+ s.files = [
17
+ ".gitignore",
18
+ ".treasure_map.rb",
19
+ "CHANGELOG",
20
+ "LICENSE",
21
+ "README.markdown",
22
+ "Rakefile",
23
+ "VERSION.yml",
24
+ "examples.rb",
25
+ "examples/log_buddy/example_helper.rb",
26
+ "examples/log_buddy/gem_logger_example.rb",
27
+ "examples/log_buddy/log_buddy_example.rb",
28
+ "examples/log_buddy/log_buddy_init_example.rb",
29
+ "examples/log_buddy/log_example.rb",
30
+ "init.rb",
31
+ "lib/log_buddy.rb",
32
+ "lib/log_buddy/gem_logger.rb",
33
+ "lib/log_buddy/mixin.rb",
34
+ "lib/log_buddy/utils.rb",
35
+ "lib/log_buddy/version.rb",
36
+ "log_buddy.gemspec"
37
+ ]
38
+ s.homepage = %q{http://github.com/relevance/log_buddy}
39
+ s.rdoc_options = ["--charset=UTF-8"]
40
+ s.require_paths = ["lib"]
41
+ s.rubyforge_project = %q{thinkrelevance}
42
+ s.rubygems_version = %q{1.3.3}
43
+ s.summary = %q{Log Buddy is your little development buddy.}
44
+ s.test_files = [
45
+ "examples/log_buddy/example_helper.rb",
46
+ "examples/log_buddy/gem_logger_example.rb",
47
+ "examples/log_buddy/log_buddy_example.rb",
48
+ "examples/log_buddy/log_buddy_init_example.rb",
49
+ "examples/log_buddy/log_example.rb"
50
+ ]
51
+
52
+ if s.respond_to? :specification_version then
53
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
54
+ s.specification_version = 3
55
+
56
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
57
+ s.add_development_dependency(%q<spicycode-micronaut>, [">= 0"])
58
+ else
59
+ s.add_dependency(%q<spicycode-micronaut>, [">= 0"])
60
+ end
61
+ else
62
+ s.add_dependency(%q<spicycode-micronaut>, [">= 0"])
63
+ end
64
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_buddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Sanheim
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-20 00:00:00 -04:00
12
+ date: 2009-05-22 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -32,20 +32,26 @@ extra_rdoc_files:
32
32
  - LICENSE
33
33
  - README.markdown
34
34
  files:
35
+ - .gitignore
36
+ - .treasure_map.rb
37
+ - CHANGELOG
35
38
  - LICENSE
36
39
  - README.markdown
37
40
  - Rakefile
38
41
  - VERSION.yml
42
+ - examples.rb
39
43
  - examples/log_buddy/example_helper.rb
40
44
  - examples/log_buddy/gem_logger_example.rb
41
45
  - examples/log_buddy/log_buddy_example.rb
42
46
  - examples/log_buddy/log_buddy_init_example.rb
43
47
  - examples/log_buddy/log_example.rb
48
+ - init.rb
44
49
  - lib/log_buddy.rb
45
50
  - lib/log_buddy/gem_logger.rb
46
51
  - lib/log_buddy/mixin.rb
47
52
  - lib/log_buddy/utils.rb
48
53
  - lib/log_buddy/version.rb
54
+ - log_buddy.gemspec
49
55
  has_rdoc: true
50
56
  homepage: http://github.com/relevance/log_buddy
51
57
  licenses: []
@@ -70,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
76
  requirements: []
71
77
 
72
78
  rubyforge_project: thinkrelevance
73
- rubygems_version: 1.3.2
79
+ rubygems_version: 1.3.5
74
80
  signing_key:
75
81
  specification_version: 3
76
82
  summary: Log Buddy is your little development buddy.