lib/bundler/cli.rb in bundler-1.0.13 vs lib/bundler/cli.rb in bundler-1.0.14

- old
+ new

@@ -221,12 +221,11 @@ Installer.install(Bundler.root, Bundler.definition, opts) Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !options["no-cache"] if Bundler.settings[:path] - relative_path = Bundler.settings[:path] - relative_path = "./" + relative_path unless relative_path[0] == ?/ + relative_path = File.expand_path(Bundler.settings[:path]).sub(/^#{File.expand_path('.')}/, '.') Bundler.ui.confirm "Your bundle is complete! " + "It was installed into #{relative_path}" else Bundler.ui.confirm "Your bundle is complete! " + "Use `bundle show [gemname]` to see where a bundled gem is installed." @@ -478,11 +477,15 @@ def gem(name) target = File.join(Dir.pwd, name) constant_name = name.split('_').map{|p| p.capitalize}.join constant_name = constant_name.split('-').map{|q| q.capitalize}.join('::') if constant_name =~ /-/ constant_array = constant_name.split('::') + git_author_name = `git config user.name`.chomp + git_author_email = `git config user.email`.chomp + author_name = git_author_name.empty? ? "TODO: Write your name" : git_author_name + author_email = git_author_email.empty? ? "TODO: Write your email address" : git_author_email FileUtils.mkdir_p(File.join(target, 'lib', name)) - opts = {:name => name, :constant_name => constant_name, :constant_array => constant_array} + opts = {:name => name, :constant_name => constant_name, :constant_array => constant_array, :author_name => author_name, :author_email => author_email} template(File.join("newgem/Gemfile.tt"), File.join(target, "Gemfile"), opts) template(File.join("newgem/Rakefile.tt"), File.join(target, "Rakefile"), opts) template(File.join("newgem/gitignore.tt"), File.join(target, ".gitignore"), opts) template(File.join("newgem/newgem.gemspec.tt"), File.join(target, "#{name}.gemspec"), opts) template(File.join("newgem/lib/newgem.rb.tt"), File.join(target, "lib/#{name}.rb"), opts)