Sha256: c537749880e225031ba5eb2e824e350711d8f1f29a36a700ed34aba317f7cfae
Contents?: true
Size: 1.35 KB
Versions: 1
Compression:
Stored size: 1.35 KB
Contents
require "spring_standalone/configuration" module SpringStandalone class CommandWrapper attr_reader :name, :command def initialize(name, command = nil) @name = name @command = command @setup = false end def description if command.respond_to?(:description) command.description else "Runs the #{name} command" end end def setup? @setup end def setup if !setup? && command.respond_to?(:setup) command.setup @setup = true return true else @setup = true return false end end def call if command.respond_to?(:call) command.call else load exec end end def gem_name if command.respond_to?(:gem_name) command.gem_name else exec_name end end def exec_name if command.respond_to?(:exec_name) command.exec_name else name end end def binstub SpringStandalone.application_root_path.join(binstub_name) end def binstub_name "bin/#{name}" end def exec if binstub.exist? binstub.to_s else Gem.bin_path(gem_name, exec_name) end end def env(args) if command.respond_to?(:env) command.env(args) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spring_standalone-0.1.13 | lib/spring_standalone/command_wrapper.rb |