bruce-banner 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ desc 'load gem files into IRB'
4
+ task :console do
5
+ exec 'irb -Ilib -rbruce-banner'
6
+ end
@@ -41,11 +41,6 @@ module BruceBanner
41
41
  puts output.join "\n"
42
42
  end
43
43
 
44
- module Configuration
45
- attr_accessor :defaults
46
- end
47
-
48
-
49
44
  # this is where the magic happens...
50
45
  module ::Kernel
51
46
  # block magic shamelessly stolen from Jim Weirich (with a small tweak)
@@ -62,25 +57,26 @@ module BruceBanner
62
57
  options[:count] = [what.to_s.size, BruceBanner.defaults[:maximum]].min
63
58
  end
64
59
 
65
- puts(options[:string] * options[:count]) if options[:before]
66
- puts "#{what}"
67
- puts(options[:string] * options[:count]) if options[:after]
60
+ output = []
61
+ output << (options[:string] * options[:count]) if options[:before]
62
+ output << "#{what}"
63
+ output << (options[:string] * options[:count]) if options[:after]
64
+
65
+ puts output.join("\n")
68
66
  end
67
+ end
69
68
 
70
-
71
- # def debug(&block)
72
- # name = block.call.to_s
73
- # bb "#{name} = #{eval(name, block.binding)}"
74
- # end
69
+ module Configuration
70
+ attr_accessor :defaults
75
71
  end
76
72
 
73
+ extend Configuration
74
+
77
75
  # configure-ater-iter-voodoo
78
76
  def self.configuration
79
77
  yield(self.defaults) if block_given?
80
78
  end
81
79
 
82
- extend Configuration
83
-
84
80
  # Hulk SMASH!
85
81
  attr_accessor :defaults
86
82
 
@@ -1,3 +1,3 @@
1
1
  module BruceBanner
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bruce-banner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-24 00:00:00.000000000 Z
12
+ date: 2014-03-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: wraps `puts' output with a banner
15
15
  email:
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  requirements: []
48
48
  rubyforge_project:
49
- rubygems_version: 1.8.25
49
+ rubygems_version: 1.8.23
50
50
  signing_key:
51
51
  specification_version: 3
52
52
  summary: ! 'gem summary: I am a lazy bitch...hence the birth of this gem.'