Module: Rake::DSL

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

Instance Method Summary collapse

Instance Method Details

#add_cookbook(aCookbookPath) ⇒ Object



732
733
734
# File 'lib/rake/config.rb', line 732

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

#config(*args, &block) ⇒ Object



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

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

#each_resource(aPartialResourcePath, &aBlock) ⇒ Object



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

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

#find_resource(aPartialResourcePath) ⇒ Object



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

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

#load_recipe(recipeName) ⇒ Object



728
729
730
# File 'lib/rake/config.rb', line 728

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

#local_run(*args, &block) ⇒ Object



775
776
777
778
# File 'lib/rake/config.rb', line 775

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



771
772
773
# File 'lib/rake/config.rb', line 771

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

#mesg(*args) ⇒ Object



212
213
214
# File 'lib/rake/extensions.rb', line 212

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

#mesg_confObject



224
225
226
# File 'lib/rake/extensions.rb', line 224

def mesg_conf
  Rake::Application.mesg_conf;
end

#mesg_pp(*args) ⇒ Object



216
217
218
# File 'lib/rake/extensions.rb', line 216

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

#mesg_yaml(*args) ⇒ Object



220
221
222
# File 'lib/rake/extensions.rb', line 220

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

#read_resource(aPartialResourcePath) ⇒ Object



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

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

#remote_run(*args, &block) ⇒ Object



784
785
786
787
# File 'lib/rake/config.rb', line 784

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



780
781
782
# File 'lib/rake/config.rb', line 780

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

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



801
802
803
# File 'lib/rake/config.rb', line 801

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



797
798
799
# File 'lib/rake/config.rb', line 797

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



793
794
795
# File 'lib/rake/config.rb', line 793

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



789
790
791
# File 'lib/rake/config.rb', line 789

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



748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/rake/config.rb', line 748

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