~ubuntu-branches/ubuntu/karmic/chef/karmic

« back to all changes in this revision

Viewing changes to chef/lib/chef/resource/script.rb

  • Committer: Bazaar Package Importer
  • Author(s): Joshua Timberman
  • Date: 2009-08-12 12:18:48 UTC
  • Revision ID: james.westby@ubuntu.com-20090812121848-yl38hpd7nfsl51xz
Tags: upstream-0.7.8
ImportĀ upstreamĀ versionĀ 0.7.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Author:: Adam Jacob (<adam@opscode.com>)
 
3
# Copyright:: Copyright (c) 2008 Opscode, Inc.
 
4
# License:: Apache License, Version 2.0
 
5
#
 
6
# Licensed under the Apache License, Version 2.0 (the "License");
 
7
# you may not use this file except in compliance with the License.
 
8
# You may obtain a copy of the License at
 
9
 
10
#     http://www.apache.org/licenses/LICENSE-2.0
 
11
 
12
# Unless required by applicable law or agreed to in writing, software
 
13
# distributed under the License is distributed on an "AS IS" BASIS,
 
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
15
# See the License for the specific language governing permissions and
 
16
# limitations under the License.
 
17
#
 
18
 
 
19
require 'chef/resource/execute'
 
20
 
 
21
class Chef
 
22
  class Resource
 
23
    class Script < Chef::Resource::Execute
 
24
        
 
25
      def initialize(name, collection=nil, node=nil)
 
26
        super(name, collection, node)
 
27
        @resource_name = :script
 
28
        @command = name
 
29
        @code = nil
 
30
        @interpreter = nil
 
31
      end
 
32
      
 
33
      def code(arg=nil)
 
34
        set_or_return(
 
35
          :code,
 
36
          arg,
 
37
          :kind_of => [ String ]
 
38
        )
 
39
      end
 
40
      
 
41
      def interpreter(arg=nil)
 
42
        set_or_return(
 
43
          :interpreter,
 
44
          arg,
 
45
          :kind_of => [ String ]
 
46
        )
 
47
      end
 
48
 
 
49
    end
 
50
  end
 
51
end
 
 
b'\\ No newline at end of file'