table-for 1.2.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,13 +1,22 @@
1
- 1.1.0 (February 4, 2012)
1
+ 2.0.0 (October 18, 2012)
2
+ * Upgraded to BuildingBlocks 2.0.0
3
+ * Renamed thead block to header, tbody to body, add added an empty footer block to the default table implementation
4
+ * Utilized features from BuildingBlocks 2.0.0, such as collection declaration of blocks, and collection rendering of blocks
5
+ * Current record being iterated over no longer needs to be passed in as a parameter to the block, but can be accessed via the table.current_record, such as:
6
+ <% table.column do %>
7
+ <%= table.current_record.name %>
8
+ <% end %>
9
+
10
+ 1.2.1 (February 9, 2012)
2
11
 
3
- * Removed dependency on rails 3.1, switched to >= 3.0.0
12
+ * Moved table_for_evaluated_options method into BuildingBlocks gem and renamed to evaluated_procs
13
+ * Also now utilizing a method created in BuildingBlocks called evaluated_proc
14
+ * The url for an edit, show, and delete link can now be a Proc that takes the current row's domain object as a paramter
4
15
 
5
16
  1.2.0 (February 5, 2012)
6
17
 
7
18
  * Upgraded dependency on BuildingBlocks to at least version 1.2.0
8
19
 
9
- 1.2.1 (February 9, 2012)
20
+ 1.1.0 (February 4, 2012)
10
21
 
11
- * Moved table_for_evaluated_options method into BuildingBlocks gem and renamed to evaluated_procs
12
- * Also now utilizing a method created in BuildingBlocks called evaluated_proc
13
- * The url for an edit, show, and delete link can now be a Proc that takes the current row's domain object as a paramter
22
+ * Removed dependency on rails 3.1, switched to >= 3.0.0
data/README.rdoc CHANGED
@@ -25,13 +25,13 @@ In users_controller.rb (index action)
25
25
  :sortable => true, :sort_url => users_path,
26
26
  :row_html => {:class => lambda { cycle('even', 'odd')},
27
27
  :id => lambda {|user| "user-#{user.id}"}} do |table| %>
28
- <%= table.column :edit, :link_label => "Modify" %>
29
- <%= table.column :show %>
30
- <%= table.column :email, :label => "Email Address" %>
31
- <%= table.column :label => "Full Name", :sortable => false, :header_html => {:style => "color:orange"} do |user| %>
28
+ <% table.column :edit, :link_label => "Modify" %>
29
+ <% table.column :show %>
30
+ <% table.column :email, :label => "Email Address" %>
31
+ <% table.column :label => "Full Name", :sortable => false, :header_html => {:style => "color:orange"} do |user| %>
32
32
  <%= "#{user.first_name} #{user.last_name}" %>
33
33
  <% end %>
34
- <%= table.column :delete, :confirm => "Are you sure?" %>
34
+ <% table.column :delete, :confirm => "Are you sure?" %>
35
35
  <% end %>
36
36
 
37
37
  == Specifying the Columns to Use
@@ -110,7 +110,6 @@ to determine what data to output in each column.
110
110
  <%= table_for @users, :header_html => {:class => lambda {|column| "header-column #{column.name}"} } do |table| %>
111
111
  <!-- Override this columns' header's html -->
112
112
  <% table.column :email, :header_html => {:style => "color: red"} %>
113
-
114
113
  <% table.column :first_name %>
115
114
  <% table.column :last_name %>
116
115
  <% end %>
@@ -119,14 +118,80 @@ to determine what data to output in each column.
119
118
  <%= table_for @users, :column_html => {:class => lambda {|column| "data-column #{column.name}"} } do |table| %>
120
119
  <!-- Override this column's html -->
121
120
  <% table.column :email, :column_html => {:style => "background-color: red"} %>
122
-
123
121
  <% table.column :first_name %>
124
122
  <% table.column :last_name %>
125
123
  <% end %>
126
124
 
127
125
  == Using Show, Edit, and Delete Columns
128
126
  <%= table_for @users do |table| %>
129
- <% table.column :edit, :url => lambda {|user| edit_user_path(user) } %>
130
- <% table.column :show %>
127
+ <!-- Standard show link -->
131
128
  <% table.column :show %>
129
+
130
+ <!-- Specify the controller action for the show link (used for generating the link) -->
131
+ <% table.column :show, :action => :display %>
132
+
133
+ <!-- Standard edit link -->
134
+ <% table.column :edit %>
135
+
136
+ <!-- Specify the text for the edit link -->
137
+ <% table.column :edit, :link_label => "Modify" %>
138
+
139
+ <!-- Specify the url for the edit link -->
140
+ <% table.column :edit, :url => lambda {|user| edit_user_path(user) } %>
141
+
142
+ <!-- Specify the controller action for the edit link (used for generating the link) -->
143
+ <% table.column :edit, :action => :modify %>
144
+
145
+ <!-- Specify the scope for the edit link (i.e. for nested resources) -->
146
+ <% table.column :edit, :scope => :admin %>
147
+
148
+ <!-- Specify the confirmation message for the confirm link -->
149
+ <% table.column :delete, :confirm => "Are you sure???" %>
150
+ <% end %>
151
+
152
+ == Using "Before" and "After" hooks
153
+ <!-- Adding a table footer -->
154
+ <%= table_for @users do |table| %>
155
+ <% table.column :email %>
156
+ <% table.define :footer do %>
157
+ <tfoot><tr><td colspan="<%= table.columns.length %>">My Footer</td></tr></tfoot>
158
+ <% end %>
159
+ <% end %>
160
+
161
+ <!-- Evaluating an expression before each row renders -->
162
+ <%= table_for @users do |table| %>
163
+ <% table.before :row do |user| %>
164
+ <!-- Perform some calculation -->
165
+ <% @evaluated_data = user.do_some_method %>
166
+ <% end %>
167
+ <% table.column :label => "First Column" do |user| %>
168
+ <!-- Use the stored value in some way -->
169
+ <%= @evaluated_data.method_1 %>
170
+ <% end %>
171
+ <% table.column :label => "Second Column" do |user| %>
172
+ <!-- Use the stored value in some other way -->
173
+ <%= @evaluated_data.method_2 %>
174
+ <% end %>
175
+ <% end %>
176
+
177
+ <!-- Adding a row before all the data rows -->
178
+ <%= table_for @users do |table| %>
179
+ <% table.before :rows do %>
180
+ <tr><td colspan="<%= table.columns.length %>">My First Row</td></tr>
181
+ <% end %>
182
+ <% table.column :email %>
183
+ <% end %>
184
+
185
+ == Changing the Default Way table_for Renders
186
+ <!-- Don't render thead and tbody tags -->
187
+ <%= table_for @users do |table| %>
188
+ <% table.define :table do |options| %>
189
+ <%= content_tag :table, options[:table_html] do %>
190
+ <!-- Instead of table.render :header, do this -->
191
+ <%= table.render :header_row %>
192
+ <!-- Instead of table.render :body, do this -->
193
+ <%= table.render :rows %>
194
+ <% end %>
195
+ <% end %>
196
+ <% table.column :email %>
132
197
  <% end %>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 2.0.0
@@ -1,11 +1,13 @@
1
1
  <% table.define :table do |options| %>
2
2
  <%= content_tag :table, options[:table_html] do %>
3
- <%= table.render :thead %>
4
- <%= table.render :tbody %>
3
+ <%= table.render :header %>
4
+ <%= table.render :body %>
5
+ <%# Purposely no default implementation for the tfoot block given, since most tables do not have footers. Block provided to for easy hook to add a footer %>
6
+ <%= table.render :footer %>
5
7
  <% end %>
6
8
  <% end %>
7
9
 
8
- <% table.define :thead do |options| %>
10
+ <% table.define :header do |options| %>
9
11
  <%= content_tag :thead, options[:thead_html] do %>
10
12
  <%= table.render :header_row %>
11
13
  <% end %>
@@ -13,13 +15,7 @@
13
15
 
14
16
  <% table.define :header_row do |options| %>
15
17
  <%= content_tag :tr, options[:header_row_html] do %>
16
- <%= table.render :header_columns %>
17
- <% end %>
18
- <% end %>
19
-
20
- <% table.define :header_columns do |options| %>
21
- <% table.columns.each do |column| %>
22
- <%= table.render :header_column, column, column.options %>
18
+ <%= table.render :header_column, :collection => table.columns %>
23
19
  <% end %>
24
20
  <% end %>
25
21
 
@@ -29,73 +25,59 @@
29
25
  <% end %>
30
26
  <% end %>
31
27
 
32
- <% table.define :edit_header do %><% end %>
33
-
34
- <% table.define :show_header do %><% end %>
35
-
36
- <% table.define :delete_header do %><% end %>
37
-
38
- <% table.columns.each do |column| %>
39
- <% table.define "#{column.name}_header" do |column, options| %>
40
- <% if options[:sortable] %>
41
- <%= table_for_sort_link(column, options) %>
42
- <% else %>
43
- <%= options[:label] ? options[:label] : column.name.to_s.titleize %>
44
- <% end %>
28
+ <%# Define header blocks for the edit, show, and delete columns (i.e. we want those columns to display with a blank header) %>
29
+ <% table.define(:edit_header) {} %>
30
+ <% table.define(:show_header) {} %>
31
+ <% table.define(:delete_header) {} %>
32
+
33
+ <%# Define a header block for each column, named using that column's name with the word "_header" appended to it %>
34
+ <% table.define lambda {|column| "#{column.name}_header" }, :collection => table.columns do |column, options| %>
35
+ <% if options[:sortable] %>
36
+ <%= table_for_sort_link(column, options) %>
37
+ <% else %>
38
+ <%= options[:label] ? options[:label] : column.name.to_s.titleize %>
45
39
  <% end %>
46
40
  <% end %>
47
41
 
48
- <% table.define :tbody do |options| %>
42
+ <% table.define :body do |options| %>
49
43
  <%= content_tag :tbody, options[:tbody_html] do %>
50
- <%= table.render :rows %>
51
- <% end %>
52
- <% end %>
53
-
54
- <% table.define :rows do |options| %>
55
- <% records.each do |record| %>
56
- <%= table.render :row, record %>
44
+ <%= table.render :row, :collection => records %>
57
45
  <% end %>
58
46
  <% end %>
59
47
 
60
48
  <% table.define :row do |record, options| %>
61
- <%= content_tag :tr, table.evaluated_procs(record, options[:row_html]) do %>
62
- <%= table.render :columns, record %>
63
- <% end %>
64
- <% end %>
65
-
66
- <% table.define :columns do |record, options| %>
67
- <% table.columns.each do |column| %>
68
- <%= table.render :column, record, column, column.options %>
49
+ <% table.set_current_record(record) %>
50
+ <%= content_tag :tr, table.evaluated_procs(options[:row_html], record) do %>
51
+ <%= table.render :column, record, :collection => table.columns %>
69
52
  <% end %>
70
53
  <% end %>
71
54
 
72
- <% table.define :column do |record, column, options| %>
73
- <%= content_tag :td, table.evaluated_procs(record, column, options[:column_html]) do %>
55
+ <% table.define :column do |column, record, options| %>
56
+ <%= content_tag :td, table.evaluated_procs(options[:column_html], record, column) do %>
74
57
  <%= table.render column.name, record, column, column.options %>
75
58
  <% end %>
76
59
  <% end %>
77
60
 
78
61
  <% table.define :edit, :action => :edit, :link_label => "Edit" do |record, column, options| %>
79
- <% url = options[:url] ? table.evaluated_proc(record, options[:url]) : [options[:action], options[:scope], record].flatten %>
62
+ <% url = options[:url] ? table.evaluated_proc(options[:url], record) : [options[:action], options[:scope], record].flatten %>
80
63
  <%= link_to options[:link_label], url, options[:link_html] %>
81
64
  <% end %>
82
65
 
83
66
  <% table.define :show, :action => nil, :link_label => "Show" do |record, column, options| %>
84
- <% url = options[:url] ? table.evaluated_proc(record, options[:url]) : [options[:action], options[:scope], record].flatten %>
67
+ <% url = options[:url] ? table.evaluated_proc(options[:url], record) : [options[:action], options[:scope], record].flatten %>
85
68
  <%= link_to options[:link_label], url, options[:link_html] %>
86
69
  <% end %>
87
70
 
88
71
  <% table.define :delete, :action => nil, :link_html => {}, :link_label => "Delete" do |record, column, options| %>
89
- <% url = options[:url] ? table.evaluated_proc(record, options[:url]) : [options[:action], options[:scope], record].flatten %>
72
+ <% url = options[:url] ? table.evaluated_proc(options[:url], record) : [options[:action], options[:scope], record].flatten %>
90
73
  <% confirm = options[:confirm] ? options[:confirm] : "Are you sure you want to delete this #{record.class.to_s.titleize}?" %>
91
74
  <% method = options[:method] ? options[:method] : "delete" %>
92
75
  <%= link_to options[:link_label], url, {:method => method, :confirm => confirm}.merge(options[:link_html]) %>
93
76
  <% end %>
94
77
 
95
- <% table.columns.each do |column| %>
96
- <% table.define "#{column.name}" do |record, column, options| %>
97
- <%= record.send(column.name) %>
98
- <% end %>
78
+ <%# Define a block for each column, named using that column's name %>
79
+ <% table.define lambda {|column| column.name }, :collection => table.columns do |record, column, options| %>
80
+ <%= record.send(column.name) %>
99
81
  <% end %>
100
82
 
101
- <%= table.render :table %>
83
+ <%= table.render :table %>
data/lib/table-for.rb CHANGED
@@ -1,5 +1 @@
1
- require "action_view"
2
-
3
- require "table_for/base"
4
- require "table_for/view_additions"
5
- require "table_for/engine"
1
+ require "table_for"
data/lib/table_for.rb ADDED
@@ -0,0 +1,10 @@
1
+ require "action_view"
2
+ require "table_for/engine"
3
+ require "building-blocks"
4
+
5
+ module TableFor
6
+ autoload :Base, "table_for/base"
7
+ autoload :ViewAdditions, "table_for/view_additions"
8
+ end
9
+
10
+ ActionView::Base.send :include, TableFor::ViewAdditions::ClassMethods
@@ -5,8 +5,14 @@ module TableFor
5
5
  alias columns queued_blocks
6
6
  alias column queue
7
7
 
8
+ attr_accessor :current_record
9
+
8
10
  def header(name, options={}, &block)
9
11
  define("#{name.to_s}_header", options, &block)
10
12
  end
13
+
14
+ def set_current_record(record)
15
+ self.current_record = record
16
+ end
11
17
  end
12
18
  end
@@ -2,12 +2,11 @@ module TableFor
2
2
  module ViewAdditions
3
3
  module ClassMethods
4
4
  def table_for(records, options={}, &block)
5
- options[:use_partials_for_before_and_after_hooks] = false
6
- TableFor::Base.new(self, options.merge(:variable => "table", :records => records)).render_template("table_for/table_for", &block)
5
+ TableFor::Base.new(self, options.merge(:variable => "table", :records => records, :use_partials => false)).render_template("table_for/table_for", &block)
7
6
  end
8
7
 
9
8
  def table_for_header_html(table, column, options={})
10
- header_html = table.evaluated_procs(column, options[:header_html])
9
+ header_html = table.evaluated_procs(options[:header_html], column)
11
10
  if options[:sortable]
12
11
  order = options[:order] ? options[:order].to_s : column.name.to_s
13
12
  sort_class = (params[:order] != order || params[:sort_mode] == "reset") ? "sorting" : (params[:sort_mode] == "desc" ? "sorting_desc" : "sorting_asc")
@@ -29,7 +28,3 @@ module TableFor
29
28
  end
30
29
  end
31
30
  end
32
-
33
- if defined?(ActionView::Base)
34
- ActionView::Base.send :include, TableFor::ViewAdditions::ClassMethods
35
- end
@@ -57,16 +57,16 @@ describe "table_for" do
57
57
  end
58
58
  end
59
59
 
60
- describe "thead block" do
60
+ describe "header block" do
61
61
  it "should be able to replace the thead block" do
62
62
  buffer = @view.table_for @users[0,1] do |table|
63
- table.define :thead do
64
- "<thead><tr><th>My new thead definition</th></tr></thead>".html_safe
63
+ table.define :header do
64
+ "<thead><tr><th>My new header definition</th></tr></thead>".html_safe
65
65
  end
66
66
  table.column :first_name
67
67
  end
68
68
 
69
- xml = XmlSimple.xml_in(%%<table><thead><tr><th>My new thead definition</th></tr></thead><tbody><tr><td>Andrew</td></tr></tbody></table>%)
69
+ xml = XmlSimple.xml_in(%%<table><thead><tr><th>My new header definition</th></tr></thead><tbody><tr><td>Andrew</td></tr></tbody></table>%)
70
70
  XmlSimple.xml_in(buffer, 'NormaliseSpace' => 2).should eql xml
71
71
  end
72
72
 
@@ -99,20 +99,6 @@ describe "table_for" do
99
99
  end
100
100
  end
101
101
 
102
- describe "header_columns block" do
103
- it "should be able to replace the header_columns block" do
104
- buffer = @view.table_for @users[0,1] do |table|
105
- table.define :header_columns do
106
- "<th>Column 1</th><th>Column 2</th>".html_safe
107
- end
108
- table.column :first_name
109
- end
110
-
111
- xml = XmlSimple.xml_in(%%<table><thead><tr><th>Column 1</th><th>Column 2</th></tr></thead><tbody><tr><td>Andrew</td></tr></tbody></table>%)
112
- XmlSimple.xml_in(buffer, 'NormaliseSpace' => 2).should eql xml
113
- end
114
- end
115
-
116
102
  describe "header_column block" do
117
103
  it "should be able to replace the header_columns block" do
118
104
  buffer = @view.table_for @users[0,1] do |table|
@@ -432,16 +418,16 @@ describe "table_for" do
432
418
  end
433
419
  end
434
420
 
435
- describe "tbody block" do
436
- it "should be able to replace the tbody block" do
421
+ describe "body block" do
422
+ it "should be able to replace the body block" do
437
423
  buffer = @view.table_for @users[0,1] do |table|
438
- table.define :tbody do
439
- "<tbody><tr><td>My new tbody definition</td></tr></tbody>".html_safe
424
+ table.define :body do
425
+ "<tbody><tr><td>My new body definition</td></tr></tbody>".html_safe
440
426
  end
441
427
  table.column :first_name
442
428
  end
443
429
 
444
- xml = XmlSimple.xml_in(%%<table><thead><tr><th>First Name</th></tr></thead><tbody><tr><td>My new tbody definition</td></tr></tbody></table>%)
430
+ xml = XmlSimple.xml_in(%%<table><thead><tr><th>First Name</th></tr></thead><tbody><tr><td>My new body definition</td></tr></tbody></table>%)
445
431
  XmlSimple.xml_in(buffer, 'NormaliseSpace' => 2).should eql xml
446
432
  end
447
433
 
@@ -452,24 +438,6 @@ describe "table_for" do
452
438
  end
453
439
  end
454
440
 
455
- describe "rows block" do
456
- it "should be able to replace the rows block" do
457
- buffer = @view.table_for @users do |table|
458
- table.define :rows do
459
- "<tr><td>There are #{@users.length} rows</td></tr><tr><td>This is the next row</td></tr>".html_safe
460
- end
461
- table.column :first_name
462
- end
463
-
464
- xml = XmlSimple.xml_in(%%
465
- <table>
466
- <thead><tr><th>First Name</th></tr></thead>
467
- <tbody><tr><td>There are 3 rows</td></tr><tr><td>This is the next row</td></tr></tbody>
468
- </table>%)
469
- XmlSimple.xml_in(buffer, 'NormaliseSpace' => 2).should eql xml
470
- end
471
- end
472
-
473
441
  describe "row block" do
474
442
  it "should be able to replace the row block" do
475
443
  buffer = @view.table_for @users do |table|
@@ -510,30 +478,10 @@ describe "table_for" do
510
478
  end
511
479
  end
512
480
 
513
- describe "columns block" do
514
- it "should be able to replace the columns block" do
515
- buffer = @view.table_for @users[0, 1] do |table|
516
- table.define :columns do |user|
517
- table.columns.map {|column| "<td>Value: #{user.send(column.name) if user.respond_to?(column.name)}</td>"}.join("").html_safe
518
- end
519
- table.column :first_name
520
- table.column :last_name
521
- table.column :some_random_column
522
- end
523
-
524
- xml = XmlSimple.xml_in(%%
525
- <table>
526
- <thead><tr><th>First Name</th><th>Last Name</th><th>Some Random Column</th></tr></thead>
527
- <tbody><tr><td>Value: Andrew</td><td>Value: Hunter</td><td>Value:</td></tr></tbody>
528
- </table>%)
529
- XmlSimple.xml_in(buffer, 'NormaliseSpace' => 2).should eql xml
530
- end
531
- end
532
-
533
481
  describe "column block" do
534
482
  it "should be able to replace the columns block" do
535
483
  buffer = @view.table_for @users[0, 1] do |table|
536
- table.define :column do |user, column, options|
484
+ table.define :column do |column, user, options|
537
485
  "<td>#{column.name.to_s.titleize} value is #{user.send(column.name)}</td>".html_safe
538
486
  end
539
487
  table.column :email
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table-for
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
- - 1
8
7
  - 2
9
- - 1
10
- version: 1.2.1
8
+ - 0
9
+ - 0
10
+ version: 2.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Hunter
@@ -15,11 +15,9 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-09 00:00:00 -05:00
19
- default_executable:
18
+ date: 2012-10-18 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- name: table-for
23
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
24
22
  none: false
25
23
  requirements:
@@ -29,11 +27,11 @@ dependencies:
29
27
  segments:
30
28
  - 0
31
29
  version: "0"
30
+ requirement: *id001
32
31
  prerelease: false
32
+ name: table-for
33
33
  type: :runtime
34
- requirement: *id001
35
34
  - !ruby/object:Gem::Dependency
36
- name: rails
37
35
  version_requirements: &id002 !ruby/object:Gem::Requirement
38
36
  none: false
39
37
  requirements:
@@ -45,27 +43,27 @@ dependencies:
45
43
  - 0
46
44
  - 0
47
45
  version: 3.0.0
46
+ requirement: *id002
48
47
  prerelease: false
48
+ name: rails
49
49
  type: :runtime
50
- requirement: *id002
51
50
  - !ruby/object:Gem::Dependency
52
- name: building-blocks
53
51
  version_requirements: &id003 !ruby/object:Gem::Requirement
54
52
  none: false
55
53
  requirements:
56
- - - ">="
54
+ - - ~>
57
55
  - !ruby/object:Gem::Version
58
- hash: 25
56
+ hash: 15
59
57
  segments:
60
- - 1
61
58
  - 2
62
- - 3
63
- version: 1.2.3
59
+ - 0
60
+ - 0
61
+ version: 2.0.0
62
+ requirement: *id003
64
63
  prerelease: false
64
+ name: building-blocks
65
65
  type: :runtime
66
- requirement: *id003
67
66
  - !ruby/object:Gem::Dependency
68
- name: jeweler
69
67
  version_requirements: &id004 !ruby/object:Gem::Requirement
70
68
  none: false
71
69
  requirements:
@@ -75,17 +73,17 @@ dependencies:
75
73
  segments:
76
74
  - 0
77
75
  version: "0"
76
+ requirement: *id004
78
77
  prerelease: false
78
+ name: jeweler
79
79
  type: :development
80
- requirement: *id004
81
80
  - !ruby/object:Gem::Dependency
82
- name: rspec-rails
83
81
  version_requirements: &id005 !ruby/object:Gem::Requirement
84
82
  none: false
85
83
  requirements:
86
84
  - - ">="
87
85
  - !ruby/object:Gem::Version
88
- hash: -4164648240
86
+ hash: 2118735021
89
87
  segments:
90
88
  - 2
91
89
  - 0
@@ -93,11 +91,11 @@ dependencies:
93
91
  - beta
94
92
  - 20
95
93
  version: 2.0.0.beta.20
94
+ requirement: *id005
96
95
  prerelease: false
96
+ name: rspec-rails
97
97
  type: :development
98
- requirement: *id005
99
98
  - !ruby/object:Gem::Dependency
100
- name: mocha
101
99
  version_requirements: &id006 !ruby/object:Gem::Requirement
102
100
  none: false
103
101
  requirements:
@@ -107,11 +105,11 @@ dependencies:
107
105
  segments:
108
106
  - 0
109
107
  version: "0"
108
+ requirement: *id006
110
109
  prerelease: false
110
+ name: mocha
111
111
  type: :development
112
- requirement: *id006
113
112
  - !ruby/object:Gem::Dependency
114
- name: xml-simple
115
113
  version_requirements: &id007 !ruby/object:Gem::Requirement
116
114
  none: false
117
115
  requirements:
@@ -121,11 +119,11 @@ dependencies:
121
119
  segments:
122
120
  - 0
123
121
  version: "0"
122
+ requirement: *id007
124
123
  prerelease: false
124
+ name: xml-simple
125
125
  type: :development
126
- requirement: *id007
127
126
  - !ruby/object:Gem::Dependency
128
- name: supermodel
129
127
  version_requirements: &id008 !ruby/object:Gem::Requirement
130
128
  none: false
131
129
  requirements:
@@ -135,11 +133,11 @@ dependencies:
135
133
  segments:
136
134
  - 0
137
135
  version: "0"
136
+ requirement: *id008
138
137
  prerelease: false
138
+ name: supermodel
139
139
  type: :development
140
- requirement: *id008
141
140
  - !ruby/object:Gem::Dependency
142
- name: sqlite3
143
141
  version_requirements: &id009 !ruby/object:Gem::Requirement
144
142
  none: false
145
143
  requirements:
@@ -149,11 +147,11 @@ dependencies:
149
147
  segments:
150
148
  - 0
151
149
  version: "0"
150
+ requirement: *id009
152
151
  prerelease: false
152
+ name: sqlite3
153
153
  type: :development
154
- requirement: *id009
155
154
  - !ruby/object:Gem::Dependency
156
- name: with_model
157
155
  version_requirements: &id010 !ruby/object:Gem::Requirement
158
156
  none: false
159
157
  requirements:
@@ -163,11 +161,11 @@ dependencies:
163
161
  segments:
164
162
  - 0
165
163
  version: "0"
164
+ requirement: *id010
166
165
  prerelease: false
166
+ name: with_model
167
167
  type: :development
168
- requirement: *id010
169
168
  - !ruby/object:Gem::Dependency
170
- name: jeweler
171
169
  version_requirements: &id011 !ruby/object:Gem::Requirement
172
170
  none: false
173
171
  requirements:
@@ -177,17 +175,17 @@ dependencies:
177
175
  segments:
178
176
  - 0
179
177
  version: "0"
178
+ requirement: *id011
180
179
  prerelease: false
180
+ name: jeweler
181
181
  type: :development
182
- requirement: *id011
183
182
  - !ruby/object:Gem::Dependency
184
- name: rspec-rails
185
183
  version_requirements: &id012 !ruby/object:Gem::Requirement
186
184
  none: false
187
185
  requirements:
188
186
  - - ">="
189
187
  - !ruby/object:Gem::Version
190
- hash: -4164648240
188
+ hash: 2118735021
191
189
  segments:
192
190
  - 2
193
191
  - 0
@@ -195,11 +193,11 @@ dependencies:
195
193
  - beta
196
194
  - 20
197
195
  version: 2.0.0.beta.20
196
+ requirement: *id012
198
197
  prerelease: false
198
+ name: rspec-rails
199
199
  type: :development
200
- requirement: *id012
201
200
  - !ruby/object:Gem::Dependency
202
- name: mocha
203
201
  version_requirements: &id013 !ruby/object:Gem::Requirement
204
202
  none: false
205
203
  requirements:
@@ -209,11 +207,11 @@ dependencies:
209
207
  segments:
210
208
  - 0
211
209
  version: "0"
210
+ requirement: *id013
212
211
  prerelease: false
212
+ name: mocha
213
213
  type: :development
214
- requirement: *id013
215
214
  - !ruby/object:Gem::Dependency
216
- name: xml-simple
217
215
  version_requirements: &id014 !ruby/object:Gem::Requirement
218
216
  none: false
219
217
  requirements:
@@ -223,11 +221,11 @@ dependencies:
223
221
  segments:
224
222
  - 0
225
223
  version: "0"
224
+ requirement: *id014
226
225
  prerelease: false
226
+ name: xml-simple
227
227
  type: :development
228
- requirement: *id014
229
228
  - !ruby/object:Gem::Dependency
230
- name: supermodel
231
229
  version_requirements: &id015 !ruby/object:Gem::Requirement
232
230
  none: false
233
231
  requirements:
@@ -237,11 +235,11 @@ dependencies:
237
235
  segments:
238
236
  - 0
239
237
  version: "0"
238
+ requirement: *id015
240
239
  prerelease: false
240
+ name: supermodel
241
241
  type: :development
242
- requirement: *id015
243
242
  - !ruby/object:Gem::Dependency
244
- name: sqlite3
245
243
  version_requirements: &id016 !ruby/object:Gem::Requirement
246
244
  none: false
247
245
  requirements:
@@ -251,11 +249,11 @@ dependencies:
251
249
  segments:
252
250
  - 0
253
251
  version: "0"
252
+ requirement: *id016
254
253
  prerelease: false
254
+ name: sqlite3
255
255
  type: :development
256
- requirement: *id016
257
256
  - !ruby/object:Gem::Dependency
258
- name: with_model
259
257
  version_requirements: &id017 !ruby/object:Gem::Requirement
260
258
  none: false
261
259
  requirements:
@@ -265,11 +263,11 @@ dependencies:
265
263
  segments:
266
264
  - 0
267
265
  version: "0"
266
+ requirement: *id017
268
267
  prerelease: false
268
+ name: with_model
269
269
  type: :development
270
- requirement: *id017
271
270
  - !ruby/object:Gem::Dependency
272
- name: jeweler
273
271
  version_requirements: &id018 !ruby/object:Gem::Requirement
274
272
  none: false
275
273
  requirements:
@@ -279,17 +277,17 @@ dependencies:
279
277
  segments:
280
278
  - 0
281
279
  version: "0"
280
+ requirement: *id018
282
281
  prerelease: false
282
+ name: jeweler
283
283
  type: :development
284
- requirement: *id018
285
284
  - !ruby/object:Gem::Dependency
286
- name: rspec-rails
287
285
  version_requirements: &id019 !ruby/object:Gem::Requirement
288
286
  none: false
289
287
  requirements:
290
288
  - - ">="
291
289
  - !ruby/object:Gem::Version
292
- hash: -4164648240
290
+ hash: 2118735021
293
291
  segments:
294
292
  - 2
295
293
  - 0
@@ -297,11 +295,11 @@ dependencies:
297
295
  - beta
298
296
  - 20
299
297
  version: 2.0.0.beta.20
298
+ requirement: *id019
300
299
  prerelease: false
300
+ name: rspec-rails
301
301
  type: :development
302
- requirement: *id019
303
302
  - !ruby/object:Gem::Dependency
304
- name: mocha
305
303
  version_requirements: &id020 !ruby/object:Gem::Requirement
306
304
  none: false
307
305
  requirements:
@@ -311,11 +309,11 @@ dependencies:
311
309
  segments:
312
310
  - 0
313
311
  version: "0"
312
+ requirement: *id020
314
313
  prerelease: false
314
+ name: mocha
315
315
  type: :development
316
- requirement: *id020
317
316
  - !ruby/object:Gem::Dependency
318
- name: xml-simple
319
317
  version_requirements: &id021 !ruby/object:Gem::Requirement
320
318
  none: false
321
319
  requirements:
@@ -325,11 +323,11 @@ dependencies:
325
323
  segments:
326
324
  - 0
327
325
  version: "0"
326
+ requirement: *id021
328
327
  prerelease: false
328
+ name: xml-simple
329
329
  type: :development
330
- requirement: *id021
331
330
  - !ruby/object:Gem::Dependency
332
- name: supermodel
333
331
  version_requirements: &id022 !ruby/object:Gem::Requirement
334
332
  none: false
335
333
  requirements:
@@ -339,11 +337,11 @@ dependencies:
339
337
  segments:
340
338
  - 0
341
339
  version: "0"
340
+ requirement: *id022
342
341
  prerelease: false
342
+ name: supermodel
343
343
  type: :development
344
- requirement: *id022
345
344
  - !ruby/object:Gem::Dependency
346
- name: sqlite3
347
345
  version_requirements: &id023 !ruby/object:Gem::Requirement
348
346
  none: false
349
347
  requirements:
@@ -353,11 +351,11 @@ dependencies:
353
351
  segments:
354
352
  - 0
355
353
  version: "0"
354
+ requirement: *id023
356
355
  prerelease: false
356
+ name: sqlite3
357
357
  type: :development
358
- requirement: *id023
359
358
  - !ruby/object:Gem::Dependency
360
- name: with_model
361
359
  version_requirements: &id024 !ruby/object:Gem::Requirement
362
360
  none: false
363
361
  requirements:
@@ -367,11 +365,11 @@ dependencies:
367
365
  segments:
368
366
  - 0
369
367
  version: "0"
368
+ requirement: *id024
370
369
  prerelease: false
370
+ name: with_model
371
371
  type: :development
372
- requirement: *id024
373
372
  - !ruby/object:Gem::Dependency
374
- name: jeweler
375
373
  version_requirements: &id025 !ruby/object:Gem::Requirement
376
374
  none: false
377
375
  requirements:
@@ -381,17 +379,17 @@ dependencies:
381
379
  segments:
382
380
  - 0
383
381
  version: "0"
382
+ requirement: *id025
384
383
  prerelease: false
384
+ name: jeweler
385
385
  type: :development
386
- requirement: *id025
387
386
  - !ruby/object:Gem::Dependency
388
- name: rspec-rails
389
387
  version_requirements: &id026 !ruby/object:Gem::Requirement
390
388
  none: false
391
389
  requirements:
392
390
  - - ">="
393
391
  - !ruby/object:Gem::Version
394
- hash: -4164648240
392
+ hash: 2118735021
395
393
  segments:
396
394
  - 2
397
395
  - 0
@@ -399,11 +397,11 @@ dependencies:
399
397
  - beta
400
398
  - 20
401
399
  version: 2.0.0.beta.20
400
+ requirement: *id026
402
401
  prerelease: false
402
+ name: rspec-rails
403
403
  type: :development
404
- requirement: *id026
405
404
  - !ruby/object:Gem::Dependency
406
- name: mocha
407
405
  version_requirements: &id027 !ruby/object:Gem::Requirement
408
406
  none: false
409
407
  requirements:
@@ -413,11 +411,11 @@ dependencies:
413
411
  segments:
414
412
  - 0
415
413
  version: "0"
414
+ requirement: *id027
416
415
  prerelease: false
416
+ name: mocha
417
417
  type: :development
418
- requirement: *id027
419
418
  - !ruby/object:Gem::Dependency
420
- name: xml-simple
421
419
  version_requirements: &id028 !ruby/object:Gem::Requirement
422
420
  none: false
423
421
  requirements:
@@ -427,11 +425,11 @@ dependencies:
427
425
  segments:
428
426
  - 0
429
427
  version: "0"
428
+ requirement: *id028
430
429
  prerelease: false
430
+ name: xml-simple
431
431
  type: :development
432
- requirement: *id028
433
432
  - !ruby/object:Gem::Dependency
434
- name: supermodel
435
433
  version_requirements: &id029 !ruby/object:Gem::Requirement
436
434
  none: false
437
435
  requirements:
@@ -441,11 +439,11 @@ dependencies:
441
439
  segments:
442
440
  - 0
443
441
  version: "0"
442
+ requirement: *id029
444
443
  prerelease: false
444
+ name: supermodel
445
445
  type: :development
446
- requirement: *id029
447
446
  - !ruby/object:Gem::Dependency
448
- name: sqlite3
449
447
  version_requirements: &id030 !ruby/object:Gem::Requirement
450
448
  none: false
451
449
  requirements:
@@ -455,11 +453,11 @@ dependencies:
455
453
  segments:
456
454
  - 0
457
455
  version: "0"
456
+ requirement: *id030
458
457
  prerelease: false
458
+ name: sqlite3
459
459
  type: :development
460
- requirement: *id030
461
460
  - !ruby/object:Gem::Dependency
462
- name: with_model
463
461
  version_requirements: &id031 !ruby/object:Gem::Requirement
464
462
  none: false
465
463
  requirements:
@@ -469,11 +467,11 @@ dependencies:
469
467
  segments:
470
468
  - 0
471
469
  version: "0"
470
+ requirement: *id031
472
471
  prerelease: false
472
+ name: with_model
473
473
  type: :development
474
- requirement: *id031
475
474
  - !ruby/object:Gem::Dependency
476
- name: jeweler
477
475
  version_requirements: &id032 !ruby/object:Gem::Requirement
478
476
  none: false
479
477
  requirements:
@@ -483,17 +481,17 @@ dependencies:
483
481
  segments:
484
482
  - 0
485
483
  version: "0"
484
+ requirement: *id032
486
485
  prerelease: false
486
+ name: jeweler
487
487
  type: :development
488
- requirement: *id032
489
488
  - !ruby/object:Gem::Dependency
490
- name: rspec-rails
491
489
  version_requirements: &id033 !ruby/object:Gem::Requirement
492
490
  none: false
493
491
  requirements:
494
492
  - - ">="
495
493
  - !ruby/object:Gem::Version
496
- hash: -4164648240
494
+ hash: 2118735021
497
495
  segments:
498
496
  - 2
499
497
  - 0
@@ -501,11 +499,11 @@ dependencies:
501
499
  - beta
502
500
  - 20
503
501
  version: 2.0.0.beta.20
502
+ requirement: *id033
504
503
  prerelease: false
504
+ name: rspec-rails
505
505
  type: :development
506
- requirement: *id033
507
506
  - !ruby/object:Gem::Dependency
508
- name: mocha
509
507
  version_requirements: &id034 !ruby/object:Gem::Requirement
510
508
  none: false
511
509
  requirements:
@@ -515,11 +513,11 @@ dependencies:
515
513
  segments:
516
514
  - 0
517
515
  version: "0"
516
+ requirement: *id034
518
517
  prerelease: false
518
+ name: mocha
519
519
  type: :development
520
- requirement: *id034
521
520
  - !ruby/object:Gem::Dependency
522
- name: xml-simple
523
521
  version_requirements: &id035 !ruby/object:Gem::Requirement
524
522
  none: false
525
523
  requirements:
@@ -529,11 +527,11 @@ dependencies:
529
527
  segments:
530
528
  - 0
531
529
  version: "0"
530
+ requirement: *id035
532
531
  prerelease: false
532
+ name: xml-simple
533
533
  type: :development
534
- requirement: *id035
535
534
  - !ruby/object:Gem::Dependency
536
- name: supermodel
537
535
  version_requirements: &id036 !ruby/object:Gem::Requirement
538
536
  none: false
539
537
  requirements:
@@ -543,11 +541,11 @@ dependencies:
543
541
  segments:
544
542
  - 0
545
543
  version: "0"
544
+ requirement: *id036
546
545
  prerelease: false
546
+ name: supermodel
547
547
  type: :development
548
- requirement: *id036
549
548
  - !ruby/object:Gem::Dependency
550
- name: sqlite3
551
549
  version_requirements: &id037 !ruby/object:Gem::Requirement
552
550
  none: false
553
551
  requirements:
@@ -557,11 +555,11 @@ dependencies:
557
555
  segments:
558
556
  - 0
559
557
  version: "0"
558
+ requirement: *id037
560
559
  prerelease: false
560
+ name: sqlite3
561
561
  type: :development
562
- requirement: *id037
563
562
  - !ruby/object:Gem::Dependency
564
- name: with_model
565
563
  version_requirements: &id038 !ruby/object:Gem::Requirement
566
564
  none: false
567
565
  requirements:
@@ -571,9 +569,112 @@ dependencies:
571
569
  segments:
572
570
  - 0
573
571
  version: "0"
572
+ requirement: *id038
574
573
  prerelease: false
574
+ name: with_model
575
+ type: :development
576
+ - !ruby/object:Gem::Dependency
577
+ version_requirements: &id039 !ruby/object:Gem::Requirement
578
+ none: false
579
+ requirements:
580
+ - - ">="
581
+ - !ruby/object:Gem::Version
582
+ hash: 3
583
+ segments:
584
+ - 0
585
+ version: "0"
586
+ requirement: *id039
587
+ prerelease: false
588
+ name: jeweler
589
+ type: :development
590
+ - !ruby/object:Gem::Dependency
591
+ version_requirements: &id040 !ruby/object:Gem::Requirement
592
+ none: false
593
+ requirements:
594
+ - - ">="
595
+ - !ruby/object:Gem::Version
596
+ hash: 2118735021
597
+ segments:
598
+ - 2
599
+ - 0
600
+ - 0
601
+ - beta
602
+ - 20
603
+ version: 2.0.0.beta.20
604
+ requirement: *id040
605
+ prerelease: false
606
+ name: rspec-rails
607
+ type: :development
608
+ - !ruby/object:Gem::Dependency
609
+ version_requirements: &id041 !ruby/object:Gem::Requirement
610
+ none: false
611
+ requirements:
612
+ - - ">="
613
+ - !ruby/object:Gem::Version
614
+ hash: 3
615
+ segments:
616
+ - 0
617
+ version: "0"
618
+ requirement: *id041
619
+ prerelease: false
620
+ name: mocha
621
+ type: :development
622
+ - !ruby/object:Gem::Dependency
623
+ version_requirements: &id042 !ruby/object:Gem::Requirement
624
+ none: false
625
+ requirements:
626
+ - - ">="
627
+ - !ruby/object:Gem::Version
628
+ hash: 3
629
+ segments:
630
+ - 0
631
+ version: "0"
632
+ requirement: *id042
633
+ prerelease: false
634
+ name: xml-simple
635
+ type: :development
636
+ - !ruby/object:Gem::Dependency
637
+ version_requirements: &id043 !ruby/object:Gem::Requirement
638
+ none: false
639
+ requirements:
640
+ - - ">="
641
+ - !ruby/object:Gem::Version
642
+ hash: 3
643
+ segments:
644
+ - 0
645
+ version: "0"
646
+ requirement: *id043
647
+ prerelease: false
648
+ name: supermodel
649
+ type: :development
650
+ - !ruby/object:Gem::Dependency
651
+ version_requirements: &id044 !ruby/object:Gem::Requirement
652
+ none: false
653
+ requirements:
654
+ - - ">="
655
+ - !ruby/object:Gem::Version
656
+ hash: 3
657
+ segments:
658
+ - 0
659
+ version: "0"
660
+ requirement: *id044
661
+ prerelease: false
662
+ name: sqlite3
663
+ type: :development
664
+ - !ruby/object:Gem::Dependency
665
+ version_requirements: &id045 !ruby/object:Gem::Requirement
666
+ none: false
667
+ requirements:
668
+ - - ">="
669
+ - !ruby/object:Gem::Version
670
+ hash: 3
671
+ segments:
672
+ - 0
673
+ version: "0"
674
+ requirement: *id045
675
+ prerelease: false
676
+ name: with_model
575
677
  type: :development
576
- requirement: *id038
577
678
  description: table-for is a table builder for an array of objects, easily allowing overriding of how any aspect of the table is generated
578
679
  email: hunterae@gmail.com
579
680
  executables: []
@@ -589,6 +690,7 @@ files:
589
690
  - VERSION
590
691
  - app/views/table_for/_table_for.html.erb
591
692
  - lib/table-for.rb
693
+ - lib/table_for.rb
592
694
  - lib/table_for/base.rb
593
695
  - lib/table_for/engine.rb
594
696
  - lib/table_for/view_additions.rb
@@ -596,7 +698,6 @@ files:
596
698
  - spec/integration/table_for_spec.rb
597
699
  - spec/spec_helper.rb
598
700
  - spec/table_for/view_additions_spec.rb
599
- has_rdoc: true
600
701
  homepage: http://github.com/hunterae/table-for
601
702
  licenses: []
602
703
 
@@ -626,7 +727,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
626
727
  requirements: []
627
728
 
628
729
  rubyforge_project:
629
- rubygems_version: 1.5.2
730
+ rubygems_version: 1.8.24
630
731
  signing_key:
631
732
  specification_version: 3
632
733
  summary: table-for is a table builder for an array of objects, easily allowing overriding of how any aspect of the table is generated