fusionary-easel_helpers 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +2 -1
- data/Rakefile +1 -1
- data/easel_helpers.gemspec +5 -5
- data/lib/easel_helpers/helpers/jquery_helper.rb +21 -0
- data/lib/easel_helpers/helpers.rb +2 -0
- data/test/jquery_helper_test.rb +29 -0
- metadata +6 -2
data/Manifest
CHANGED
@@ -2,6 +2,7 @@ easel_helpers.gemspec
|
|
2
2
|
lib/easel_helpers/helpers/date_helper.rb
|
3
3
|
lib/easel_helpers/helpers/form_helper.rb
|
4
4
|
lib/easel_helpers/helpers/grid_helper.rb
|
5
|
+
lib/easel_helpers/helpers/jquery_helper.rb
|
5
6
|
lib/easel_helpers/helpers/link_helper.rb
|
6
7
|
lib/easel_helpers/helpers/message_helper.rb
|
7
8
|
lib/easel_helpers/helpers/rjs_helper.rb
|
@@ -15,4 +16,4 @@ MIT-LICENSE
|
|
15
16
|
rails/init.rb
|
16
17
|
Rakefile
|
17
18
|
README.textile
|
18
|
-
tasks/easel_helpers_tasks.rake
|
19
|
+
tasks/easel_helpers_tasks.rake
|
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.2.
|
6
|
+
Echoe.new("easel_helpers", "0.2.10") 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,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{easel_helpers}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.10"
|
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-06-
|
9
|
+
s.date = %q{2009-06-12}
|
10
10
|
s.description = %q{Fusionary Rails View Helpers}
|
11
11
|
s.email = %q{joshua.clayton@gmail.com}
|
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/message_helper.rb", "lib/easel_helpers/helpers/rjs_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"]
|
13
|
-
s.files = ["easel_helpers.gemspec", "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/message_helper.rb", "lib/easel_helpers/helpers/rjs_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", "Manifest", "MIT-LICENSE", "rails/init.rb", "Rakefile", "README.textile", "tasks/easel_helpers_tasks.rake", "test/date_helper_test.rb", "test/form_helper_test.rb", "test/grid_helper_test.rb", "test/link_helper_test.rb", "test/message_helper_test.rb", "test/rjs_helper_test.rb", "test/structure_helper_test.rb", "test/table_helper_test.rb", "test/test_helper.rb"]
|
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/jquery_helper.rb", "lib/easel_helpers/helpers/link_helper.rb", "lib/easel_helpers/helpers/message_helper.rb", "lib/easel_helpers/helpers/rjs_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"]
|
13
|
+
s.files = ["easel_helpers.gemspec", "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/jquery_helper.rb", "lib/easel_helpers/helpers/link_helper.rb", "lib/easel_helpers/helpers/message_helper.rb", "lib/easel_helpers/helpers/rjs_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", "Manifest", "MIT-LICENSE", "rails/init.rb", "Rakefile", "README.textile", "tasks/easel_helpers_tasks.rake", "test/date_helper_test.rb", "test/form_helper_test.rb", "test/grid_helper_test.rb", "test/jquery_helper_test.rb", "test/link_helper_test.rb", "test/message_helper_test.rb", "test/rjs_helper_test.rb", "test/structure_helper_test.rb", "test/table_helper_test.rb", "test/test_helper.rb"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://github.com/fusionary/easel_helpers}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Easel_helpers", "--main", "README.textile"]
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.rubyforge_project = %q{easel_helpers}
|
19
19
|
s.rubygems_version = %q{1.3.2}
|
20
20
|
s.summary = %q{Fusionary Rails View Helpers}
|
21
|
-
s.test_files = ["test/date_helper_test.rb", "test/form_helper_test.rb", "test/grid_helper_test.rb", "test/link_helper_test.rb", "test/message_helper_test.rb", "test/rjs_helper_test.rb", "test/structure_helper_test.rb", "test/table_helper_test.rb", "test/test_helper.rb"]
|
21
|
+
s.test_files = ["test/date_helper_test.rb", "test/form_helper_test.rb", "test/grid_helper_test.rb", "test/jquery_helper_test.rb", "test/link_helper_test.rb", "test/message_helper_test.rb", "test/rjs_helper_test.rb", "test/structure_helper_test.rb", "test/table_helper_test.rb", "test/test_helper.rb"]
|
22
22
|
|
23
23
|
if s.respond_to? :specification_version then
|
24
24
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module EaselHelpers
|
2
|
+
module Helpers
|
3
|
+
module JqueryHelper
|
4
|
+
|
5
|
+
def document_ready(&block)
|
6
|
+
html = content_tag :script, :type => "text/javascript" do
|
7
|
+
%(
|
8
|
+
(function($) {
|
9
|
+
$(document).ready(function() {
|
10
|
+
#{capture(&block)}
|
11
|
+
});
|
12
|
+
})(jQuery);
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
concat(html)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -6,6 +6,7 @@ require "easel_helpers/helpers/table_helper"
|
|
6
6
|
require "easel_helpers/helpers/grid_helper"
|
7
7
|
require "easel_helpers/helpers/message_helper"
|
8
8
|
require "easel_helpers/helpers/rjs_helper"
|
9
|
+
require "easel_helpers/helpers/jquery_helper"
|
9
10
|
|
10
11
|
module EaselHelpers
|
11
12
|
module Helpers
|
@@ -17,6 +18,7 @@ module EaselHelpers
|
|
17
18
|
include GridHelper
|
18
19
|
include MessageHelper
|
19
20
|
include RjsHelper
|
21
|
+
include JqueryHelper
|
20
22
|
|
21
23
|
protected
|
22
24
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class JqueryHelperTest < EaselHelpers::ViewTestCase
|
4
|
+
|
5
|
+
context "document_ready" do
|
6
|
+
|
7
|
+
setup do
|
8
|
+
@whitespace = '\s+?'
|
9
|
+
@anything = '(.|\s)+?'
|
10
|
+
@anon_function_start_regex = '\(function\(\$\) \{'
|
11
|
+
@document_ready_start_regex = '\$\(document\)\.ready\(function\(\) \{'
|
12
|
+
|
13
|
+
@document_ready_end_regex = '\}\)\;'
|
14
|
+
@anon_function_end_regex = '\}\)\(jQuery\)\;'
|
15
|
+
end
|
16
|
+
|
17
|
+
should "properly build the document ready script tag" do
|
18
|
+
show_view %(
|
19
|
+
<% document_ready do %>
|
20
|
+
alert("hello!");
|
21
|
+
<% end %>
|
22
|
+
) do
|
23
|
+
assert_select "script[type=?]", "text/javascript", /#{@anon_function_start_regex}#{@whitespace}#{@document_ready_start_regex}#{@whitespace}alert#{@anything}#{@document_ready_end_regex}#{@whitespace}#{@anon_function_end_regex}/
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
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.2.
|
4
|
+
version: 0.2.10
|
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-06-
|
12
|
+
date: 2009-06-12 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -61,6 +61,7 @@ extra_rdoc_files:
|
|
61
61
|
- lib/easel_helpers/helpers/date_helper.rb
|
62
62
|
- lib/easel_helpers/helpers/form_helper.rb
|
63
63
|
- lib/easel_helpers/helpers/grid_helper.rb
|
64
|
+
- lib/easel_helpers/helpers/jquery_helper.rb
|
64
65
|
- lib/easel_helpers/helpers/link_helper.rb
|
65
66
|
- lib/easel_helpers/helpers/message_helper.rb
|
66
67
|
- lib/easel_helpers/helpers/rjs_helper.rb
|
@@ -76,6 +77,7 @@ files:
|
|
76
77
|
- lib/easel_helpers/helpers/date_helper.rb
|
77
78
|
- lib/easel_helpers/helpers/form_helper.rb
|
78
79
|
- lib/easel_helpers/helpers/grid_helper.rb
|
80
|
+
- lib/easel_helpers/helpers/jquery_helper.rb
|
79
81
|
- lib/easel_helpers/helpers/link_helper.rb
|
80
82
|
- lib/easel_helpers/helpers/message_helper.rb
|
81
83
|
- lib/easel_helpers/helpers/rjs_helper.rb
|
@@ -93,6 +95,7 @@ files:
|
|
93
95
|
- test/date_helper_test.rb
|
94
96
|
- test/form_helper_test.rb
|
95
97
|
- test/grid_helper_test.rb
|
98
|
+
- test/jquery_helper_test.rb
|
96
99
|
- test/link_helper_test.rb
|
97
100
|
- test/message_helper_test.rb
|
98
101
|
- test/rjs_helper_test.rb
|
@@ -134,6 +137,7 @@ test_files:
|
|
134
137
|
- test/date_helper_test.rb
|
135
138
|
- test/form_helper_test.rb
|
136
139
|
- test/grid_helper_test.rb
|
140
|
+
- test/jquery_helper_test.rb
|
137
141
|
- test/link_helper_test.rb
|
138
142
|
- test/message_helper_test.rb
|
139
143
|
- test/rjs_helper_test.rb
|