Sha256: 61321a0a8c8a264460414c703eba68647a9be76981c78678992ffd72c25415de

Contents?: true

Size: 367 Bytes

Versions: 4

Compression:

Stored size: 367 Bytes

Contents

require "milc/dsl"

module Milc::Dsl
  module Gcloud

    def gcloud(cmd, &block)
      cmd << " --project #{project}" unless cmd =~ /\s\-\-project[\s\=]/
      execute("gcloud #{cmd}", &block)
    end

    def json_gcloud(cmd)
      r = gcloud(cmd + " --format json")
      res = r.nil? ? nil : JSON.parse(r)
      block_given? ? yield(res) : res
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
milc-0.1.3 lib/milc/dsl/gcloud.rb
milc-0.1.2 lib/milc/dsl/gcloud.rb
milc-0.1.1 lib/milc/dsl/gcloud.rb
milc-0.1.0 lib/milc/dsl/gcloud.rb