deface 0.5.7 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +3 -0
- data/deface.gemspec +4 -2
- data/lib/deface/action_view_extensions.rb +4 -1
- data/spec/deface/template_spec.rb +11 -3
- metadata +25 -8
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/deface.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "deface"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.6.0"
|
4
4
|
|
5
5
|
s.authors = ["Brian D Quinn"]
|
6
6
|
s.description = "Deface is a library that allows you to customize ERB views in a Rails application without editing the underlying view."
|
@@ -16,5 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.summary = "Deface is a library that allows you to customize ERB views in Rails"
|
17
17
|
|
18
18
|
s.add_dependency('nokogiri', '~> 1.5.0')
|
19
|
-
s.add_dependency('rails', '>= 3.0.
|
19
|
+
s.add_dependency('rails', '>= 3.0.9')
|
20
|
+
|
21
|
+
s.add_development_dependency('rspec', '>= 2.6.0')
|
20
22
|
end
|
@@ -7,5 +7,8 @@ ActionView::Template.class_eval do
|
|
7
7
|
rails_initialize(source, identifier, handler, details)
|
8
8
|
end
|
9
9
|
end
|
10
|
+
|
10
11
|
#fix for Rails 3.1 not setting virutal_path anymore (BOO!)
|
11
|
-
ActionView::Resolver::Path
|
12
|
+
if defined?(ActionView::Resolver::Path)
|
13
|
+
ActionView::Resolver::Path.class_eval { alias_method :virtual, :to_s }
|
14
|
+
end
|
@@ -7,9 +7,13 @@ module ActionView
|
|
7
7
|
end
|
8
8
|
|
9
9
|
describe "with no overrides defined" do
|
10
|
-
before(:
|
10
|
+
before(:each) do
|
11
11
|
@updated_at = Time.now - 600
|
12
12
|
@template = ActionView::Template.new("<p>test</p>", "/some/path/to/file.erb", ActionView::Template::Handlers::ERB, {:virtual_path=>"posts/index", :format=>:html, :updated_at => @updated_at})
|
13
|
+
#stub for Rails < 3.1
|
14
|
+
unless defined?(@template.updated_at)
|
15
|
+
@template.stub(:updated_at).and_return(@updated_at)
|
16
|
+
end
|
13
17
|
end
|
14
18
|
|
15
19
|
it "should initialize new template object" do
|
@@ -23,13 +27,18 @@ module ActionView
|
|
23
27
|
it "should not change updated_at" do
|
24
28
|
@template.updated_at.should == @updated_at
|
25
29
|
end
|
30
|
+
|
26
31
|
end
|
27
32
|
|
28
33
|
describe "with a single remove override defined" do
|
29
|
-
before(:
|
34
|
+
before(:each) do
|
30
35
|
@updated_at = Time.now - 300
|
31
36
|
Deface::Override.new(:virtual_path => "posts/index", :name => "Posts#index", :remove => "p", :text => "<h1>Argh!</h1>")
|
32
37
|
@template = ActionView::Template.new("<p>test</p><%= raw(text) %>", "/some/path/to/file.erb", ActionView::Template::Handlers::ERB, {:virtual_path=>"posts/index", :format=>:html, :updated_at => @updated_at})
|
38
|
+
#stub for Rails < 3.1
|
39
|
+
unless defined?(@template.updated_at)
|
40
|
+
@template.stub(:updated_at).and_return(@updated_at + 500)
|
41
|
+
end
|
33
42
|
end
|
34
43
|
|
35
44
|
it "should return modified source" do
|
@@ -39,7 +48,6 @@ module ActionView
|
|
39
48
|
it "should change updated_at" do
|
40
49
|
@template.updated_at.should > @updated_at
|
41
50
|
end
|
42
|
-
|
43
51
|
end
|
44
52
|
|
45
53
|
describe "with a single replace override defined" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian D Quinn
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-25 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -42,14 +42,30 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
45
|
+
hash: 21
|
46
46
|
segments:
|
47
47
|
- 3
|
48
48
|
- 0
|
49
|
-
-
|
50
|
-
version: 3.0.
|
49
|
+
- 9
|
50
|
+
version: 3.0.9
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rspec
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 23
|
62
|
+
segments:
|
63
|
+
- 2
|
64
|
+
- 6
|
65
|
+
- 0
|
66
|
+
version: 2.6.0
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
53
69
|
description: Deface is a library that allows you to customize ERB views in a Rails application without editing the underlying view.
|
54
70
|
email: brian@railsdog.com
|
55
71
|
executables: []
|
@@ -60,6 +76,7 @@ extra_rdoc_files:
|
|
60
76
|
- README.markdown
|
61
77
|
files:
|
62
78
|
- .gitignore
|
79
|
+
- Gemfile
|
63
80
|
- MIT-LICENSE
|
64
81
|
- README.markdown
|
65
82
|
- Rakefile
|