Permalink
Browse files

fix #5. release 4.7.3

  • Loading branch information...
1 parent 2adb4ec commit 91f123a5838e8c0a9f0fce610526e3acc798a5eb @ahoward committed Aug 17, 2011
Showing with 24 additions and 7 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 lib/main.rb
  3. +6 −2 lib/main/program/instance_methods.rb
  4. +2 −3 main.gemspec
  5. +14 −0 test/main_test.rb
View
2 Rakefile
@@ -60,7 +60,7 @@ end
task :gemspec do
ignore_extensions = ['git', 'svn', 'tmp', /sw./, 'bak', 'gem']
ignore_directories = ['pkg']
- ignore_files = ['test/log']
+ ignore_files = ['test/log', 'a.rb']
shiteless =
lambda do |list|
View
2 lib/main.rb
@@ -1,7 +1,7 @@
module Main
# top level constants
#
- Main::VERSION = '4.7.2' unless
+ Main::VERSION = '4.7.3' unless
defined? Main::VERSION
def self.version() Main::VERSION end
View
8 lib/main/program/instance_methods.rb
@@ -79,8 +79,12 @@ def logger= log
when ::Logger, Logger
@logger = log
else
- @logger = Logger.new(*log)
- @logger.level = logger_level
+ if log.is_a?(Array)
+ @logger = Logger.new(*log)
+ else
+ @logger = Logger.new(log)
+ @logger.level = logger_level
+ end
end
end
@logger
View
5 main.gemspec
@@ -3,7 +3,7 @@
Gem::Specification::new do |spec|
spec.name = "main"
- spec.version = "4.7.2"
+ spec.version = "4.7.3"
spec.platform = Gem::Platform::RUBY
spec.summary = "main"
spec.description = "description: main kicks the ass"
@@ -14,7 +14,6 @@ Gem::Specification::new do |spec|
"README.erb",
"Rakefile",
"TODO",
- "a.rb",
"lib",
"lib/main",
"lib/main.rb",
@@ -61,7 +60,7 @@ Gem::Specification::new do |spec|
spec.add_dependency(*["arrayfields", "~> 4.7.4"])
- spec.add_dependency(*["chronic", "~> 0.3.0"])
+ spec.add_dependency(*["chronic", "~> 0.6.2"])
spec.extensions.push(*[])
View
14 test/main_test.rb
@@ -891,6 +891,20 @@ def test_0600
}
assert( src==dst, "appears finalizer did not run!?" )
end
+
+# logging
+#
+ def test_0700
+ argv = []
+ logger = nil
+ assert_nothing_raised{
+ main(argv){
+ define_method('run'){ self.logger = STDERR; logger = self.logger }
+ }
+ }
+ assert( logger.class==Main::Logger, "setting logger did not work" )
+ assert( logger.device==STDERR, "setting logger did not work" )
+ end
end

0 comments on commit 91f123a

Please sign in to comment.