class PhilColumns::Command::Base
Attributes
options[R]
Public Class Methods
new( options )
click to toggle source
# File lib/phil_columns/command/base.rb, line 7 def initialize( options ) @options = options end
Public Instance Methods
execute()
click to toggle source
# File lib/phil_columns/command/base.rb, line 11 def execute raise NotImplementedError, "You must implement #{self.class.name}#execute" end
Protected Instance Methods
archivist()
click to toggle source
# File lib/phil_columns/command/base.rb, line 19 def archivist @archivist ||= PhilColumns::Archivist.new end
base_path()
click to toggle source
# File lib/phil_columns/command/base.rb, line 43 def base_path Pathname.new( Dir.pwd ) end
config()
click to toggle source
# File lib/phil_columns/command/base.rb, line 35 def config @config = Configuration.new( options ) end
config_file_path()
click to toggle source
# File lib/phil_columns/command/base.rb, line 39 def config_file_path '.phil_columns' end
dry_run?()
click to toggle source
# File lib/phil_columns/command/base.rb, line 31 def dry_run? config.dry_run end
env_files()
click to toggle source
# File lib/phil_columns/command/base.rb, line 56 def env_files @env_files ||= config.env_files.map { |f| Pathname.new f } end
load_environment()
click to toggle source
# File lib/phil_columns/command/base.rb, line 47 def load_environment return if env_files.nil? || env_files.empty? env_files.each do |file| say "Loading environment: #{file} ..." require file.expand_path end end
migrator()
click to toggle source
# File lib/phil_columns/command/base.rb, line 23 def migrator @migrator ||= PhilColumns::Migrator.new( config ) end
seeder()
click to toggle source
# File lib/phil_columns/command/base.rb, line 27 def seeder @seeder ||= PhilColumns::Seeder.new( config ) end