From 003c7ab2cbd15f4b021c908a484bfa744e622156 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 9 Oct 2012 11:12:59 -0400 Subject: [PATCH] refactor a little --- lib/penchant.rb | 1 + lib/penchant/env.rb | 18 ++++++++++++++++++ lib/penchant/gemfile.rb | 18 ------------------ 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 lib/penchant/env.rb diff --git a/lib/penchant.rb b/lib/penchant.rb index 89c71c4..49c3ed2 100644 --- a/lib/penchant.rb +++ b/lib/penchant.rb @@ -3,4 +3,5 @@ module Penchant autoload :Repo, 'penchant/repo' autoload :DotPenchant, 'penchant/dot_penchant' autoload :Hooks, 'penchant/hooks' + autoload :Env, 'penchant/env' end diff --git a/lib/penchant/env.rb b/lib/penchant/env.rb new file mode 100644 index 0000000..c0f943c --- /dev/null +++ b/lib/penchant/env.rb @@ -0,0 +1,18 @@ +module Penchant + class Env + attr_accessor :name + + def initialize(name) + @name = name.to_s + end + + def ==(other) + @name == other.name + end + + def to_s + "@#{name}" + end + end +end + diff --git a/lib/penchant/gemfile.rb b/lib/penchant/gemfile.rb index 63c2fa5..e69b3b1 100644 --- a/lib/penchant/gemfile.rb +++ b/lib/penchant/gemfile.rb @@ -1,5 +1,3 @@ -require 'erb' - module Penchant class Gemfile attr_reader :path, :is_deployment @@ -83,22 +81,6 @@ module Penchant gemfile_header['deployment mode'] != nil end - class Env - attr_accessor :name - - def initialize(name) - @name = name.to_s - end - - def ==(other) - @name == other.name - end - - def to_s - "@#{name}" - end - end - class FileProcessor attr_reader :environment, :is_deployment, :available_environments, :defined_git_repos