From 02e34e1e44bb9fc98ca7b4365e095c64adeca0d5 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 19 Oct 2009 13:05:47 +0100 Subject: Camelcase class names around the . from filenames Eg. shell.fm -> ShellFm --- Library/Homebrew/formula.rb | 3 ++- Library/Homebrew/test/unittest.rb | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'Library') 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