lib/hoe.rb in hoe-1.8.2 vs lib/hoe.rb in hoe-1.8.3
- old
+ new
@@ -122,11 +122,11 @@
# This will set the +Gem::Specification+ platform to the one indicated in
# +FORCE_PLATFORM+ (instead of default Gem::Platform::CURRENT)
#
class Hoe
- VERSION = '1.8.2'
+ VERSION = '1.8.3'
GEMURL = URI.parse 'http://gems.rubyforge.org' # for namespace :deps below
ruby_prefix = Config::CONFIG['prefix']
sitelibdir = Config::CONFIG['sitelibdir']
@@ -329,9 +329,17 @@
def self.add_include_dirs(*dirs)
dirs = dirs.flatten
$:.unshift(*dirs)
s = File::PATH_SEPARATOR
Hoe::RUBY_FLAGS.sub!(/-I/, "-I#{dirs.join(s)}#{s}")
+ end
+
+ def self.normalize_names project
+ project = project.tr('-', '_').gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
+ klass = project.gsub(/(?:^|_)([a-z])/) { $1.upcase }
+ file_name = project
+
+ return project, file_name, klass
end
def normalize_deps deps
Array(deps).map { |o| String === o ? [o] : o }
end