From 4f88e3977ffb3aa94b033b8af25b19dbd2265c1c Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 9 Oct 2012 14:42:07 -0400 Subject: [PATCH] more cleanup --- lib/penchant.rb | 1 - lib/penchant/file_processor.rb | 2 -- lib/penchant/properties.rb | 14 -------------- lib/penchant/property.rb | 0 lib/penchant/property_stack.rb | 4 +++- lib/penchant/property_stack_builder.rb | 1 + 6 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 lib/penchant/properties.rb delete mode 100644 lib/penchant/property.rb diff --git a/lib/penchant.rb b/lib/penchant.rb index 63aa66a..0b75569 100644 --- a/lib/penchant.rb +++ b/lib/penchant.rb @@ -7,7 +7,6 @@ module Penchant autoload :FileProcessor, 'penchant/file_processor' autoload :PenchantFile, 'penchant/penchant_file' autoload :Defaults, 'penchant/defaults' - autoload :Properties, 'penchant/properties' autoload :CustomProperty, 'penchant/custom_property' autoload :PropertyStack, 'penchant/property_stack' autoload :PropertyStackBuilder, 'penchant/property_stack_builder' diff --git a/lib/penchant/file_processor.rb b/lib/penchant/file_processor.rb index 6a42916..747f229 100644 --- a/lib/penchant/file_processor.rb +++ b/lib/penchant/file_processor.rb @@ -131,8 +131,6 @@ module Penchant end def process_options(gem_name, template = {}) - properties = Properties.new(template) - original_properties = process_option_stack(gem_name, property_stack) if @_strip_pathing_options diff --git a/lib/penchant/properties.rb b/lib/penchant/properties.rb deleted file mode 100644 index 940bbdd..0000000 --- a/lib/penchant/properties.rb +++ /dev/null @@ -1,14 +0,0 @@ -module Penchant - class Properties - def initialize(template) - @properties = {} - - @template = template.to_a - end - - def process - - end - end -end - diff --git a/lib/penchant/property.rb b/lib/penchant/property.rb deleted file mode 100644 index e69de29..0000000 diff --git a/lib/penchant/property_stack.rb b/lib/penchant/property_stack.rb index c97d702..9609c14 100644 --- a/lib/penchant/property_stack.rb +++ b/lib/penchant/property_stack.rb @@ -1,5 +1,7 @@ module Penchant class PropertyStack + PATHING_OPTIONS = [ :git, :branch, :path ].freeze + def initialize(builder, property_stack, strip_pathing_options) @builder, @property_stack, @strip_pathing_options = builder, property_stack.dup, strip_pathing_options end @@ -12,7 +14,7 @@ module Penchant properties = processor.process(gem_name, @property_stack) if @strip_pathing_options - [ :git, :branch, :path ].each { |key| properties.delete(key) } + PATHING_OPTIONS.each { |key| properties.delete(key) } end properties = processor.process(gem_name, @builder.defaults[gem_name].merge(additional_env)).merge(properties) diff --git a/lib/penchant/property_stack_builder.rb b/lib/penchant/property_stack_builder.rb index 7a0a3d2..656e6a8 100644 --- a/lib/penchant/property_stack_builder.rb +++ b/lib/penchant/property_stack_builder.rb @@ -21,3 +21,4 @@ module Penchant end end end +