Sha256: 4198fd257bd6483541509f7f83ab6a2a1aa10d018010067e0a82657847b2c59d

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8

module GithubCLI
  class Commands::Blobs < Command

    namespace :blob

    desc 'get <user> <repo> <sha>', 'Get a Blob'
    def get(user, repo, sha)
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params'])

      Blob.get user, repo, sha, params, global_options
    end

    option :content, :type => :string
    option :encoding, :type => :string, :banner => "utf-8|base64",
           :desc => "String containing encoding utf-8 or base64"
    desc 'create <user> <repo>', 'Create a new Blob'
    long_desc <<-DESC
      Inputs

        content - String of content \n
        encoding - String containing encoding utf-8 or base64
    DESC
    def create(user, repo)
      global_options = options.dup
      params = options[:params].dup
      params['content']  = options[:content]  if options[:content]
      params['encoding'] = options[:encoding] if options[:encoding]
      Util.hash_without!(global_options, params.keys + ['params'])

      Blob.create user, repo, params, global_options
    end

  end # Blobs
end # GithubCLI

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
github_cli-0.6.2 lib/github_cli/commands/blobs.rb
github_cli-0.6.1 lib/github_cli/commands/blobs.rb
github_cli-0.6.0 lib/github_cli/commands/blobs.rb