From 3d36b01da34b7da937add25e35e4f1ccdf929c07 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 19 Oct 2009 13:05:47 +0100 Subject: [PATCH] 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(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 819bf23dcc..4bc2cb7d72 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 f14e84e038..e6bd273876 100755 --- a/Library/Homebrew/test/unittest.rb +++ b/Library/Homebrew/test/unittest.rb @@ -593,6 +593,11 @@ class BeerTasting