tabulatr 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tabulatr (0.0.2)
4
+ tabulatr (0.0.3)
5
5
  id_stuffer (>= 0.0.1)
6
6
  rails (~> 3.0)
7
7
  whiny_hash (>= 0.0.2)
@@ -36,6 +36,7 @@ GEM
36
36
  activemodel (= 3.0.5)
37
37
  activesupport (= 3.0.5)
38
38
  activesupport (3.0.5)
39
+ archive-tar-minitar (0.5.2)
39
40
  arel (2.0.9)
40
41
  builder (2.1.2)
41
42
  capybara (0.4.1.2)
@@ -65,7 +66,8 @@ GEM
65
66
  launchy (0.4.0)
66
67
  configuration (>= 0.0.5)
67
68
  rake (>= 0.8.1)
68
- linecache (0.43)
69
+ linecache19 (0.5.11)
70
+ ruby_core_source (>= 0.1.4)
69
71
  mail (2.2.15)
70
72
  activesupport (>= 2.3.6)
71
73
  i18n (>= 0.4.0)
@@ -106,11 +108,16 @@ GEM
106
108
  activesupport (~> 3.0)
107
109
  railties (~> 3.0)
108
110
  rspec (~> 2.5.0)
109
- ruby-debug (0.10.4)
110
- columnize (>= 0.1)
111
- ruby-debug-base (~> 0.10.4.0)
112
- ruby-debug-base (0.10.4)
113
- linecache (>= 0.3)
111
+ ruby-debug-base19 (0.11.24)
112
+ columnize (>= 0.3.1)
113
+ linecache19 (>= 0.5.11)
114
+ ruby_core_source (>= 0.1.4)
115
+ ruby-debug19 (0.11.6)
116
+ columnize (>= 0.3.1)
117
+ linecache19 (>= 0.5.11)
118
+ ruby-debug-base19 (>= 0.11.19)
119
+ ruby_core_source (0.1.4)
120
+ archive-tar-minitar (>= 0.5.2)
114
121
  rubyzip (0.9.4)
115
122
  selenium-webdriver (0.1.3)
116
123
  childprocess (~> 0.1.5)
@@ -137,6 +144,6 @@ DEPENDENCIES
137
144
  launchy
138
145
  rspec
139
146
  rspec-rails
140
- ruby-debug
147
+ ruby-debug19
141
148
  sqlite3-ruby
142
149
  tabulatr!
@@ -11,7 +11,7 @@ We found ourselves reinventing the wheel in every project we made, by using
11
11
  * difterent ways of implementing selecting and batch actions,
12
12
  * different layouts.
13
13
 
14
- We finally thought that whilst gems like Formtastic or SimpleForm provide a really cool, uniform, and concise way to implement forms, it's time for a table builder. During a project with Magento (*shiver*) we decided that their general tables are quite reasonable, and enterprise-proven -- so that's our starting point.
14
+ We finally thought that whilst gems like Formtastic or SimpleForm provide a really cool, uniform, and concise way to implement forms, it's time for a table builder. During a project with Magento, we decided that their general tables are quite reasonable, and enterprise-proven -- so that's our starting point.
15
15
 
16
16
  h3. Visual Components
17
17
 
@@ -29,6 +29,19 @@ module Tabulatr::Finder
29
29
  # Called if SomeActveRecordSubclass::find_for_table(params) is called
30
30
  #
31
31
  def self.find_for_active_record_table(klaz, params, o={}, &block)
32
+ unless Tabulatr::SQL_OPTIONS[:like]
33
+ # get the correct like db-operator, can still be ovrrridden
34
+ case ActiveRecord::Base.connection.class.to_s
35
+ when "ActiveRecord::ConnectionAdapters::MysqlAdapter" then Tabulatr.sql_options(:like => 'LIKE')
36
+ when "ActiveRecord::ConnectionAdapters::PostgreSQLAdapter" then Tabulatr.sql_options(:like => 'ILIKE')
37
+ when "ActiveRecord::ConnectionAdapters::SQLiteAdapter" then Tabulatr.sql_options(:like => 'LIKE')
38
+ when "ActiveRecord::ConnectionAdapters::SQLite3Adapter" then Tabulatr.sql_options(:like => 'LIKE')
39
+ else
40
+ warn("Tabulatr Warning: Don't know which LIKE operator to use for the ConnectionAdapter '#{ActiveRecord::Base.connection.class}'.\n" +
41
+ "Please specify by `Tabulatr.sql_options(:like => '<likeoperator>')`")
42
+ Tabulatr.sql_options(:like => 'LIKE')
43
+ end
44
+ end
32
45
  form_options = Tabulatr.table_form_options
33
46
  cname = class_to_param(klaz)
34
47
  params ||= {}
@@ -53,7 +53,7 @@ class Tabulatr
53
53
  :unselect_filtered_class => 'select-btn', # class of the unselect filteredbutton
54
54
  :info_text_class => 'info-text', # class of the info text div
55
55
 
56
- :batch_actions_label => 'Batch :Action => ', # Text to show in front of the batch action select
56
+ :batch_actions_label => 'Batch Actions: ', # Text to show in front of the batch action select
57
57
  :batch_actions_type => :select, # :select or :button depending on the kind of input you want
58
58
  :batch_actions_class => 'batch-action-inputs', # class to apply on the batch action input elements
59
59
  :submit_label => 'Apply', # Text on the submit button
@@ -73,16 +73,15 @@ class Tabulatr
73
73
  :select_controls => [:select_all, :select_none, :select_visible, :unselect_visible,
74
74
  :select_filtered, :unselect_filtered],
75
75
 
76
-
77
- :image_path_prefix => '/images/tabulatr/',
78
- :pager_left_button => 'left.gif',
79
- :pager_left_button_inactive => 'left_off.gif',
80
- :pager_right_button => 'right.gif',
81
- :pager_right_button_inactive => 'right_off.gif',
82
- :sort_up_button => 'up.gif',
83
- :sort_up_button_inactive => 'up_off.gif',
84
- :sort_down_button => 'down.gif',
85
- :sort_down_button_inactive => 'down_off.gif',
76
+ :image_path_prefix => '/images/tabulatr/',
77
+ :pager_left_button => 'pager_arrow_left.gif',
78
+ :pager_left_button_inactive => 'pager_arrow_left_off.gif',
79
+ :pager_right_button => 'pager_arrow_right.gif',
80
+ :pager_right_button_inactive => 'pager_arrow_right_off.gif',
81
+ :sort_up_button => 'sort_arrow_up.gif',
82
+ :sort_up_button_inactive => 'sort_arrow_up_off.gif',
83
+ :sort_down_button => 'sort_arrow_down.gif',
84
+ :sort_down_button_inactive => 'sort_arrow_down_off.gif',
86
85
 
87
86
  :make_form => true, # whether or not to wrap the whole table (incl. controls) in a form
88
87
  :table_html => false, # a hash with html attributes for the table
@@ -173,7 +172,7 @@ class Tabulatr
173
172
 
174
173
  # Stupid hack
175
174
  SQL_OPTIONS = WhinyHash.new({
176
- :like => 'LIKE'
175
+ :like => nil
177
176
  })
178
177
 
179
178
  def self.finder_inject_options(n=nil)
@@ -1,3 +1,3 @@
1
1
  class Tabulatr
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,11 +1 @@
1
- Tabulatr.table_options :form_class => 'hooray',
2
- :image_path_prefix => '/images/tabulatr/',
3
- :pager_left_button => 'pager_arrow_left.gif',
4
- :pager_left_button_inactive => 'pager_arrow_left_off.gif',
5
- :pager_right_button => 'pager_arrow_right.gif',
6
- :pager_right_button_inactive => 'pager_arrow_right_off.gif',
7
- :sort_up_button => 'sort_arrow_up.gif',
8
- :sort_up_button_inactive => 'sort_arrow_up_off.gif',
9
- :sort_down_button => 'sort_arrow_down.gif',
10
- :sort_down_button_inactive => 'sort_arrow_down_off.gif'
11
-
1
+ Tabulatr.table_options :form_class => 'hooray'
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabulatr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 0
9
- - 3
10
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
11
10
  platform: ruby
12
11
  authors:
13
12
  - Peter Horn
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2011-03-19 00:00:00 +01:00
18
+ date: 2011-03-26 23:00:00 +01:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
@@ -27,7 +26,6 @@ dependencies:
27
26
  requirements:
28
27
  - - ~>
29
28
  - !ruby/object:Gem::Version
30
- hash: 7
31
29
  segments:
32
30
  - 3
33
31
  - 0
@@ -42,7 +40,6 @@ dependencies:
42
40
  requirements:
43
41
  - - ">="
44
42
  - !ruby/object:Gem::Version
45
- hash: 27
46
43
  segments:
47
44
  - 0
48
45
  - 0
@@ -58,7 +55,6 @@ dependencies:
58
55
  requirements:
59
56
  - - ">="
60
57
  - !ruby/object:Gem::Version
61
- hash: 29
62
58
  segments:
63
59
  - 0
64
60
  - 0
@@ -202,7 +198,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
202
198
  requirements:
203
199
  - - ">="
204
200
  - !ruby/object:Gem::Version
205
- hash: 3
206
201
  segments:
207
202
  - 0
208
203
  version: "0"
@@ -211,14 +206,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
206
  requirements:
212
207
  - - ">="
213
208
  - !ruby/object:Gem::Version
214
- hash: 3
215
209
  segments:
216
210
  - 0
217
211
  version: "0"
218
212
  requirements: []
219
213
 
220
214
  rubyforge_project: tabulatr
221
- rubygems_version: 1.4.2
215
+ rubygems_version: 1.3.7
222
216
  signing_key:
223
217
  specification_version: 3
224
218
  summary: Tabulatr is a DSL to easily create tables for e.g. admin backends.