github_cli 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ 0.2.1 (April 30, 2012)
2
+
3
+ * Add authorizations api commands.
4
+
5
+ 0.2.0 (April 29, 2012)
6
+
7
+ * Add repository forks, hooks, watching api commands.
8
+ * Fix repository commands bugs.
9
+ * Update gem dependency to 'github_api' version 0.5.0 and rewrote method calls to match new dsl conventions.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github_cli (0.2.0)
4
+ github_cli (0.2.1)
5
5
  github_api (~> 0.5.0)
6
6
  thor
7
7
 
data/README.md CHANGED
@@ -6,8 +6,6 @@
6
6
 
7
7
  CLI-based access to GitHub API v3 that works hand-in-hand with 'github_api' gem.
8
8
 
9
- This gem does not work yet at this stage, stay tuned.
10
-
11
9
  ## Installation
12
10
 
13
11
  Add this line to your application's Gemfile:
@@ -24,6 +24,7 @@ Feature: The GHC Executable
24
24
 
25
25
  Examples:
26
26
  | command |
27
+ | auth |
27
28
  | repo |
28
29
  | issue |
29
30
  | blob |
@@ -0,0 +1,30 @@
1
+ # encoding: utf-8
2
+
3
+ module GithubCLI
4
+ class Authorization < API
5
+
6
+ class << self
7
+
8
+ def all(params)
9
+ github_api.oauth.list params
10
+ end
11
+
12
+ def get(id, params)
13
+ github_api.oauth.get id, params
14
+ end
15
+
16
+ def create(params)
17
+ github_api.oauth.create params
18
+ end
19
+
20
+ def update(id, params)
21
+ github_api.oauth.update id, params
22
+ end
23
+
24
+ def delete(id, params)
25
+ github_api.oauth.delete id, params
26
+ end
27
+ end
28
+
29
+ end # Authorization
30
+ end # GithubCLI
@@ -9,6 +9,7 @@ else
9
9
  end
10
10
 
11
11
  %w[
12
+ authorization
12
13
  blob
13
14
  commit
14
15
  download
@@ -0,0 +1,58 @@
1
+ # encoding: utf-8
2
+
3
+ module GithubCLI
4
+ class Commands::Authorizations < Command
5
+
6
+ namespace :auth
7
+
8
+ desc 'list', 'Lists your authorizations'
9
+ method_option :params, :type => :hash, :default => {},
10
+ :desc => 'Additional request parameters e.i per_page:100'
11
+ def list
12
+ Authorization.all options[:params]
13
+ end
14
+
15
+ desc 'get <id>', 'Get a single authorization'
16
+ method_option :params, :type => :hash, :default => {},
17
+ :desc => 'Additional request parameters e.i per_page:100'
18
+ def get(id)
19
+ Authorization.get id, options[:params]
20
+ end
21
+
22
+ desc 'create <user> <repo>', 'Create a new authorization'
23
+ long_desc <<-DESC
24
+ Inputs
25
+
26
+ scopes - Optional array - A list of scopes that this authorization is in.\n
27
+ note - Optional string - A note to remind you what the OAuth token is for.\n
28
+ note_url - Optional string - A URL to remind you what the OAuth token is for.
29
+ DESC
30
+ method_option :params, :type => :hash, :default => {},
31
+ :desc => 'Additonal request parameters e.i per_page:100'
32
+ def create
33
+ Authorization.create options[:params]
34
+ end
35
+
36
+ desc 'update <id>', 'Update an existing authorization'
37
+ long_desc <<-DESC
38
+ Inputs
39
+
40
+ scopes - Optional array - A list of scopes that this authorization is in.\n
41
+ add_scopes - Optional array - A list of scopes to add to this authorization.\n
42
+ remove_scopes - Optional array - A list of scopes to remove from this authorization.\n
43
+ note - Optional string - A note to remind you what the OAuth token is for.\n
44
+ note_url - Optional string - A URL to remind you what the OAuth token is for.
45
+ DESC
46
+ def update(id)
47
+ Authorization.update id, options[:params]
48
+ end
49
+
50
+ desc 'delete <id>', 'Delete an authorization'
51
+ method_option :params, :type => :hash, :default => {},
52
+ :desc => 'Additonal request parameters e.i per_page:100'
53
+ def delete(id)
54
+ Authorization.delete id, options[:params]
55
+ end
56
+
57
+ end # Authorizations
58
+ end # GithubCLI
@@ -2,19 +2,20 @@
2
2
 
3
3
  module GithubCLI
4
4
  module Commands
5
- autoload :Blobs, 'github_cli/commands/blobs'
6
- autoload :Commits, 'github_cli/commands/commits'
7
- autoload :Downloads, 'github_cli/commands/downloads'
8
- autoload :Forks, 'github_cli/commands/forks'
9
- autoload :Hooks, 'github_cli/commands/hooks'
10
- autoload :Issues, 'github_cli/commands/issues'
11
- autoload :Keys, 'github_cli/commands/keys'
12
- autoload :Labels, 'github_cli/commands/labels'
13
- autoload :PullRequests, 'github_cli/commands/pull_requests'
14
- autoload :References, 'github_cli/commands/references'
15
- autoload :Repositories, 'github_cli/commands/repositories'
16
- autoload :Tags, 'github_cli/commands/tags'
17
- autoload :Trees, 'github_cli/commands/trees'
18
- autoload :Watching, 'github_cli/commands/watching'
5
+ autoload :Authorizations, 'github_cli/commands/authorizations'
6
+ autoload :Blobs, 'github_cli/commands/blobs'
7
+ autoload :Commits, 'github_cli/commands/commits'
8
+ autoload :Downloads, 'github_cli/commands/downloads'
9
+ autoload :Forks, 'github_cli/commands/forks'
10
+ autoload :Hooks, 'github_cli/commands/hooks'
11
+ autoload :Issues, 'github_cli/commands/issues'
12
+ autoload :Keys, 'github_cli/commands/keys'
13
+ autoload :Labels, 'github_cli/commands/labels'
14
+ autoload :PullRequests, 'github_cli/commands/pull_requests'
15
+ autoload :References, 'github_cli/commands/references'
16
+ autoload :Repositories, 'github_cli/commands/repositories'
17
+ autoload :Tags, 'github_cli/commands/tags'
18
+ autoload :Trees, 'github_cli/commands/trees'
19
+ autoload :Watching, 'github_cli/commands/watching'
19
20
  end # Commands
20
21
  end # GithubCLI
@@ -3,6 +3,9 @@
3
3
  module GithubCLI
4
4
  class CLI
5
5
 
6
+ desc "auth <command>", "Leverage Authorizations API"
7
+ subcommand "auth", GithubCLI::Commands::Authorizations
8
+
6
9
  desc "blob <command>", "Leverage Blobs API"
7
10
  subcommand "blob", GithubCLI::Commands::Blobs
8
11
 
@@ -1,3 +1,3 @@
1
1
  module GithubCLI
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-29 00:00:00.000000000Z
12
+ date: 2012-04-30 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: github_api
16
- requirement: &2160315660 !ruby/object:Gem::Requirement
16
+ requirement: &2153209580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.5.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2160315660
24
+ version_requirements: *2153209580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &2160315120 !ruby/object:Gem::Requirement
27
+ requirement: &2153208980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2160315120
35
+ version_requirements: *2153208980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &2160314500 !ruby/object:Gem::Requirement
38
+ requirement: &2153208340 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2160314500
46
+ version_requirements: *2153208340
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: aruba
49
- requirement: &2160314000 !ruby/object:Gem::Requirement
49
+ requirement: &2153207420 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2160314000
57
+ version_requirements: *2153207420
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &2160313480 !ruby/object:Gem::Requirement
60
+ requirement: &2153207000 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2160313480
68
+ version_requirements: *2153207000
69
69
  description: CLI-based access to GitHub API v3
70
70
  email:
71
71
  - pmurach@gmail.com
@@ -78,6 +78,7 @@ files:
78
78
  - .rspec
79
79
  - .rvmrc
80
80
  - .travis.yml
81
+ - CHANGELOG.md
81
82
  - Gemfile
82
83
  - Gemfile.lock
83
84
  - LICENSE
@@ -95,6 +96,7 @@ files:
95
96
  - lib/github_cli.rb
96
97
  - lib/github_cli/api.rb
97
98
  - lib/github_cli/apis.rb
99
+ - lib/github_cli/apis/authorization.rb
98
100
  - lib/github_cli/apis/blob.rb
99
101
  - lib/github_cli/apis/commit.rb
100
102
  - lib/github_cli/apis/download.rb
@@ -111,6 +113,7 @@ files:
111
113
  - lib/github_cli/cli.rb
112
114
  - lib/github_cli/command.rb
113
115
  - lib/github_cli/commands.rb
116
+ - lib/github_cli/commands/authorizations.rb
114
117
  - lib/github_cli/commands/blobs.rb
115
118
  - lib/github_cli/commands/commits.rb
116
119
  - lib/github_cli/commands/downloads.rb