Sha256: 678896ca2e4f89bdf7e06e3e2819538577d7e0ad85c2b0128307c63bc367cc83
Contents?: true
Size: 1.36 KB
Versions: 5
Compression:
Stored size: 1.36 KB
Contents
require 'active_support/hash_with_indifferent_access' module Standup module Scripts class Base def initialize node @node = node @remoting = nil @params = if node.params[name].is_a? Hash ActiveSupport::HashWithIndifferentAccess.new self.class.default_params.merge(node.params[name]) else node.params[name] || self.class.default_params end end class_attribute :name class_attribute :default_params self.default_params = {} class_attribute :description delegate :instance, :open_port, :open_ports, :remoting, :scripts, :to => :@node delegate :download, :upload, :remote_update, :exec, :sudo, :in_dir, :in_temp_dir, :file_exists?, :install_package, :install_packages, :install_gem, :to => :remoting attr_accessor :node, :params def name self.class.name end def titled_run bright_p "#{@node.name}:#{name}", HighLine::CYAN run end def script_file filename [Standup.local_scripts_path, Standup.gem_scripts_path].each do |dir| next unless dir path = File.expand_path("#{name}/#{filename}", dir) return path if File.exists? path end nil end def run; end end end end
Version data entries
5 entries across 5 versions & 1 rubygems