colorful_tables 0.5.0 → 0.5.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.
data/CHANGELOG ADDED
@@ -0,0 +1,7 @@
1
+ 0.5.1 (2012-05-30)
2
+
3
+ * digits_after_decimal_point is only a column option
4
+
5
+ 0.5.0 (2012-05-30)
6
+
7
+ * adding BigDecimal support when truncating
@@ -3,8 +3,8 @@ module ColorfulTables
3
3
  class Column
4
4
 
5
5
  DEFAULT_OPTIONS = {
6
- :data_color => :light_blue,
7
- :header_color => :light_blue,
6
+ :data_color => :light_blue,
7
+ :header_color => :light_blue,
8
8
  :digits_after_decimal_point => 4
9
9
  }
10
10
 
@@ -7,8 +7,7 @@ module ColorfulTables
7
7
  class Table
8
8
 
9
9
  DEFAULT_OPTIONS = {
10
- :border_color => :light_blue,
11
- :digits_after_decimal_point => 4
10
+ :border_color => :light_blue
12
11
  }
13
12
 
14
13
  attr_accessor :data, :options
@@ -67,7 +66,7 @@ module ColorfulTables
67
66
 
68
67
  def format(row_elements, in_header = false)
69
68
  output = row_elements.inject_with_index(@border_chars[:vertical]) do |s, element, index|
70
- value = ColorfulTables.truncate_if_decimals(element, @options[:digits_after_decimal_point])
69
+ value = ColorfulTables.truncate_if_decimals(element, @columns_options[index][:digits_after_decimal_point])
71
70
  color = if in_header
72
71
  @columns_options[index][:header_color]
73
72
  else
@@ -1,3 +1,3 @@
1
1
  module ColorfulTables
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colorful_tables
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Javier Vidal
@@ -42,6 +42,7 @@ extra_rdoc_files: []
42
42
 
43
43
  files:
44
44
  - .gitignore
45
+ - CHANGELOG
45
46
  - Gemfile
46
47
  - Rakefile
47
48
  - colorful_tables.gemspec