aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb3
-rwxr-xr-xLibrary/Homebrew/test/unittest.rb5
2 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 819bf23dc..4bc2cb7d7 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -183,7 +183,8 @@ class Formula
def self.class_s name
#remove invalid characters and camelcase
- name.capitalize.gsub(/[-_\s]([a-zA-Z0-9])/) { $1.upcase }.gsub('+', 'x')
+ name.capitalize.gsub(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase } \
+ .gsub('+', 'x')
end
def self.factory name
diff --git a/Library/Homebrew/test/unittest.rb b/Library/Homebrew/test/unittest.rb
index f14e84e03..e6bd27387 100755
--- a/Library/Homebrew/test/unittest.rb
+++ b/Library/Homebrew/test/unittest.rb
@@ -593,6 +593,11 @@ class BeerTasting <Test::Unit::TestCase
end
end
+ def test_class_names
+ assert_equal 'ShellFm', Formula.class_s('shell.fm')
+ assert_equal 'Fooxx', Formula.class_s('foo++')
+ end
+
def test_angband_version_style
f = MockFormula.new 'http://rephial.org/downloads/3.0/angband-3.0.9b-src.tar.gz'
assert_equal '3.0.9b', f.version