ghee 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/README.md +6 -1
  2. data/bin/ghee +22 -10
  3. data/ghee.gemspec +1 -0
  4. data/lib/ghee.rb +2 -11
  5. data/lib/ghee/version.rb +1 -1
  6. metadata +103 -27
data/README.md CHANGED
@@ -137,7 +137,12 @@ Get a single pull request on a repo (see [Get a single pull request](http://deve
137
137
 
138
138
  Create a pull request (see [Create a pull request](http://developer.github.com/v3/pulls/#create-a-pull-request) )
139
139
 
140
- gh.repos("rauhryan", "ghee").pulls.create({:title=>"take my awesome code!", :body=>"This code is so awesome. Let me tell you why...", :base=>"master", :head=>"octocat:awesomebranch")
140
+ gh.repos("rauhryan", "ghee").pulls.create({
141
+ :title=>"take my awesome code!",
142
+ :body=>"This code is so awesome. Let me tell you why...",
143
+ :base=>"master",
144
+ :head=>"octocat:awesomebranch"
145
+ })
141
146
 
142
147
  Update a pull request (see [Update a pull request](http://developer.github.com/v3/pulls/#update-a-pull-request) )
143
148
 
data/bin/ghee CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "ghee"
3
3
  require "optparse"
4
+ require "highline/import"
4
5
 
5
6
  options = {}
6
7
 
@@ -8,16 +9,23 @@ opt_parser = OptionParser.new do |opt|
8
9
  opt.banner = "Usage: ghee COMMAND [OPTIONS}"
9
10
  opt.separator ""
10
11
  opt.separator "Commands"
11
- opt.separator " install: install <username> <password>"
12
+ opt.separator " install: install <username>"
12
13
  opt.separator ""
13
14
  opt.separator "Options"
14
15
 
15
- opt.on("-h", "--help", "help") do
16
+ opt.on("install") do
17
+ options[:install] = true
18
+ end
19
+
20
+ opt.on("-h", "--help", "help") do
16
21
  puts opt_parser
17
22
  end
18
23
  end
19
24
 
20
25
  opt_parser.parse!
26
+
27
+ puts options
28
+
21
29
  class CMD
22
30
  def self.get_password
23
31
  begin
@@ -42,12 +50,17 @@ class CMD
42
50
 
43
51
  end
44
52
 
53
+ class HL
54
+ def self.get_password
55
+ ask("Enter your GitHub password (never stored): ") { |x| x.echo = '*' }
56
+ end
57
+ end
58
+
59
+ if options[:install]
45
60
 
46
- case ARGV[0]
47
- when "install"
48
61
  user = ARGV[1]
49
62
 
50
- ghee = Ghee.basic_auth user, CMD.get_password
63
+ ghee = Ghee.basic_auth user, HL.get_password
51
64
 
52
65
  auth = ghee.authorizations.create(
53
66
  :scopes => ["repo","user","gists"],
@@ -59,13 +72,12 @@ when "install"
59
72
  run << "git config --global github.user #{user}"
60
73
  run << "git config --global github.token #{token}"
61
74
  system run.join("; ")
62
- puts <<EOF
75
+ say "
63
76
  Your ~/.gitconfig has been modified. Be sure not to commit this to a public repository!
64
77
 
65
- Alternatively you can have a private .dotfile that can set an ENV variable
78
+ Alternatively you can have a private .dotfile that can set an ENV variable"
66
79
 
67
- EOF
68
- puts " export GH_TOKEN=#{token}"
80
+ say " export GH_TOKEN=#{token}"
69
81
  else
70
- puts opt_parser
82
+ say opt_parser
71
83
  end
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency 'faraday_middleware', '~> 0.9'
23
23
  s.add_dependency 'hashie', '~> 1.2'
24
24
  s.add_dependency 'multi_json', '~> 1.3'
25
+ s.add_dependency 'highline', '~> 1.6.15'
25
26
  s.add_development_dependency 'rake'
26
27
  s.add_development_dependency 'json_pure'
27
28
  s.add_development_dependency 'rspec', '~>2.9.0'
@@ -41,17 +41,8 @@ class Ghee
41
41
  #
42
42
  # Access_token - String of the access_token
43
43
  #
44
- def initialize(options = nil, &block)
45
-
46
- return @connection = Ghee::Connection.new(options, &block) unless options.nil?
47
-
48
- begin
49
- token = ENV["GH_TOKEN"] || `git config github.token`
50
- @connection = Ghee::Connection.new :access_token => token unless token.empty?
51
- raise "Couldn't find an auth token. Please run `ghee install <username>`" if token.empty?
52
- rescue Errno::ENOENT
53
- raise "Couldn't find git"
54
- end
44
+ def initialize(options = {}, &block)
45
+ return @connection = Ghee::Connection.new(options, &block)
55
46
  end
56
47
 
57
48
  def self.basic_auth(user_name, password, api_url = nil)
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  class Ghee
3
- VERSION = "0.9.8"
3
+ VERSION = "0.9.9"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-27 00:00:00.000000000Z
13
+ date: 2013-08-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
17
- requirement: &70271471415460 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,15 @@ dependencies:
22
22
  version: '0.8'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70271471415460
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: '0.8'
26
31
  - !ruby/object:Gem::Dependency
27
32
  name: faraday_middleware
28
- requirement: &70271471414980 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
29
34
  none: false
30
35
  requirements:
31
36
  - - ~>
@@ -33,10 +38,15 @@ dependencies:
33
38
  version: '0.9'
34
39
  type: :runtime
35
40
  prerelease: false
36
- version_requirements: *70271471414980
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '0.9'
37
47
  - !ruby/object:Gem::Dependency
38
48
  name: hashie
39
- requirement: &70271471445980 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
40
50
  none: false
41
51
  requirements:
42
52
  - - ~>
@@ -44,21 +54,47 @@ dependencies:
44
54
  version: '1.2'
45
55
  type: :runtime
46
56
  prerelease: false
47
- version_requirements: *70271471445980
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: '1.2'
48
63
  - !ruby/object:Gem::Dependency
49
64
  name: multi_json
50
- requirement: &70271471445520 !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ~>
69
+ - !ruby/object:Gem::Version
70
+ version: '1.3'
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
51
74
  none: false
52
75
  requirements:
53
76
  - - ~>
54
77
  - !ruby/object:Gem::Version
55
78
  version: '1.3'
79
+ - !ruby/object:Gem::Dependency
80
+ name: highline
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ~>
85
+ - !ruby/object:Gem::Version
86
+ version: 1.6.15
56
87
  type: :runtime
57
88
  prerelease: false
58
- version_requirements: *70271471445520
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ~>
93
+ - !ruby/object:Gem::Version
94
+ version: 1.6.15
59
95
  - !ruby/object:Gem::Dependency
60
96
  name: rake
61
- requirement: &70271471445140 !ruby/object:Gem::Requirement
97
+ requirement: !ruby/object:Gem::Requirement
62
98
  none: false
63
99
  requirements:
64
100
  - - ! '>='
@@ -66,10 +102,15 @@ dependencies:
66
102
  version: '0'
67
103
  type: :development
68
104
  prerelease: false
69
- version_requirements: *70271471445140
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
70
111
  - !ruby/object:Gem::Dependency
71
112
  name: json_pure
72
- requirement: &70271471444680 !ruby/object:Gem::Requirement
113
+ requirement: !ruby/object:Gem::Requirement
73
114
  none: false
74
115
  requirements:
75
116
  - - ! '>='
@@ -77,10 +118,15 @@ dependencies:
77
118
  version: '0'
78
119
  type: :development
79
120
  prerelease: false
80
- version_requirements: *70271471444680
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
81
127
  - !ruby/object:Gem::Dependency
82
128
  name: rspec
83
- requirement: &70271471444180 !ruby/object:Gem::Requirement
129
+ requirement: !ruby/object:Gem::Requirement
84
130
  none: false
85
131
  requirements:
86
132
  - - ~>
@@ -88,10 +134,15 @@ dependencies:
88
134
  version: 2.9.0
89
135
  type: :development
90
136
  prerelease: false
91
- version_requirements: *70271471444180
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ~>
141
+ - !ruby/object:Gem::Version
142
+ version: 2.9.0
92
143
  - !ruby/object:Gem::Dependency
93
144
  name: webmock
94
- requirement: &70271471443760 !ruby/object:Gem::Requirement
145
+ requirement: !ruby/object:Gem::Requirement
95
146
  none: false
96
147
  requirements:
97
148
  - - ! '>='
@@ -99,10 +150,15 @@ dependencies:
99
150
  version: '0'
100
151
  type: :development
101
152
  prerelease: false
102
- version_requirements: *70271471443760
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
103
159
  - !ruby/object:Gem::Dependency
104
160
  name: vcr
105
- requirement: &70271471443300 !ruby/object:Gem::Requirement
161
+ requirement: !ruby/object:Gem::Requirement
106
162
  none: false
107
163
  requirements:
108
164
  - - ! '>='
@@ -110,10 +166,15 @@ dependencies:
110
166
  version: '0'
111
167
  type: :development
112
168
  prerelease: false
113
- version_requirements: *70271471443300
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ none: false
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
114
175
  - !ruby/object:Gem::Dependency
115
176
  name: ZenTest
116
- requirement: &70271471442880 !ruby/object:Gem::Requirement
177
+ requirement: !ruby/object:Gem::Requirement
117
178
  none: false
118
179
  requirements:
119
180
  - - ! '>='
@@ -121,10 +182,15 @@ dependencies:
121
182
  version: '0'
122
183
  type: :development
123
184
  prerelease: false
124
- version_requirements: *70271471442880
185
+ version_requirements: !ruby/object:Gem::Requirement
186
+ none: false
187
+ requirements:
188
+ - - ! '>='
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
125
191
  - !ruby/object:Gem::Dependency
126
192
  name: autotest-growl
127
- requirement: &70271471442460 !ruby/object:Gem::Requirement
193
+ requirement: !ruby/object:Gem::Requirement
128
194
  none: false
129
195
  requirements:
130
196
  - - ! '>='
@@ -132,10 +198,15 @@ dependencies:
132
198
  version: '0'
133
199
  type: :development
134
200
  prerelease: false
135
- version_requirements: *70271471442460
201
+ version_requirements: !ruby/object:Gem::Requirement
202
+ none: false
203
+ requirements:
204
+ - - ! '>='
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
136
207
  - !ruby/object:Gem::Dependency
137
208
  name: uuidtools
138
- requirement: &70271471442040 !ruby/object:Gem::Requirement
209
+ requirement: !ruby/object:Gem::Requirement
139
210
  none: false
140
211
  requirements:
141
212
  - - ! '>='
@@ -143,7 +214,12 @@ dependencies:
143
214
  version: '0'
144
215
  type: :development
145
216
  prerelease: false
146
- version_requirements: *70271471442040
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ none: false
219
+ requirements:
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
147
223
  description: A complete, simple, and intuitive ruby API for all things Github.
148
224
  email:
149
225
  - rauh.ryan@gmail.com
@@ -230,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
306
  version: '0'
231
307
  requirements: []
232
308
  rubyforge_project: ghee
233
- rubygems_version: 1.8.15
309
+ rubygems_version: 1.8.24
234
310
  signing_key:
235
311
  specification_version: 3
236
312
  summary: Access Github in ruby.