presenting 2.0.0 → 2.0.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.
Files changed (63) hide show
  1. data/LICENSE +20 -20
  2. data/README +10 -10
  3. data/Rakefile +22 -22
  4. data/app/assets/javascripts/search.js +13 -13
  5. data/app/assets/stylesheets/details-color.css +7 -7
  6. data/app/assets/stylesheets/details.css +10 -10
  7. data/app/assets/stylesheets/form.css +1 -1
  8. data/app/assets/stylesheets/grid-color.css +71 -71
  9. data/app/assets/stylesheets/grid.css +64 -64
  10. data/app/assets/stylesheets/search-color.css +16 -16
  11. data/app/assets/stylesheets/search.css +45 -45
  12. data/app/controllers/presentation/assets_controller.rb +42 -42
  13. data/app/views/presentations/_details.erb +11 -11
  14. data/app/views/presentations/_field_search.erb +14 -14
  15. data/app/views/presentations/_form.erb +20 -20
  16. data/app/views/presentations/_grid.erb +70 -70
  17. data/app/views/presentations/_search.erb +7 -7
  18. data/lib/presentation/base.rb +31 -31
  19. data/lib/presentation/details.rb +21 -21
  20. data/lib/presentation/field_search.rb +67 -67
  21. data/lib/presentation/form.rb +149 -149
  22. data/lib/presentation/grid.rb +162 -160
  23. data/lib/presentation/search.rb +9 -9
  24. data/lib/presenting/attribute.rb +51 -51
  25. data/lib/presenting/configurable.rb +10 -10
  26. data/lib/presenting/defaults.rb +10 -10
  27. data/lib/presenting/field_set.rb +26 -26
  28. data/lib/presenting/form_helpers.rb +51 -51
  29. data/lib/presenting/helpers.rb +114 -114
  30. data/lib/presenting/sanitize.rb +19 -19
  31. data/lib/presenting/search.rb +185 -185
  32. data/lib/presenting/sorting.rb +87 -87
  33. data/test/attribute_test.rb +61 -61
  34. data/test/configurable_test.rb +20 -20
  35. data/test/details_test.rb +68 -68
  36. data/test/field_search_test.rb +102 -102
  37. data/test/field_set_test.rb +46 -46
  38. data/test/grid_test.rb +246 -239
  39. data/test/helpers_test.rb +72 -72
  40. data/test/presenting_test.rb +15 -15
  41. data/test/r3/Gemfile +7 -7
  42. data/test/r3/Gemfile.lock +86 -82
  43. data/test/r3/config/application.rb +12 -12
  44. data/test/r3/config/boot.rb +6 -6
  45. data/test/r3/config/database.yml +22 -22
  46. data/test/r3/config/environment.rb +5 -5
  47. data/test/r3/config/environments/test.rb +35 -35
  48. data/test/r3/db/test.sqlite3 +0 -0
  49. data/test/r3/log/test.log +336 -0
  50. data/test/r3/public/javascripts/presenting/grid.js +0 -0
  51. data/test/r3/public/javascripts/presenting/search.js +13 -13
  52. data/test/r3/public/stylesheets/presenting/details-color.css +7 -7
  53. data/test/r3/public/stylesheets/presenting/details.css +10 -10
  54. data/test/r3/public/stylesheets/presenting/form.css +1 -1
  55. data/test/r3/public/stylesheets/presenting/grid-color.css +71 -71
  56. data/test/r3/public/stylesheets/presenting/grid.css +64 -64
  57. data/test/r3/public/stylesheets/presenting/search-color.css +16 -16
  58. data/test/r3/public/stylesheets/presenting/search.css +45 -45
  59. data/test/sanitize_test.rb +15 -15
  60. data/test/search_conditions_test.rb +137 -137
  61. data/test/search_test.rb +30 -30
  62. data/test/sorting_test.rb +63 -63
  63. metadata +74 -74
data/test/sorting_test.rb CHANGED
@@ -1,63 +1,63 @@
1
- require File.dirname(__FILE__) + '/test_helper'
2
-
3
- class SortingTest < Presenting::Test
4
- def setup
5
- @s = Presenting::Sorting.new
6
- end
7
-
8
- def test_assigning_a_simple_set_of_fields
9
- @s.fields = [:a]
10
- assert_equal 1, @s.fields.size
11
-
12
- assert_equal 'a', @s.fields[0].name
13
- assert_equal 'a', @s.fields[0].sql
14
- end
15
-
16
- def test_assigning_fields_with_custom_sql
17
- @s.fields = {:a => 'users.a'}
18
- assert_equal 1, @s.fields.size
19
-
20
- assert_equal 'a', @s.fields[0].name
21
- assert_equal 'users.a', @s.fields[0].sql
22
- end
23
-
24
- def test_assigning_default_sql
25
- @s.fields = {:a => 'users.a'}
26
- @s.default = [:a, 'desc']
27
- assert_equal "users.a DESC", @s.default
28
- end
29
-
30
- def test_the_default_default
31
- @s.fields = {:a => 'users.a'}
32
- assert_equal 'users.a ASC', @s.default
33
- end
34
-
35
- def test_generating_sorting_sql
36
- @s.fields = {:a => 'users.a', :b => 'users.b'}
37
-
38
- assert_equal 'users.a DESC', @s.to_sql({'a' => 'desc'})
39
- end
40
-
41
- def test_generating_sort_sql_with_no_known_fields
42
- @s.fields = {:a => 'users.a', :b => 'users.b'}
43
- @s.default = [:b, 'desc']
44
-
45
- assert_equal 'users.b DESC', @s.to_sql(nil)
46
- end
47
- end
48
-
49
- class SortingFieldTest < Presenting::Test
50
- def setup
51
- @f = Presenting::Sorting::Field.new
52
- end
53
-
54
- def test_assigning_a_symbol_name
55
- @f.name = :foo
56
- assert_equal 'foo', @f.name
57
- end
58
-
59
- def test_sql_defaults_to_name
60
- @f.name = :foo
61
- assert_equal 'foo', @f.sql
62
- end
63
- end
1
+ require File.dirname(__FILE__) + '/test_helper'
2
+
3
+ class SortingTest < Presenting::Test
4
+ def setup
5
+ @s = Presenting::Sorting.new
6
+ end
7
+
8
+ def test_assigning_a_simple_set_of_fields
9
+ @s.fields = [:a]
10
+ assert_equal 1, @s.fields.size
11
+
12
+ assert_equal 'a', @s.fields[0].name
13
+ assert_equal 'a', @s.fields[0].sql
14
+ end
15
+
16
+ def test_assigning_fields_with_custom_sql
17
+ @s.fields = {:a => 'users.a'}
18
+ assert_equal 1, @s.fields.size
19
+
20
+ assert_equal 'a', @s.fields[0].name
21
+ assert_equal 'users.a', @s.fields[0].sql
22
+ end
23
+
24
+ def test_assigning_default_sql
25
+ @s.fields = {:a => 'users.a'}
26
+ @s.default = [:a, 'desc']
27
+ assert_equal "users.a DESC", @s.default
28
+ end
29
+
30
+ def test_the_default_default
31
+ @s.fields = {:a => 'users.a'}
32
+ assert_equal 'users.a ASC', @s.default
33
+ end
34
+
35
+ def test_generating_sorting_sql
36
+ @s.fields = {:a => 'users.a', :b => 'users.b'}
37
+
38
+ assert_equal 'users.a DESC', @s.to_sql({'a' => 'desc'})
39
+ end
40
+
41
+ def test_generating_sort_sql_with_no_known_fields
42
+ @s.fields = {:a => 'users.a', :b => 'users.b'}
43
+ @s.default = [:b, 'desc']
44
+
45
+ assert_equal 'users.b DESC', @s.to_sql(nil)
46
+ end
47
+ end
48
+
49
+ class SortingFieldTest < Presenting::Test
50
+ def setup
51
+ @f = Presenting::Sorting::Field.new
52
+ end
53
+
54
+ def test_assigning_a_symbol_name
55
+ @f.name = :foo
56
+ assert_equal 'foo', @f.name
57
+ end
58
+
59
+ def test_sql_defaults_to_name
60
+ @f.name = :foo
61
+ assert_equal 'foo', @f.sql
62
+ end
63
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: presenting
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
5
- prerelease: false
4
+ hash: 13
5
+ prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 0
10
- version: 2.0.0
9
+ - 1
10
+ version: 2.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lance Ivy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-19 00:00:00 -04:00
18
+ date: 2011-11-17 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -41,77 +41,77 @@ extensions: []
41
41
  extra_rdoc_files: []
42
42
 
43
43
  files:
44
- - lib/presenting/sorting.rb
45
- - lib/presenting/helpers.rb
46
- - lib/presenting/form_helpers.rb
47
- - lib/presenting/view.rb
48
- - lib/presenting/search.rb
49
- - lib/presenting/field_set.rb
50
- - lib/presenting/sanitize.rb
51
- - lib/presenting/configurable.rb
52
- - lib/presenting/defaults.rb
53
- - lib/presenting/engine.rb
54
- - lib/presenting/attribute.rb
55
- - lib/presentation/form.rb
56
44
  - lib/presentation/base.rb
57
45
  - lib/presentation/details.rb
58
- - lib/presentation/search.rb
59
46
  - lib/presentation/field_search.rb
47
+ - lib/presentation/form.rb
60
48
  - lib/presentation/grid.rb
49
+ - lib/presentation/search.rb
50
+ - lib/presenting/attribute.rb
51
+ - lib/presenting/configurable.rb
52
+ - lib/presenting/defaults.rb
53
+ - lib/presenting/engine.rb
54
+ - lib/presenting/field_set.rb
55
+ - lib/presenting/form_helpers.rb
56
+ - lib/presenting/helpers.rb
57
+ - lib/presenting/sanitize.rb
58
+ - lib/presenting/search.rb
59
+ - lib/presenting/sorting.rb
60
+ - lib/presenting/view.rb
61
61
  - lib/presenting.rb
62
- - app/views/presentations/_details.erb
63
- - app/views/presentations/_grid.erb
64
- - app/views/presentations/_form.erb
65
- - app/views/presentations/_search.erb
66
- - app/views/presentations/_field_search.erb
67
- - app/assets/javascripts/search.js
68
62
  - app/assets/javascripts/grid.js
69
- - app/assets/stylesheets/search-color.css
70
- - app/assets/stylesheets/grid.css
71
- - app/assets/stylesheets/grid-color.css
72
- - app/assets/stylesheets/search.css
73
- - app/assets/stylesheets/details.css
63
+ - app/assets/javascripts/search.js
74
64
  - app/assets/stylesheets/details-color.css
65
+ - app/assets/stylesheets/details.css
75
66
  - app/assets/stylesheets/form.css
67
+ - app/assets/stylesheets/grid-color.css
68
+ - app/assets/stylesheets/grid.css
69
+ - app/assets/stylesheets/search-color.css
70
+ - app/assets/stylesheets/search.css
76
71
  - app/controllers/presentation/assets_controller.rb
72
+ - app/views/presentations/_details.erb
73
+ - app/views/presentations/_field_search.erb
74
+ - app/views/presentations/_form.erb
75
+ - app/views/presentations/_grid.erb
76
+ - app/views/presentations/_search.erb
77
77
  - LICENSE
78
78
  - README
79
79
  - Rakefile
80
80
  - config/routes.rb
81
- - test/test_helper.rb
82
- - test/field_set_test.rb
83
- - test/sorting_test.rb
84
- - test/grid_test.rb
85
81
  - test/assets_test.rb
82
+ - test/attribute_test.rb
83
+ - test/configurable_test.rb
86
84
  - test/details_test.rb
87
85
  - test/field_search_test.rb
88
- - test/attribute_test.rb
89
- - test/sanitize_test.rb
90
- - test/search_conditions_test.rb
86
+ - test/field_set_test.rb
91
87
  - test/form_test.rb
92
- - test/configurable_test.rb
93
- - test/presenting_test.rb
88
+ - test/grid_test.rb
94
89
  - test/helpers_test.rb
95
- - test/r3/Gemfile.lock
96
- - test/r3/log/test.log
97
- - test/r3/Gemfile
98
- - test/r3/config.ru
99
- - test/r3/db/test.sqlite3
100
- - test/r3/config/environment.rb
90
+ - test/presenting_test.rb
101
91
  - test/r3/config/application.rb
102
- - test/r3/config/database.yml
103
92
  - test/r3/config/boot.rb
93
+ - test/r3/config/database.yml
94
+ - test/r3/config/environment.rb
104
95
  - test/r3/config/environments/test.rb
105
- - test/r3/public/javascripts/presenting/search.js
96
+ - test/r3/config.ru
97
+ - test/r3/db/test.sqlite3
98
+ - test/r3/Gemfile
99
+ - test/r3/Gemfile.lock
100
+ - test/r3/log/test.log
106
101
  - test/r3/public/javascripts/presenting/grid.js
107
- - test/r3/public/stylesheets/presenting/search-color.css
108
- - test/r3/public/stylesheets/presenting/grid.css
109
- - test/r3/public/stylesheets/presenting/grid-color.css
110
- - test/r3/public/stylesheets/presenting/search.css
111
- - test/r3/public/stylesheets/presenting/details.css
102
+ - test/r3/public/javascripts/presenting/search.js
112
103
  - test/r3/public/stylesheets/presenting/details-color.css
104
+ - test/r3/public/stylesheets/presenting/details.css
113
105
  - test/r3/public/stylesheets/presenting/form.css
106
+ - test/r3/public/stylesheets/presenting/grid-color.css
107
+ - test/r3/public/stylesheets/presenting/grid.css
108
+ - test/r3/public/stylesheets/presenting/search-color.css
109
+ - test/r3/public/stylesheets/presenting/search.css
110
+ - test/sanitize_test.rb
111
+ - test/search_conditions_test.rb
114
112
  - test/search_test.rb
113
+ - test/sorting_test.rb
114
+ - test/test_helper.rb
115
115
  has_rdoc: true
116
116
  homepage: http://github.com/cainlevy/presenting
117
117
  licenses: []
@@ -142,42 +142,42 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  requirements: []
143
143
 
144
144
  rubyforge_project:
145
- rubygems_version: 1.3.7
145
+ rubygems_version: 1.6.2
146
146
  signing_key:
147
147
  specification_version: 3
148
148
  summary: component-style scaffolding helpers
149
149
  test_files:
150
- - test/test_helper.rb
151
- - test/field_set_test.rb
152
- - test/sorting_test.rb
153
- - test/grid_test.rb
154
150
  - test/assets_test.rb
151
+ - test/attribute_test.rb
152
+ - test/configurable_test.rb
155
153
  - test/details_test.rb
156
154
  - test/field_search_test.rb
157
- - test/attribute_test.rb
158
- - test/sanitize_test.rb
159
- - test/search_conditions_test.rb
155
+ - test/field_set_test.rb
160
156
  - test/form_test.rb
161
- - test/configurable_test.rb
162
- - test/presenting_test.rb
157
+ - test/grid_test.rb
163
158
  - test/helpers_test.rb
164
- - test/r3/Gemfile.lock
165
- - test/r3/log/test.log
166
- - test/r3/Gemfile
167
- - test/r3/config.ru
168
- - test/r3/db/test.sqlite3
169
- - test/r3/config/environment.rb
159
+ - test/presenting_test.rb
170
160
  - test/r3/config/application.rb
171
- - test/r3/config/database.yml
172
161
  - test/r3/config/boot.rb
162
+ - test/r3/config/database.yml
163
+ - test/r3/config/environment.rb
173
164
  - test/r3/config/environments/test.rb
174
- - test/r3/public/javascripts/presenting/search.js
165
+ - test/r3/config.ru
166
+ - test/r3/db/test.sqlite3
167
+ - test/r3/Gemfile
168
+ - test/r3/Gemfile.lock
169
+ - test/r3/log/test.log
175
170
  - test/r3/public/javascripts/presenting/grid.js
176
- - test/r3/public/stylesheets/presenting/search-color.css
177
- - test/r3/public/stylesheets/presenting/grid.css
178
- - test/r3/public/stylesheets/presenting/grid-color.css
179
- - test/r3/public/stylesheets/presenting/search.css
180
- - test/r3/public/stylesheets/presenting/details.css
171
+ - test/r3/public/javascripts/presenting/search.js
181
172
  - test/r3/public/stylesheets/presenting/details-color.css
173
+ - test/r3/public/stylesheets/presenting/details.css
182
174
  - test/r3/public/stylesheets/presenting/form.css
175
+ - test/r3/public/stylesheets/presenting/grid-color.css
176
+ - test/r3/public/stylesheets/presenting/grid.css
177
+ - test/r3/public/stylesheets/presenting/search-color.css
178
+ - test/r3/public/stylesheets/presenting/search.css
179
+ - test/sanitize_test.rb
180
+ - test/search_conditions_test.rb
183
181
  - test/search_test.rb
182
+ - test/sorting_test.rb
183
+ - test/test_helper.rb