formatador 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/formatador.gemspec +2 -2
  2. data/lib/formatador.rb +11 -8
  3. metadata +3 -3
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'formatador'
16
- s.version = '0.0.15'
17
- s.date = '2010-07-19'
16
+ s.version = '0.0.16'
17
+ s.date = '2010-11-18'
18
18
  s.rubyforge_project = 'formatador'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), 'formatador', 'progressbar')
3
3
 
4
4
  class Formatador
5
5
 
6
- VERSION = '0.0.15'
6
+ VERSION = '0.0.16'
7
7
 
8
8
  STYLES = {
9
9
  :"\/" => "0",
@@ -73,7 +73,7 @@ class Formatador
73
73
  end
74
74
 
75
75
  def display_lines(lines = [])
76
- for line in lines
76
+ for line in [*lines]
77
77
  display_line(line)
78
78
  end
79
79
  nil
@@ -103,10 +103,11 @@ class Formatador
103
103
  nil
104
104
  end
105
105
 
106
- %w{display display_line display_lines display_table parse redisplay redisplay_progressbar}.each do |method|
106
+ %w{display display_line display_lines display_table indent parse redisplay redisplay_progressbar}.each do |method|
107
107
  eval <<-DEF
108
108
  def self.#{method}(*args, &block)
109
- new.#{method}(*args, &block)
109
+ Thread.current[:formatador] ||= new
110
+ Thread.current[:formatador].#{method}(*args, &block)
110
111
  end
111
112
  DEF
112
113
  end
@@ -116,10 +117,12 @@ end
116
117
  if __FILE__ == $0
117
118
 
118
119
  Formatador.display_line("[negative]Formatador![/]")
119
- Formatador.display_lines([
120
- 'one',
121
- 'two'
122
- ])
120
+ Formatador.indent do
121
+ Formatador.display_lines([
122
+ 'one',
123
+ 'two'
124
+ ])
125
+ end
123
126
  Formatador.display_table([], [:foo])
124
127
 
125
128
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 15
9
- version: 0.0.15
8
+ - 16
9
+ version: 0.0.16
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-19 00:00:00 -07:00
17
+ date: 2010-11-18 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies: []
20
20