rails3_artifactor 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -7,12 +7,12 @@ begin
|
|
7
7
|
gem.email = "kmandrup@gmail.com"
|
8
8
|
gem.homepage = "http://github.com/kristianmandrup/rails3_artifact_helper"
|
9
9
|
gem.authors = ["Kristian Mandrup"]
|
10
|
-
gem.add_development_dependency "rspec", "~> 2.0.0"
|
10
|
+
gem.add_development_dependency "rspec", "~> 2.0.0.beta.22"
|
11
11
|
|
12
|
-
gem.add_dependency "rspec", "~> 2.0.0"
|
12
|
+
gem.add_dependency "rspec", "~> 2.0.0.beta.22"
|
13
13
|
gem.add_dependency "require_all", "~> 1.1.0"
|
14
|
-
gem.add_dependency "sugar-high", "~> 0.2.
|
15
|
-
gem.add_dependency 'rails3_assist', "~> 0.2.
|
14
|
+
gem.add_dependency "sugar-high", "~> 0.2.5"
|
15
|
+
gem.add_dependency 'rails3_assist', "~> 0.2.7"
|
16
16
|
|
17
17
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
18
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -13,7 +13,7 @@ module Rails3::Assist::Artifact
|
|
13
13
|
dir = File.dirname(file_name)
|
14
14
|
FileUtils.mkdir_p dir if !File.directory?(dir)
|
15
15
|
|
16
|
-
content =
|
16
|
+
content = get_view_content(args) || yield if block
|
17
17
|
|
18
18
|
# abort if no content given
|
19
19
|
debug "Warning: Content must be passed in either as a :content hash or a block" if !content
|
@@ -58,7 +58,7 @@ module Rails3::Assist::Artifact
|
|
58
58
|
FileUtils.rm_f(file) if File.exist?(file)
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
61
|
+
def get_view_content args
|
62
62
|
args = args.flatten
|
63
63
|
case args.first
|
64
64
|
when Hash
|
@@ -45,7 +45,7 @@ module Rails3::Assist
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def use_helper type
|
48
|
-
return rails_assist(type) if [:file, :files, :directory].include?(type)
|
48
|
+
return rails_assist(type) if [:file, :files, :directory, :app].include?(type)
|
49
49
|
artifact_assist(type)
|
50
50
|
end
|
51
51
|
alias_method :load_helper, :use_helper
|
data/rails3_artifactor.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rails3_artifactor}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-15}
|
13
13
|
s.description = %q{Helpers for handling Rails 3 artifacts in general, such as CRUD operations etc.}
|
14
14
|
s.email = %q{kmandrup@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -130,24 +130,24 @@ Gem::Specification.new do |s|
|
|
130
130
|
s.specification_version = 3
|
131
131
|
|
132
132
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
133
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.0.0"])
|
134
|
-
s.add_runtime_dependency(%q<rspec>, ["~> 2.0.0"])
|
133
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
134
|
+
s.add_runtime_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
135
135
|
s.add_runtime_dependency(%q<require_all>, ["~> 1.1.0"])
|
136
|
-
s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.
|
137
|
-
s.add_runtime_dependency(%q<rails3_assist>, ["~> 0.2.
|
136
|
+
s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.5"])
|
137
|
+
s.add_runtime_dependency(%q<rails3_assist>, ["~> 0.2.7"])
|
138
138
|
else
|
139
|
-
s.add_dependency(%q<rspec>, ["~> 2.0.0"])
|
140
|
-
s.add_dependency(%q<rspec>, ["~> 2.0.0"])
|
139
|
+
s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
140
|
+
s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
141
141
|
s.add_dependency(%q<require_all>, ["~> 1.1.0"])
|
142
|
-
s.add_dependency(%q<sugar-high>, ["~> 0.2.
|
143
|
-
s.add_dependency(%q<rails3_assist>, ["~> 0.2.
|
142
|
+
s.add_dependency(%q<sugar-high>, ["~> 0.2.5"])
|
143
|
+
s.add_dependency(%q<rails3_assist>, ["~> 0.2.7"])
|
144
144
|
end
|
145
145
|
else
|
146
|
-
s.add_dependency(%q<rspec>, ["~> 2.0.0"])
|
147
|
-
s.add_dependency(%q<rspec>, ["~> 2.0.0"])
|
146
|
+
s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
147
|
+
s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
148
148
|
s.add_dependency(%q<require_all>, ["~> 1.1.0"])
|
149
|
-
s.add_dependency(%q<sugar-high>, ["~> 0.2.
|
150
|
-
s.add_dependency(%q<rails3_assist>, ["~> 0.2.
|
149
|
+
s.add_dependency(%q<sugar-high>, ["~> 0.2.5"])
|
150
|
+
s.add_dependency(%q<rails3_assist>, ["~> 0.2.7"])
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
@@ -15,8 +15,24 @@ describe Rails3::Assist::Artifact::View::FileName do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#view_file_name' do
|
18
|
-
it "should return the file name for the persons/show view" do
|
18
|
+
it "should return the file name for the persons/show view with default action" do
|
19
|
+
CLASS.view_file_name(:person).should match 'views/person/show'.to_regexp
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should return the file name for the persons/show view with default type" do
|
19
23
|
CLASS.view_file_name(:person, :show).should match 'views/person/show'.to_regexp
|
20
24
|
end
|
25
|
+
|
26
|
+
it "should return the file name for the persons/show view with template type" do
|
27
|
+
CLASS.view_file_name(:person, :show, 'erb.hml').should match 'views/person/show'.to_regexp
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should return the file name for the persons/show view using hash" do
|
31
|
+
CLASS.view_file_name(:person, :action => :show, :type => 'erb.hml').should match 'views/person/show'.to_regexp
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should return the file name for the persons/show view with root path" do
|
35
|
+
CLASS.view_file_name(:person, :action => :show, :type => 'erb.hml', :root_path => Rails3::Assist::Directory.rails_root).should match 'views/person/show'.to_regexp
|
36
|
+
end
|
21
37
|
end
|
22
38
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristian Mandrup
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-15 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -29,7 +29,9 @@ dependencies:
|
|
29
29
|
- 2
|
30
30
|
- 0
|
31
31
|
- 0
|
32
|
-
|
32
|
+
- beta
|
33
|
+
- 22
|
34
|
+
version: 2.0.0.beta.22
|
33
35
|
type: :development
|
34
36
|
version_requirements: *id001
|
35
37
|
- !ruby/object:Gem::Dependency
|
@@ -44,7 +46,9 @@ dependencies:
|
|
44
46
|
- 2
|
45
47
|
- 0
|
46
48
|
- 0
|
47
|
-
|
49
|
+
- beta
|
50
|
+
- 22
|
51
|
+
version: 2.0.0.beta.22
|
48
52
|
type: :runtime
|
49
53
|
version_requirements: *id002
|
50
54
|
- !ruby/object:Gem::Dependency
|
@@ -73,8 +77,8 @@ dependencies:
|
|
73
77
|
segments:
|
74
78
|
- 0
|
75
79
|
- 2
|
76
|
-
-
|
77
|
-
version: 0.2.
|
80
|
+
- 5
|
81
|
+
version: 0.2.5
|
78
82
|
type: :runtime
|
79
83
|
version_requirements: *id004
|
80
84
|
- !ruby/object:Gem::Dependency
|
@@ -88,8 +92,8 @@ dependencies:
|
|
88
92
|
segments:
|
89
93
|
- 0
|
90
94
|
- 2
|
91
|
-
-
|
92
|
-
version: 0.2.
|
95
|
+
- 7
|
96
|
+
version: 0.2.7
|
93
97
|
type: :runtime
|
94
98
|
version_requirements: *id005
|
95
99
|
description: Helpers for handling Rails 3 artifacts in general, such as CRUD operations etc.
|