Module: Rake::DSL

Defined in:
lib/rake/config.rb,
lib/rake/extensions.rb

Instance Method Summary collapse

Instance Method Details

#add_cookbook(aCookbookPath) ⇒ Object



682
683
684
# File 'lib/rake/config.rb', line 682

def add_cookbook(aCookbookPath)
  Conf.add_cookbook(aCookbookPath);
end

#config(*args, &block) ⇒ Object



674
675
676
# File 'lib/rake/config.rb', line 674

def config(*args, &block)
  Rake::Task.define_task(*args, &block);
end

#each_resource(aPartialResourcePath, &aBlock) ⇒ Object



694
695
696
# File 'lib/rake/config.rb', line 694

def each_resource(aPartialResourcePath, &aBlock)
  Conf.each_resource(aPartialResourcePath, &aBlock);
end

#find_resource(aPartialResourcePath) ⇒ Object



686
687
688
# File 'lib/rake/config.rb', line 686

def find_resource(aPartialResourcePath)
  Conf.find_resource(aPartialResourcePath);
end

#load_recipe(recipeName) ⇒ Object



678
679
680
# File 'lib/rake/config.rb', line 678

def load_recipe(recipeName)
  Conf.load_recipe(recipeName);
end

#local_run(*args, &block) ⇒ Object



725
726
727
728
# File 'lib/rake/config.rb', line 725

def local_run(*args, &block)
  Rake::Application.mesg "Use of local_run is depreciated. Please use local_sh instead";
  Rake::Task.local_sh(*args, &block);
end

#local_sh(*args, &block) ⇒ Object



721
722
723
# File 'lib/rake/config.rb', line 721

def local_sh(*args, &block)
  Rake::Task.local_sh(*args, &block);
end

#mesg(*args) ⇒ Object



142
143
144
# File 'lib/rake/extensions.rb', line 142

def mesg(*args)
  Rake::Application.mesg(*args);
end

#mesg_pp(*args) ⇒ Object



146
147
148
# File 'lib/rake/extensions.rb', line 146

def mesg_pp(*args)
  Rake::Application.mesg_pp(*args);
end

#read_resource(aPartialResourcePath) ⇒ Object



690
691
692
# File 'lib/rake/config.rb', line 690

def read_resource(aPartialResourcePath)
  File.open(Conf.find_resource(aPartialResourcePath)).read;
end

#remote_run(*args, &block) ⇒ Object



734
735
736
737
# File 'lib/rake/config.rb', line 734

def remote_run(*args, &block)
  Rake::Application.mesg "Use of remote_run is depreciated. Please use remote_ssh instead";
  Rake::Task.remote_ssh(*args, &block);
end

#remote_ssh(*args, &block) ⇒ Object



730
731
732
# File 'lib/rake/config.rb', line 730

def remote_ssh(*args, &block)
  Rake::Task.remote_ssh(*args, &block);
end

#rsync_from_remote(remotePath, localPath, options = {}, &aBlock) ⇒ Object



751
752
753
# File 'lib/rake/config.rb', line 751

def rsync_from_remote(remotePath, localPath, options = {}, &aBlock)
  Rake::Task.rsync_from_remote(remotePath, localPath, options, &aBlock);
end

#rsync_to_remote(localPath, remotePath, options = {}, &aBlock) ⇒ Object



747
748
749
# File 'lib/rake/config.rb', line 747

def rsync_to_remote(localPath, remotePath, options = {}, &aBlock)
  Rake::Task.rsync_to_remote(localPath, remotePath, options, &aBlock);
end

#scp_from_remote(remotePath, localPath, options = {}, &block) ⇒ Object



743
744
745
# File 'lib/rake/config.rb', line 743

def scp_from_remote(remotePath, localPath, options = {}, &block)
  Rake::Task.scp_from_remote(remotePath, localPath, options, &block);
end

#scp_to_remote(localPath, remotePath, options = {}, &block) ⇒ Object



739
740
741
# File 'lib/rake/config.rb', line 739

def scp_to_remote(localPath, remotePath, options = {}, &block)
  Rake::Task.scp_to_remote(localPath, remotePath, options &block);
end

#set_command_options(commandSymbols, options = {}, &asyncTriggersBlock) ⇒ Object



698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'lib/rake/config.rb', line 698

def set_command_options(commandSymbols, options = {}, &asyncTriggersBlock)
  commandSymbols = [ :local, :remote ] if commandSymbols == :all;
  commandSymbols = [ :local, :remote ] if commandSymbols.kind_of? Array and commandSymbols.include? :all;
  commandSymbols = [ commandSymbols ] unless commandSymbols.kind_of? Array;
  commandSymbols.push(:sh).flatten! if commandSymbols.include?(:local);
  commandSymbols.push([:scp, :ssh, :rsync]).flatten! if commandSymbols.include?(:remote);
  commandSymbols.each do | aCommandSymbol |
    aCommandSymbol = aCommandSymbol.to_sym;
    next if aCommandSymbol == :all;
    next if aCommandSymbol == :local;
    next if aCommandSymbol == :remote;
    if !Conf.data.has_key?(aCommandSymbol) then
      Conf.data[aCommandSymbol] = Hash.new;
      Conf.data[aCommandSymbol].command = aCommandSymbol.to_s;
      Conf.data[aCommandSymbol].cmdOptions = Array.new;
      Conf.data[aCommandSymbol].commandPromptRegExp = '.';
      Conf.data[aCommandSymbol].asyncTriggersBlocks = Array.new;
    end
    Conf.data[aCommandSymbol].merge(options);
    Conf.data[aCommandSymbol].asyncTriggersBlocks.push(asyncTriggersBlock);
  end
end