lib/adhearsion/generators/plugin/plugin_generator.rb in adhearsion-2.4.0 vs lib/adhearsion/generators/plugin/plugin_generator.rb in adhearsion-2.5.0

- old
+ new

@@ -11,28 +11,29 @@ end def create_plugin @plugin_file = @plugin_name.underscore @plugin_name = @plugin_name.camelize - self.destination_root = '.' + self.destination_root = @plugin_file - empty_directory @plugin_file - empty_directory "#{@plugin_file}/lib" - empty_directory "#{@plugin_file}/lib/#{@plugin_file}" - empty_directory "#{@plugin_file}/spec" + empty_directory "lib" + empty_directory "lib/#{@plugin_file}" + empty_directory "spec" - template 'plugin-template.gemspec.tt', "#{@plugin_file}/#{@plugin_file}.gemspec" - template 'Rakefile.tt', "#{@plugin_file}/Rakefile" - template 'README.md.tt', "#{@plugin_file}/README.md" - template 'Gemfile.tt', "#{@plugin_file}/Gemfile" + copy_file "gitignore", ".gitignore" - template 'lib/plugin-template.rb.tt', "#{@plugin_file}/lib/#{@plugin_file}.rb" - template 'lib/plugin-template/version.rb.tt', "#{@plugin_file}/lib/#{@plugin_file}/version.rb" - template 'lib/plugin-template/plugin.rb.tt', "#{@plugin_file}/lib/#{@plugin_file}/plugin.rb" - template 'lib/plugin-template/controller_methods.rb.tt', "#{@plugin_file}/lib/#{@plugin_file}/controller_methods.rb" + template 'plugin-template.gemspec.tt', "#{@plugin_file}.gemspec" + template 'Rakefile.tt', "Rakefile" + template 'README.md.tt', "README.md" + template 'Gemfile.tt', "Gemfile" - template 'spec/spec_helper.rb.tt', "#{@plugin_file}/spec/spec_helper.rb" - template 'spec/plugin-template/controller_methods_spec.rb.tt', "#{@plugin_file}/spec/#{@plugin_file}/controller_methods_spec.rb" + template 'lib/plugin-template.rb.tt', "lib/#{@plugin_file}.rb" + template 'lib/plugin-template/version.rb.tt', "lib/#{@plugin_file}/version.rb" + template 'lib/plugin-template/plugin.rb.tt', "lib/#{@plugin_file}/plugin.rb" + template 'lib/plugin-template/controller_methods.rb.tt', "lib/#{@plugin_file}/controller_methods.rb" + + template 'spec/spec_helper.rb.tt', "spec/spec_helper.rb" + template 'spec/plugin-template/controller_methods_spec.rb.tt', "spec/#{@plugin_file}/controller_methods_spec.rb" end end end end