Sha256: 57f032e6071a063b3fa7e0c3d42fe6e8de2729e869b06b60a5b166f9eac9c8de

Contents?: true

Size: 887 Bytes

Versions: 1

Compression:

Stored size: 887 Bytes

Contents

# encoding: utf-8

require 'github_cli/command'

module GithubCLI
  class Trees < Command

    namespace :tree

    desc 'get <user> <repo> <sha>', 'Get a Tree'
    method_option :recursive, :type => :boolean, :aliases => ["-r"],
                  :desc => 'get a tree recursively'
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additonal request parameters e.i per_page:100'
    def get(user, repo, sha)
      if options[:recursive]
        options[:params]['recursive'] = true
      end
      Tree.get user, repo, sha, options[:params]
    end

    desc 'create <user> <repo>', 'Create a new Tree'
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additonal request parameters e.i per_page:100'
    def create(user, repo)
      Tree.create user, repo, options[:params]
    end

  end # Blobs
end # GithubCLI

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
github_cli-0.1.0 lib/github_cli/trees.rb