rails_extras 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,9 @@
|
|
1
1
|
class RailsExtras
|
2
2
|
module Helpers
|
3
3
|
module Tag
|
4
|
-
def add_tag(name=nil, options={}, &block)
|
4
|
+
def add_tag(name=nil, options_or_content={}, options={}, &block)
|
5
5
|
if block_given?
|
6
|
+
options = options_or_content
|
6
7
|
if block.arity == 1
|
7
8
|
result = ActiveSupport::SafeBuffer.new
|
8
9
|
def result.space(text)
|
@@ -29,6 +30,8 @@ class RailsExtras
|
|
29
30
|
block.call
|
30
31
|
end
|
31
32
|
end
|
33
|
+
else
|
34
|
+
content_tag(name, options_or_content, options)
|
32
35
|
end
|
33
36
|
end
|
34
37
|
|
data/lib/rails_extras/version.rb
CHANGED
@@ -35,12 +35,10 @@ describe ApplicationHelper do
|
|
35
35
|
end.should eq("<div class=\"example\">Example1 Example2</div>")
|
36
36
|
end
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
it "should generate content for div tag with empty content" do
|
39
|
+
helper.add_tag(:div, '', class: 'example').should eq("<div class=\"example\"></div>")
|
40
|
+
end
|
40
41
|
|
41
|
-
#it_behaves_like 'not_authorize_for', [:no_logged, :foreign], auth: :basic do
|
42
|
-
# value = 100
|
43
|
-
#end
|
44
42
|
end
|
45
43
|
|
46
44
|
describe ".add_link" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|