cheveret 2.0.0.rc1 → 2.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
data/cheveret.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cheveret}
8
- s.version = "2.0.0.rc1"
8
+ s.version = "2.0.0.rc2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Caldwell"]
12
- s.date = %q{2010-09-29}
12
+ s.date = %q{2010-10-01}
13
13
  s.description = %q{Generating HTML tables of data in the views of your Rails
14
14
  application is not very DRY even for the simpler of cases. Cheveret allows you to more
15
15
  clearly separate logic and templating and reduce the amount of code in your views.}
data/lib/cheveret/dsl.rb CHANGED
@@ -76,7 +76,7 @@ module Cheveret
76
76
  end
77
77
 
78
78
  if @columns[name].present?
79
- options.each { |k, v| @column[name].send(:"#{k}=", v) }
79
+ options.each { |k, v| @columns[name].send(:"#{k}=", v) }
80
80
  else
81
81
  @columns[name] = Column.new(name, options)
82
82
  end
@@ -24,7 +24,7 @@
24
24
  module Cheveret
25
25
  module Filtering
26
26
  def config(new_config)
27
- except, only = new_config[:except], new_config[:only]
27
+ except, only = new_config.delete(:except), new_config.delete(:only)
28
28
  if (except || only)
29
29
  @columns.reject! { |k, v| !only.include?(k) } if only
30
30
  # todo: support use of except
@@ -34,17 +34,17 @@ module Cheveret
34
34
  def header(options={})
35
35
  row = @columns.values.map do |column|
36
36
  cell(:th, column) do
37
- if column.sortable?
37
+ if column.sortable? # todo: abstract out sortable stuff
38
38
  content_tag(:a, column.label)
39
39
  else
40
- column.label
40
+ content_tag(:span, column.label)
41
41
  end
42
42
  end
43
43
  end
44
44
 
45
- content_tag(:div, row, {
46
- :class => 'thead'
47
- })
45
+ content_tag(:div, :class => 'thead') do
46
+ content_tag(:div, row, :class => 'tr')
47
+ end
48
48
  end
49
49
 
50
50
  def body(collection, options={})
@@ -41,7 +41,7 @@ module Cheveret
41
41
  end
42
42
 
43
43
  def config(new_config={})
44
- self.width = new_config[:width] if new_config[:width]
44
+ self.width = new_config.delete(:width) || self.width
45
45
  super
46
46
  end
47
47
 
@@ -26,7 +26,7 @@ module Cheveret
26
26
  MAJOR = 2
27
27
  MINOR = 0
28
28
  PATCH = 0
29
- BUILD = 'rc1'
29
+ BUILD = 'rc2'
30
30
 
31
31
  STRING = [ MAJOR, MINOR, PATCH, BUILD ].join('.')
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheveret
3
3
  version: !ruby/object:Gem::Version
4
- hash: 977940590
4
+ hash: 977940591
5
5
  prerelease: true
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
9
  - 0
10
- - rc1
11
- version: 2.0.0.rc1
10
+ - rc2
11
+ version: 2.0.0.rc2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Ben Caldwell
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-29 00:00:00 +10:00
19
+ date: 2010-10-01 00:00:00 +10:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency