Sha256: 6b54285e1a45e590df22c8c33992bfdf64cf6d84307d93e177946d95c13d7b93

Contents?: true

Size: 386 Bytes

Versions: 2

Compression:

Stored size: 386 Bytes

Contents

module Itamae
  module Resource
    class LocalRubyBlock < Base
      define_attribute :action, default: :run
      define_attribute :block, type: Proc

      def action_run(options)
        if attributes[:cwd]
          Dir.chdir(attributes[:cwd]) do
            attributes.block.call
          end
        else
          attributes.block.call
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
itamae-1.14.1 lib/itamae/resource/local_ruby_block.rb
itamae-1.14.0 lib/itamae/resource/local_ruby_block.rb