remove constraint that tokens can't start w/ digit

Class names are now completely hidden from the user.  This
commit works by adding a prefix to all Cask class names, which
is considered to be an ugly transitional hack on the way to
representing individual Casks as instances.
This commit is contained in:
Roland Walker
2014-12-05 11:54:56 -05:00
parent aa58f55990
commit cb5a40f787
5 changed files with 21 additions and 44 deletions
-22
View File
@@ -24,19 +24,6 @@ end
### configurable constants
###
EXPANDED_NUMBERS = {
'0' => 'zero',
'1' => 'one',
'2' => 'two',
'3' => 'three',
'4' => 'four',
'5' => 'five',
'6' => 'six',
'7' => 'seven',
'8' => 'eight',
'9' => 'nine',
}
EXPANDED_SYMBOLS = {
'+' => 'plus',
}
@@ -302,14 +289,6 @@ class CaskFileName < String
self.gsub(/-([0-9])/, '\1')
end
def spell_out_leading_numbers
cask_file_name = self
EXPANDED_NUMBERS.each do |k, v|
cask_file_name.sub!(/^#{k}/, v)
end
cask_file_name
end
def spell_out_symbols
cask_file_name = self
EXPANDED_SYMBOLS.each do |k, v|
@@ -339,7 +318,6 @@ class CaskFileName < String
.collapse_multiple_hyphens
.delete_leading_hyphens
.delete_hyphens_before_numbers
.spell_out_leading_numbers
end
raise "Could not determine Simplified App name" unless @from_simplified_app_name.length > 0
@from_simplified_app_name.add_extension