diff options
author | Jan Lelis <mail@janlelis.de> | 2015-03-19 04:38:52 +0100 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-04-30 09:56:56 -0700 |
commit | ab9c5cbf3e8b8e4b1cab5f7e6c413bc6ff84e530 (patch) | |
tree | 8337d92c2febb03b50efd6fee62f478b395e9e7b /lib | |
parent | 26b924768c62b68972bc4826dd97511a5cfa6914 (diff) | |
download | bundler-ab9c5cbf3e8b8e4b1cab5f7e6c413bc6ff84e530.tar.gz |
Improve generating module name from gem name in gem generator
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/cli/gem.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 7c9f8734..c1d9d842 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -20,8 +20,8 @@ module Bundler underscored_name = name.tr('-', '_') namespaced_path = name.tr('-', '/') - constant_name = name.split('_').map{|p| p[0..0].upcase + p[1..-1] unless p.empty?}.join - constant_name = constant_name.split('-').map{|q| q[0..0].upcase + q[1..-1] }.join('::') if constant_name =~ /-/ + constant_name = name.gsub(/-[_-]*(?![_-]|$)/){ '::' }.gsub(/([_-]+|(::)|^)(.|$)/){ $2.to_s + $3.upcase } + constant_array = constant_name.split('::') git_user_name = `git config user.name`.chomp git_user_email = `git config user.email`.chomp |