lib/hoe.rb in hoe-3.2.0 vs lib/hoe.rb in hoe-3.3.0
- old
+ new
@@ -89,11 +89,11 @@
class Hoe
include Rake::DSL if defined?(Rake::DSL)
# duh
- VERSION = '3.2.0'
+ VERSION = '3.3.0'
@@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
:publish, :gemcutter, :signing, :test]
@bad_plugins = []
@@ -325,27 +325,30 @@
return @loaded, @found
end
##
- # Normalize a project name into the project, file, and klass names that
+ # Normalize a project name into the project, file, klass and test names that
# follow Ruby package naming guidelines.
#
# Project names are lowercase with _ separating package parts and -
# separating extension parts.
#
# File names are lowercase with _ separating pacagke parts and / separating
# extension parts. net-http-persistent becomes net/http/persistent.
#
# Klass names are CamelCase with :: separating extension parts.
+ #
+ # Test klass names are same as Klass with Test prepended to each part.
def self.normalize_names project # :nodoc:
- project = project.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
- klass = project.gsub(/(?:^|_)([a-z])/) { $1.upcase }
- klass = klass. gsub(/(?:^|-)([a-z])/) { "::#{$1.upcase}" }
- file_name = project.gsub(/-/, '/')
+ project = project.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
+ klass = project.gsub(/(?:^|_)([a-z])/) { $1.upcase }
+ klass = klass. gsub(/(?:^|-)([a-z])/) { "::#{$1.upcase}" }
+ test_klass = klass. gsub(/(^|::)([A-Z])/) { "#{$1}Test#{$2}" }
+ file_name = project.gsub(/-/, '/')
- return project, file_name, klass
+ return project, file_name, klass, test_klass
end
##
# Activates +plugins+. If a plugin cannot be loaded it will be ignored.
#