formatador 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. data/formatador.gemspec +2 -2
  2. data/lib/formatador.rb +6 -2
  3. metadata +5 -7
@@ -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.2.0'
17
- s.date = '2011-07-14'
16
+ s.version = '0.2.1'
17
+ s.date = '2011-09-01'
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.2.0'
6
+ VERSION = '0.2.1'
7
7
 
8
8
  STYLES = {
9
9
  :"\/" => "0",
@@ -83,7 +83,7 @@ class Formatador
83
83
  if STDOUT.tty?
84
84
  string.gsub(PARSE_REGEX) { "\e[#{STYLES[$1.to_sym]}m" }.gsub(INDENT_REGEX) { indentation }
85
85
  else
86
- string.gsub(PARSE_REGEX, '').gsub(INDENT_REGEX) { indentation }
86
+ strip(string)
87
87
  end
88
88
  end
89
89
 
@@ -114,6 +114,10 @@ class Formatador
114
114
  nil
115
115
  end
116
116
 
117
+ def strip(string)
118
+ string.gsub(PARSE_REGEX, '').gsub(INDENT_REGEX) { indentation }
119
+ end
120
+
117
121
  %w{display display_line display_lines display_table display_compact_table indent parse redisplay redisplay_line new_line redisplay_progressbar}.each do |method|
118
122
  eval <<-DEF
119
123
  def self.#{method}(*args, &block)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formatador
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - geemus (Wesley Beary)
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-14 00:00:00 -05:00
19
- default_executable:
18
+ date: 2011-09-01 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: rake
@@ -65,7 +64,6 @@ files:
65
64
  - tests/basic_tests.rb
66
65
  - tests/table_tests.rb
67
66
  - tests/tests_helper.rb
68
- has_rdoc: true
69
67
  homepage: http://github.com/geemus/NAME
70
68
  licenses: []
71
69
 
@@ -95,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
93
  requirements: []
96
94
 
97
95
  rubyforge_project: formatador
98
- rubygems_version: 1.4.2
96
+ rubygems_version: 1.8.5
99
97
  signing_key:
100
98
  specification_version: 2
101
99
  summary: Ruby STDOUT text formatting