ansi 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby CHANGED
@@ -8,8 +8,6 @@ authors:
8
8
  copyrights:
9
9
  - holder: Rubyworks
10
10
  year: '2009'
11
- replacements: []
12
- alternatives: []
13
11
  requirements:
14
12
  - name: detroit
15
13
  groups:
@@ -24,25 +22,34 @@ requirements:
24
22
  - test
25
23
  development: true
26
24
  dependencies: []
25
+ alternatives: []
27
26
  conflicts: []
28
27
  repositories:
29
28
  - uri: git://github.com/rubyworks/ansi.git
30
29
  scm: git
31
30
  name: upstream
32
31
  resources:
33
- home: http://rubyworks.github.com/ansi
34
- code: http://github.com/rubyworks/ansi
35
- docs: http://rubydoc.info/gems/ansi/frames
36
- mail: http://groups.google.com/group/rubyworks-mailinglist
32
+ - uri: http://rubyworks.github.com/ansi
33
+ label: Website
34
+ type: home
35
+ - uri: http://github.com/rubyworks/ansi
36
+ label: Source Code
37
+ type: code
38
+ - uri: http://rubydoc.info/gems/ansi/frames
39
+ label: Documentation
40
+ type: docs
41
+ - uri: http://groups.google.com/group/rubyworks-mailinglist
42
+ label: Mailing List
43
+ type: mail
44
+ categories: []
37
45
  extra: {}
38
46
  load_path:
39
47
  - lib
40
48
  revision: 0
49
+ name: ansi
50
+ title: ANSI
41
51
  created: '2009-08-01'
42
52
  summary: ANSI at your fingertips!
43
- title: ANSI
44
- version: 1.4.2
45
- name: ansi
46
53
  description: ! 'The ANSI project is a superlative collection of ANSI escape code related
47
54
  libraries
48
55
 
@@ -52,4 +59,5 @@ description: ! 'The ANSI project is a superlative collection of ANSI escape code
52
59
 
53
60
  language.'
54
61
  organization: Rubyworks
55
- date: '2012-01-29'
62
+ version: 1.4.3
63
+ date: '2012-06-28'
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #
4
+ # Setup QED.
5
+ #
6
+ config :qed, :profile=>:cov do
7
+ require 'simplecov'
8
+ SimpleCov.start do
9
+ coverage_dir 'log/coverage'
10
+ #add_group "RSpec", "lib/assay/rspec.rb"
11
+ end
12
+ end
13
+
File without changes
@@ -1,5 +1,18 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 1.4.3 | 2012-06-26
4
+
5
+ This release bring two small changes. The first improves support
6
+ for Windows by only rescuing LoadError when 'win32console' fails
7
+ to load. The second improves the heuritstics used for determining
8
+ the current terminal screen width.
9
+
10
+ Changes:
11
+
12
+ * Only rescue LoadError on windows require. (#9) [bug]
13
+ * Improvements for getting proper screen width.
14
+
15
+
3
16
  == 1.4.2 | 2012-01-29
4
17
 
5
18
  ANSI chains are a new feature inspired by Kazuyoshi Tlacaelel's Isna project.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -8,8 +8,6 @@ authors:
8
8
  copyrights:
9
9
  - holder: Rubyworks
10
10
  year: '2009'
11
- replacements: []
12
- alternatives: []
13
11
  requirements:
14
12
  - name: detroit
15
13
  groups:
@@ -24,25 +22,34 @@ requirements:
24
22
  - test
25
23
  development: true
26
24
  dependencies: []
25
+ alternatives: []
27
26
  conflicts: []
28
27
  repositories:
29
28
  - uri: git://github.com/rubyworks/ansi.git
30
29
  scm: git
31
30
  name: upstream
32
31
  resources:
33
- home: http://rubyworks.github.com/ansi
34
- code: http://github.com/rubyworks/ansi
35
- docs: http://rubydoc.info/gems/ansi/frames
36
- mail: http://groups.google.com/group/rubyworks-mailinglist
32
+ - uri: http://rubyworks.github.com/ansi
33
+ label: Website
34
+ type: home
35
+ - uri: http://github.com/rubyworks/ansi
36
+ label: Source Code
37
+ type: code
38
+ - uri: http://rubydoc.info/gems/ansi/frames
39
+ label: Documentation
40
+ type: docs
41
+ - uri: http://groups.google.com/group/rubyworks-mailinglist
42
+ label: Mailing List
43
+ type: mail
44
+ categories: []
37
45
  extra: {}
38
46
  load_path:
39
47
  - lib
40
48
  revision: 0
49
+ name: ansi
50
+ title: ANSI
41
51
  created: '2009-08-01'
42
52
  summary: ANSI at your fingertips!
43
- title: ANSI
44
- version: 1.4.2
45
- name: ansi
46
53
  description: ! 'The ANSI project is a superlative collection of ANSI escape code related
47
54
  libraries
48
55
 
@@ -52,4 +59,5 @@ description: ! 'The ANSI project is a superlative collection of ANSI escape code
52
59
 
53
60
  language.'
54
61
  organization: Rubyworks
55
- date: '2012-01-29'
62
+ version: 1.4.3
63
+ date: '2012-06-28'
@@ -3,7 +3,7 @@ module ANSI
3
3
  if RUBY_PLATFORM =~ /(win32|w32)/
4
4
  begin
5
5
  require 'Win32/Console/ANSI'
6
- rescue
6
+ rescue LoadError
7
7
  warn "ansi: 'gem install win32console' to use color on Windows"
8
8
  $ansi = false
9
9
  end
@@ -242,7 +242,7 @@ module ANSI
242
242
 
243
243
  # Remove ANSI codes from string or block value.
244
244
  #
245
- # @param [String]
245
+ # @param [String] string
246
246
  # String from which to remove ANSI codes.
247
247
  #
248
248
  # @return [String]
@@ -84,7 +84,10 @@ module ANSI
84
84
 
85
85
  # Set alignment ensuring value is a symbol.
86
86
  #
87
- # @param [Symbol] Either `:right`, `:left` or `:center`.
87
+ # @param [#to_sym] symbol
88
+ # Either `:right`, `:left` or `:center`.
89
+ #
90
+ # @return [Symbol] The given symbol.
88
91
  def align=(symbol)
89
92
  symbol = symbol.to_sym
90
93
  raise ArgumentError, "invalid alignment -- #{symbol.inspect}" \
@@ -110,10 +110,10 @@ module ANSI
110
110
  # Take two plain strings and produce colorized
111
111
  # versions of each highlighting their differences.
112
112
  #
113
- # @param [String] string1
113
+ # @param [String] x
114
114
  # First string to compare.
115
115
  #
116
- # @param [String] string2
116
+ # @param [String] y
117
117
  # Second string to compare.
118
118
  #
119
119
  # @return [Array<String>] The two difference strings.
@@ -61,6 +61,9 @@ module ANSI
61
61
  @total_overflow = boolv ? true : false
62
62
  end
63
63
 
64
+ # Get rid of warning about Kenrel method being redefined.
65
+ remove_method :format
66
+
64
67
  # Set format and format arguments.
65
68
  def format(format, *arguments)
66
69
  @format = format
@@ -220,7 +223,8 @@ module ANSI
220
223
  def title
221
224
  @title[0,13] + ":"
222
225
  end
223
- #
226
+
227
+ # TODO: Use Terminal.terminal_width instead.
224
228
  def get_width
225
229
  # FIXME: I don't know how portable it is.
226
230
  default_width = 80
@@ -228,7 +232,8 @@ module ANSI
228
232
  tiocgwinsz = 0x5413
229
233
  data = [0, 0, 0, 0].pack("SSSS")
230
234
  if @out.ioctl(tiocgwinsz, data) >= 0 then
231
- rows, cols, xpixels, ypixels = data.unpack("SSSS")
235
+ #rows, cols, xpixels, ypixels = data.unpack("SSSS")
236
+ cols = data.unpack("SSSS")[1]
232
237
  if cols >= 0 then cols else default_width end
233
238
  else
234
239
  default_width
@@ -117,8 +117,9 @@ class ANSI::String
117
117
  end
118
118
  self.class.new(new_text, new_marks)
119
119
  else
120
- nm = marks.select do |(i,c)|
121
- marks[0] == rng or ( marks[0] == rng + 1 && [:clear, :reset].include?(marks[1]) )
120
+ nm = marks.select do |(i, v)|
121
+ #marks[0] == rng or ( marks[0] == rng + 1 && [:clear, :reset].include?(marks[1]) )
122
+ i == rng or ( i == rng + 1 && [:clear, :reset].include?(v) )
122
123
  end
123
124
  self.class.new(text[rng,1], nm)
124
125
  end
@@ -56,8 +56,8 @@ module ANSI
56
56
 
57
57
  #
58
58
  def to_s #(fit=false)
59
- row_count = table.size
60
- col_count = table[0].size
59
+ #row_count = table.size
60
+ #col_count = table[0].size
61
61
 
62
62
  max = max_columns(fit)
63
63
 
@@ -134,6 +134,7 @@ module ANSI
134
134
  tmp = max_columns(fit).map{ |m| "%#{m}s" }.join(" | ")
135
135
  tmp = "| #{tmp} |"
136
136
  lin = (tmp % (['-'] * column_size)).gsub(/[^\|]/, '-').gsub('|', '+')
137
+ lin
137
138
  end
138
139
 
139
140
  #def dividing_line_top
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ansi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-01-29 00:00:00.000000000 Z
13
+ date: 2012-06-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: detroit
17
- requirement: &31273700 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,15 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *31273700
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
26
31
  - !ruby/object:Gem::Dependency
27
32
  name: qed
28
- requirement: &31273100 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
29
34
  none: false
30
35
  requirements:
31
36
  - - ! '>='
@@ -33,10 +38,15 @@ dependencies:
33
38
  version: '0'
34
39
  type: :development
35
40
  prerelease: false
36
- version_requirements: *31273100
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
37
47
  - !ruby/object:Gem::Dependency
38
48
  name: lemon
39
- requirement: &31272580 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
40
50
  none: false
41
51
  requirements:
42
52
  - - ! '>='
@@ -44,7 +54,12 @@ dependencies:
44
54
  version: '0'
45
55
  type: :development
46
56
  prerelease: false
47
- version_requirements: *31272580
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
48
63
  description: ! 'The ANSI project is a superlative collection of ANSI escape code related
49
64
  libraries
50
65
 
@@ -59,9 +74,9 @@ executables: []
59
74
  extensions: []
60
75
  extra_rdoc_files:
61
76
  - HISTORY.rdoc
62
- - README.rdoc
63
- - QED.rdoc
77
+ - DEMO.rdoc
64
78
  - COPYING.rdoc
79
+ - README.rdoc
65
80
  files:
66
81
  - .ruby
67
82
  - .yardopts
@@ -87,28 +102,29 @@ files:
87
102
  - lib/ansi/version.rb
88
103
  - lib/ansi.rb
89
104
  - lib/ansi.yml
90
- - qed/01_ansicode.rdoc
91
- - qed/02_core.rdoc
92
- - qed/03_logger.rdoc
93
- - qed/04_progressbar.rdoc
94
- - qed/05_mixin.rdoc
95
- - qed/06_string.rdoc
96
- - qed/07_columns.rdoc
97
- - qed/08_table.rdoc
98
- - qed/09_diff.rdoc
99
- - qed/10_bbcode.rdoc
100
- - qed/11_terminal.rdoc
101
- - qed/applique/ae.rb
102
- - qed/applique/output.rb
105
+ - demo/01_ansicode.rdoc
106
+ - demo/02_core.rdoc
107
+ - demo/03_logger.rdoc
108
+ - demo/04_progressbar.rdoc
109
+ - demo/05_mixin.rdoc
110
+ - demo/06_string.rdoc
111
+ - demo/07_columns.rdoc
112
+ - demo/08_table.rdoc
113
+ - demo/09_diff.rdoc
114
+ - demo/10_bbcode.rdoc
115
+ - demo/11_terminal.rdoc
116
+ - demo/applique/ae.rb
117
+ - demo/applique/output.rb
103
118
  - test/case_ansicode.rb
104
119
  - test/case_bbcode.rb
105
120
  - test/case_mixin.rb
106
121
  - test/case_progressbar.rb
107
122
  - test/test_helper.rb
108
123
  - HISTORY.rdoc
109
- - README.rdoc
110
- - QED.rdoc
124
+ - DEMO.rdoc
111
125
  - COPYING.rdoc
126
+ - Config.rb
127
+ - README.rdoc
112
128
  homepage: http://rubyworks.github.com/ansi
113
129
  licenses: []
114
130
  post_install_message:
@@ -129,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
145
  version: '0'
130
146
  requirements: []
131
147
  rubyforge_project:
132
- rubygems_version: 1.8.10
148
+ rubygems_version: 1.8.24
133
149
  signing_key:
134
150
  specification_version: 3
135
151
  summary: ANSI at your fingertips!