Skip to content

Commit

Permalink
Use source_root.
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesc Esplugas authored and cavalle committed Jun 27, 2010
1 parent 04e1878 commit 5c98d64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/generators/steak/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class InstallGenerator < Rails::Generators::Base
class_option :webrat, :desc => 'Use Webrat.', :type => :boolean
class_option :capybara, :desc => 'Use Capybara.', :type => :boolean

source_root File.join(File.dirname(__FILE__), 'templates')

desc <<DESC
Description:
Sets up Steak in your Rails project. This will generate the
Expand Down Expand Up @@ -35,9 +37,5 @@ def manifest
def driver
@driver = options.webrat? ? 'webrat' : 'capybara'
end

def self.source_root
File.join(File.dirname(__FILE__), 'templates')
end
end
end
6 changes: 2 additions & 4 deletions lib/generators/steak/spec_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module Steak
class SpecGenerator < Rails::Generators::NamedBase
source_root File.join(File.dirname(__FILE__), 'templates')

desc <<DESC
Description:
Create an acceptance spec for the feature NAME in the
Expand All @@ -19,9 +21,5 @@ def manifest
file_name.gsub!(/_spec$/,"")
template 'acceptance_spec.rb', File.join('spec/acceptance', class_path, "#{file_name}_spec.rb")
end

def self.source_root
File.join(File.dirname(__FILE__), 'templates')
end
end
end

0 comments on commit 5c98d64

Please sign in to comment.