fusionary-easel_helpers 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/easel_helpers.gemspec +2 -2
- data/lib/easel_helpers/helpers/grid_helper.rb +2 -2
- data/lib/easel_helpers/helpers.rb +2 -1
- data/test/grid_helper_test.rb +46 -2
- metadata +2 -2
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rake/testtask'
|
|
3
3
|
require 'rake/rdoctask'
|
4
4
|
require 'echoe'
|
5
5
|
|
6
|
-
Echoe.new("easel_helpers", "0.1.
|
6
|
+
Echoe.new("easel_helpers", "0.1.8") do |p|
|
7
7
|
p.description = "Fusionary Rails View Helpers"
|
8
8
|
p.url = "http://github.com/fusionary/easel_helpers"
|
9
9
|
p.author = "Joshua Clayton"
|
data/easel_helpers.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{easel_helpers}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.8"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Joshua Clayton"]
|
9
|
-
s.date = %q{2009-05-
|
9
|
+
s.date = %q{2009-05-08}
|
10
10
|
s.description = %q{Fusionary Rails View Helpers}
|
11
11
|
s.email = %q{joshua.clayton@gmail.com}
|
12
12
|
s.extra_rdoc_files = ["lib/easel_helpers/helpers/date_helper.rb", "lib/easel_helpers/helpers/form_helper.rb", "lib/easel_helpers/helpers/grid_helper.rb", "lib/easel_helpers/helpers/link_helper.rb", "lib/easel_helpers/helpers/structure_helper.rb", "lib/easel_helpers/helpers/table_helper.rb", "lib/easel_helpers/helpers.rb", "lib/easel_helpers/rails_partial_caching.rb", "lib/easel_helpers.rb", "README.textile", "tasks/easel_helpers_tasks.rake"]
|
@@ -97,8 +97,8 @@ module EaselHelpers
|
|
97
97
|
def application_width; 24; end
|
98
98
|
|
99
99
|
def increase_depth(size)
|
100
|
-
@_easel_current_width ||= []
|
101
|
-
@_easel_current_width.push @_easel_column_count.to_s
|
100
|
+
@_easel_current_width ||= [application_width.to_s]
|
101
|
+
@_easel_current_width.push @_easel_column_count.to_s unless @_easel_column_count.blank?
|
102
102
|
@_easel_column_count = size.to_s =~ /^\d+$/ ? size.to_s.to_i : (@_easel_column_count*MULTIPLES[size]).to_i
|
103
103
|
end
|
104
104
|
|
@@ -17,7 +17,7 @@ module EaselHelpers
|
|
17
17
|
protected
|
18
18
|
|
19
19
|
def other_than_grid?(classes)
|
20
|
-
(
|
20
|
+
(standardize_css_classes(classes).map(&:to_s) - EaselHelpers::Helpers::GridHelper::MULTIPLE_FRACTIONS).any?
|
21
21
|
end
|
22
22
|
|
23
23
|
def clean_css_classes(string_or_array, replace = {})
|
@@ -36,6 +36,7 @@ module EaselHelpers
|
|
36
36
|
fractions.each do |f|
|
37
37
|
css_classes.delete(f)
|
38
38
|
css_classes << self.send(f)
|
39
|
+
css_classes << last_column if f == "full" && @_easel_column_count != application_width
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
data/test/grid_helper_test.rb
CHANGED
@@ -59,6 +59,49 @@ class GridHelperTest < EaselHelpers::ViewTestCase
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
should "properly assign classes for generic helpers without column wrappers" do
|
63
|
+
template = %(
|
64
|
+
<% fieldset :hform, :half do %>
|
65
|
+
<% set :one_third do %>text<% end %>
|
66
|
+
<% set :two_thirds, :last do %>more text<% end %>
|
67
|
+
<% column do %>
|
68
|
+
<% column :one_third do %>one third<% end %>
|
69
|
+
<% column :two_thirds, :last do %>
|
70
|
+
<% column :half do %>half<% end %>
|
71
|
+
<% column :half, :last do %>last half<% end %>
|
72
|
+
<% end %>
|
73
|
+
<% end %>
|
74
|
+
<% end %>
|
75
|
+
<% column :one_third do %>
|
76
|
+
<% column :one_fourth do %>two wide<% end %>
|
77
|
+
<% column :half do %>four wide<% end %>
|
78
|
+
<% column :one_fourth, :last do %>two more wide<% end %>
|
79
|
+
<% end %>
|
80
|
+
<% recordset :one_sixth, :last do %>table<% end %>
|
81
|
+
)
|
82
|
+
|
83
|
+
show_view template do
|
84
|
+
assert_select "fieldset.hform.col-12" do
|
85
|
+
assert_select "div.col-4", "text"
|
86
|
+
assert_select "div.col-8.col-last", "more text"
|
87
|
+
|
88
|
+
assert_select "div.col-12.col-last" do
|
89
|
+
assert_select "div.col-4", "one third"
|
90
|
+
assert_select "div.col-8.col-last" do
|
91
|
+
assert_select "div.col-4", "half"
|
92
|
+
assert_select "div.col-4.col-last", "last half"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
assert_select "div.col-8" do
|
97
|
+
assert_select "div.col-2", "two wide"
|
98
|
+
assert_select "div.col-4", "four wide"
|
99
|
+
assert_select "div.col-2.col-last", "two more wide"
|
100
|
+
end
|
101
|
+
assert_select "table.col-4.col-last", "table"
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
62
105
|
should "properly assign classes for a deeply-nested view" do
|
63
106
|
template = %(
|
64
107
|
<% container do %>
|
@@ -71,7 +114,7 @@ class GridHelperTest < EaselHelpers::ViewTestCase
|
|
71
114
|
<% end %>
|
72
115
|
<% column :one_third do %>one third!<% end %>
|
73
116
|
<% column :one_sixth, :last do %>
|
74
|
-
<% fieldset :vform, :full
|
117
|
+
<% fieldset :vform, :full do %>
|
75
118
|
<% set do %>text<% end %>
|
76
119
|
<% end %>
|
77
120
|
<% end %>
|
@@ -99,4 +142,5 @@ class GridHelperTest < EaselHelpers::ViewTestCase
|
|
99
142
|
end
|
100
143
|
end
|
101
144
|
end
|
102
|
-
|
145
|
+
|
146
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fusionary-easel_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Clayton
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-08 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|