class Spring::CommandWrapper
Attributes
Public Class Methods
Source
# File lib/spring/command_wrapper.rb, line 7 def initialize(name, command = nil) @name = name @command = command @setup = false end
Public Instance Methods
Source
# File lib/spring/command_wrapper.rb, line 60 def binstub Spring.application_root_path.join(binstub_name) end
Source
# File lib/spring/command_wrapper.rb, line 64 def binstub_name "bin/#{name}" end
Source
# File lib/spring/command_wrapper.rb, line 36 def call if command.respond_to?(:call) command.call else load exec end end
Source
# File lib/spring/command_wrapper.rb, line 13 def description if command.respond_to?(:description) command.description else "Runs the #{name} command" end end
Source
# File lib/spring/command_wrapper.rb, line 76 def env(args) if command.respond_to?(:env) command.env(args) end end
Source
# File lib/spring/command_wrapper.rb, line 68 def exec if binstub.exist? binstub.to_s else Gem.bin_path(gem_name, exec_name) end end
Source
# File lib/spring/command_wrapper.rb, line 52 def exec_name if command.respond_to?(:exec_name) command.exec_name else name end end
Source
# File lib/spring/command_wrapper.rb, line 44 def gem_name if command.respond_to?(:gem_name) command.gem_name else exec_name end end
Source
# File lib/spring/command_wrapper.rb, line 25 def setup if !setup? && command.respond_to?(:setup) command.setup @setup = true return true else @setup = true return false end end