Class: Vimpack::Commands::Command
- Inherits:
-
Object
- Object
- Vimpack::Commands::Command
- Includes:
- Utils::File, Utils::Git, Utils::Io, Utils::Process
- Defined in:
- lib/vimpack/commands/command.rb
Instance Attribute Summary
Attributes included from Utils::File
#bundle_path, #home_path, #pack_path, #script_path, #vim_path
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options, global_options) ⇒ Command
constructor
A new instance of Command.
- #initialize_commands ⇒ Object
- #initialize_environment ⇒ Object
- #initialize_global_options ⇒ Object
- #initialize_options ⇒ Object
- #run ⇒ Object
Methods included from Utils::Process
#run_process!, #run_process_and_wait!, #run_process_or_die!, #wait_for_child, #within_dir
Methods included from Utils::Io
#die!, #exit_with_error!, #say, #scream
Methods included from Utils::Git
#add_submodule, #init_repo, #init_submodule, #remove_submodule, #replace_contents, #repo_add_dot, #repo_add_remote, #repo_clone, #repo_commit, #repo_exec, #repo_pull, #repo_push, #repo_remote?, #sanitize_commands, #update_submodule
Methods included from Utils::File
#create_link, #directory_exists?, #file_exists?, #make_dir, #move_path, #remove_directory, #remove_link, #setup_paths, #symlink_exists?, #template, #template_path
Constructor Details
#initialize(options, global_options) ⇒ Command
Returns a new instance of Command.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/vimpack/commands/command.rb', line 9 def initialize(, ) @options = @global_options = @commands = ARGV setup_paths(@options[:home_directory] || ENV['HOME']) initialize_environment initialize_commands end |
Class Method Details
.run(options = Hash.new, commands = Hash.new) ⇒ Object
40 41 42 |
# File 'lib/vimpack/commands/command.rb', line 40 def self.run( = Hash.new, commands = Hash.new) new(, commands).run end |
Instance Method Details
#initialize_commands ⇒ Object
33 34 |
# File 'lib/vimpack/commands/command.rb', line 33 def initialize_commands end |
#initialize_environment ⇒ Object
20 21 22 23 24 25 |
# File 'lib/vimpack/commands/command.rb', line 20 def initialize_environment Vimpack.environment = @global_options[:environment].to_sym unless Vimpack.env?('production') say(" * using environment #{Vimpack.environment.inspect}") end end |
#initialize_global_options ⇒ Object
27 28 |
# File 'lib/vimpack/commands/command.rb', line 27 def end |
#initialize_options ⇒ Object
30 31 |
# File 'lib/vimpack/commands/command.rb', line 30 def end |
#run ⇒ Object
36 37 38 |
# File 'lib/vimpack/commands/command.rb', line 36 def run raise NotImplemented end |