Skip to content
Browse files

Copy default theme view files into new themes.

  • Loading branch information...
1 parent 62bbedb commit db3142bea075cbdaae3a2c122616ea318b457f76 @gma committed Apr 4, 2012
Showing with 14 additions and 2 deletions.
  1. +3 −0 CHANGES
  2. +4 −1 lib/nesta/commands.rb
  3. +7 −1 spec/commands_spec.rb
View
3 CHANGES
@@ -4,6 +4,9 @@
the file based caching library that Nesta ships with wasn't updated
to support it. (Rob Westgeest)
+ * The nesta script's theme:create command now copies default templates
+ into a new theme. (Jake Rayson)
+
= 0.9.13 / (3 March 2012)
* The nesta script has a new command; edit. You can pass it the path
View
5 lib/nesta/commands.rb
@@ -247,7 +247,10 @@ def execute
make_directories
copy_templates(
'themes/README.md' => "#{@theme_path}/README.md",
- 'themes/app.rb' => "#{@theme_path}/app.rb"
+ 'themes/app.rb' => "#{@theme_path}/app.rb",
+ 'themes/views/layout.haml' => "#{@theme_path}/views/layout.haml",
+ 'themes/views/page.haml' => "#{@theme_path}/views/page.haml",
+ 'themes/views/master.sass' => "#{@theme_path}/views/master.sass"
)
end
end
View
8 spec/commands_spec.rb
@@ -381,9 +381,15 @@ def should_exist(file)
should_exist('app.rb')
end
- it "should create public and view directories" do
+ it "should create public and views directories" do
should_exist("public/#{@name}")
should_exist('views')
end
+
+ it "should copy the default view templates into views" do
+ %w(layout.haml page.haml master.sass).each do |file|
+ should_exist("views/#{file}")
+ end
+ end
end
end

0 comments on commit db3142b

Please sign in to comment.
Something went wrong with that request. Please try again.