File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -131,11 +131,14 @@ def source_paths
131
131
# Receives a file or directory and search for it in the source paths.
132
132
#
133
133
def find_in_source_paths ( file )
134
+ files = [ file , "#{ file } .tt" ]
134
135
relative_root = relative_to_original_destination_root ( destination_root , false )
135
136
136
137
source_paths . each do |source |
137
- source_file = File . expand_path ( file , File . join ( source , relative_root ) )
138
- return source_file if File . exist? ( source_file )
138
+ files . each do |f |
139
+ source_file = File . expand_path ( f , File . join ( source , relative_root ) )
140
+ return source_file if File . exist? ( source_file )
141
+ end
139
142
end
140
143
141
144
message = "Could not find #{ file . inspect } in any of your source paths. "
Original file line number Diff line number Diff line change @@ -184,6 +184,13 @@ def file
184
184
expect ( File . exists? ( file ) ) . to be true
185
185
end
186
186
187
+ it "accepts filename without .tt for template method" do
188
+ expect ( runner ) . to receive ( :file_name ) . and_return ( "rdoc" )
189
+ action :template , "doc/%file_name%.rb"
190
+ file = File . join ( destination_root , "doc/rdoc.rb" )
191
+ expect ( File . exists? ( file ) ) . to be true
192
+ end
193
+
187
194
it "logs status" do
188
195
expect ( capture ( :stdout ) { runner . template ( "doc/config.rb" ) } ) . to eq ( " create doc/config.rb\n " )
189
196
end
You can’t perform that action at this time.
0 commit comments