lib/bundler/cli/gem.rb in bundler-2.0.2 vs lib/bundler/cli/gem.rb in bundler-2.1.0.pre.1
- old
+ new
@@ -9,11 +9,11 @@
end
class CLI::Gem
TEST_FRAMEWORK_VERSIONS = {
"rspec" => "3.0",
- "minitest" => "5.0"
+ "minitest" => "5.0",
}.freeze
attr_reader :options, :gem_name, :thor, :name, :target
def initialize(options, gem_name, thor)
@@ -55,11 +55,11 @@
:email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
:test => options[:test],
:ext => options[:ext],
:exe => options[:exe],
:bundler_version => bundler_dependency_version,
- :github_username => github_username.empty? ? "[USERNAME]" : github_username
+ :github_username => github_username.empty? ? "[USERNAME]" : github_username,
}
ensure_safe_gem_name(name, constant_array)
templates = {
"Gemfile.tt" => "Gemfile",
@@ -67,11 +67,11 @@
"lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
"newgem.gemspec.tt" => "#{name}.gemspec",
"Rakefile.tt" => "Rakefile",
"README.md.tt" => "README.md",
"bin/console.tt" => "bin/console",
- "bin/setup.tt" => "bin/setup"
+ "bin/setup.tt" => "bin/setup",
}
executables = %w[
bin/console
bin/setup
@@ -146,11 +146,11 @@
executable = (path.stat.mode | 0o111)
path.chmod(executable)
end
end
- if Bundler.git_present?
+ if Bundler.git_present? && options[:git]
Bundler.ui.info "Initializing git repo in #{target}"
Dir.chdir(target) do
`git init`
`git add .`
end
@@ -188,10 +188,10 @@
return unless gem_name.index("-")
Bundler.ui.error "You have specified a gem name which does not conform to the \n" \
"naming guidelines for C extensions. For more information, \n" \
"see the 'Extension Naming' section at the following URL:\n" \
- "http://guides.rubygems.org/gems-with-extensions/\n"
+ "https://guides.rubygems.org/gems-with-extensions/\n"
exit 1
end
def ask_and_set_test_framework
test_framework = options[:test] || Bundler.settings["gem.test"]