def recipe_from_right_script(script)
      raise RightScale::Exceptions::Application, 'cannot create recipe after cookbook repo has been saved' if @saved
      path = script_path(script.nickname)
      recipe_name = File.basename(path)
      @recipes[recipe_name] = script.nickname
      recipe_content = <<-EOS
right_script #{script.nickname.inspect} do
  parameters(node[#{script.nickname.inspect}]["parameters"])
  cache_dir  '#{cache_dir(script)}'
  source_file '#{path}'
  display_version #{script.display_version.to_s.strip.inspect}
end
      EOS
      File.open(path, 'w') { |f| f.puts script.source }
      File.chmod(0744, path)
      recipe_path = "#{path}.rb"
      File.open(recipe_path, 'w') { |f| f.puts recipe_content }

      recipe = RecipeInstantiation.new("#{COOKBOOK_NAME}::#{recipe_name}",
                                       { script.nickname => { "parameters" => script.parameters } },
                                       script.id, script.ready)

    end
def recipe_from_right_script(script)
      raise RightScale::Exceptions::Application, 'cannot create recipe after cookbook repo has been saved' if @saved
      path = script_path(script.nickname)
      recipe_name = File.basename(path)
      @recipes[recipe_name] = script.nickname
      recipe_content = <<-EOS
right_script #{script.nickname.inspect} do
  parameters(node[#{script.nickname.inspect}]["parameters"])
  cache_dir  '#{cache_dir(script)}'
  source_file '#{path}'
  display_version #{script.display_version.to_s.strip.inspect}
end
      EOS
      File.open(path, 'w') { |f| f.puts script.source }
      File.chmod(0744, path)
      recipe_path = "#{path}.rb"
      File.open(recipe_path, 'w') { |f| f.puts recipe_content }

      recipe = RecipeInstantiation.new("#{COOKBOOK_NAME}::#{recipe_name}",
                                       { script.nickname => { "parameters" => script.parameters } },
                                       script.id, script.ready)

    end
Setup temporary directory for cookbook repo containing
 recipes generated from RightScripts
 Add RightScript instantiation to cookbook

 === Parameters
 script(RightScale::RightScriptInstantiation):: RightScript to be added

 === Return
 recipe(RightScale::RecipeInstantiation):: Recipe that wraps RightScript

 === Raise
 (RightScale::Exceptions::Application):: If 'save' has been called