Sha256: 97fade257522f37ba0414506d0869b952222303143691e20f3e12b1a10d8a60b

Contents?: true

Size: 962 Bytes

Versions: 54

Compression:

Stored size: 962 Bytes

Contents

module Brightbox
  command [:images] do |cmd|
    cmd.desc I18n.t("images.lock.desc")
    cmd.arg_name "[image-id...]"
    cmd.command [:lock] do |c|
      c.action do |_global_options, _options, args|
        raise "You must specify image as arguments" if args.empty?

        images = Image.find_or_call(args) do |image|
          raise "Couldn't find #{image}"
        end

        images.each do |image|
          info "Locking #{image}"
          image.lock!
        end
      end
    end

    cmd.desc I18n.t("images.unlock.desc")
    cmd.arg_name "[image-id...]"
    cmd.command [:unlock] do |c|
      c.action do |_global_options, _options, args|
        raise "You must specify images as arguments" if args.empty?

        images = Image.find_or_call(args) do |image|
          raise "Couldn't find #{image}"
        end

        images.each do |image|
          info "Unlocking #{image}"
          image.unlock!
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
brightbox-cli-4.8.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.7.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.6.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.5.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.5.0.rc1 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.4.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.3.2 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.3.1 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.3.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.2.1 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.2.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.1.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.0.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-4.0.0.rc2 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-3.3.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-3.2.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-3.1.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-3.0.1 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-3.0.0 lib/brightbox-cli/commands/images/locking.rb
brightbox-cli-2.12.0 lib/brightbox-cli/commands/images/locking.rb