github 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github (0.6.2)
4
+ github (0.7.0)
5
5
  highline (~> 1.5.1)
6
6
  json_pure (~> 1.5.1)
7
7
  launchy (~> 0.3.7)
@@ -23,15 +23,17 @@ GEM
23
23
  activesupport (3.0.5)
24
24
  arel (2.0.9)
25
25
  builder (2.1.2)
26
- configuration (1.2.0)
26
+ configuration (1.3.1)
27
27
  highline (1.5.2)
28
28
  i18n (0.5.0)
29
- json_pure (1.5.1)
29
+ json_pure (1.5.4)
30
+ spruz (~> 0.2.8)
30
31
  launchy (0.3.7)
31
32
  configuration (>= 0.0.5)
32
33
  rake (>= 0.8.1)
33
34
  rake (0.8.7)
34
35
  rspec (1.3.1)
36
+ spruz (0.2.13)
35
37
  text-format (1.0.0)
36
38
  text-hyphen (~> 1.0.0)
37
39
  text-hyphen (1.0.0)
@@ -1,3 +1,7 @@
1
+ == 0.7.0 2012-03-20
2
+
3
+ * Fixed fork + create-from-local tasks (moved to github v2 API)
4
+
1
5
  == 0.6.2 2011-04-03
2
6
 
3
7
  * No C-extension dependencies by default (using json_pure instead of json)
data/README.md CHANGED
@@ -6,7 +6,6 @@ Catch us in the #github room on freenode if you want to get involved. Or just f
6
6
 
7
7
  ## Getting started
8
8
 
9
- $ gem source --add http://gemcutter.org
10
9
  $ gem install github
11
10
 
12
11
  Run it:
@@ -223,33 +223,46 @@ command :fork do |user, repo|
223
223
  end
224
224
  end
225
225
 
226
- sh "curl -F 'login=#{github_user}' -F 'token=#{github_token}' https://github.com/#{user}/#{repo}/fork"
227
-
228
- url = "git@github.com:#{github_user}/#{repo}.git"
229
- if is_repo
230
- git "config remote.origin.url #{url}"
231
- puts "#{user}/#{repo} forked"
226
+ current_origin = git "config remote.origin.url"
227
+
228
+ output_json = sh "curl -F 'login=#{github_user}' -F 'token=#{github_token}' https://github.com/api/v2/json/repos/fork/#{user}/#{repo}"
229
+ output = JSON.parse(output_json)
230
+ if output["error"]
231
+ die output["error"]
232
232
  else
233
- puts "Giving GitHub a moment to create the fork..."
234
- sleep 3
235
- git_exec "clone #{url}"
233
+ url = "git@github.com:#{github_user}/#{repo}.git"
234
+ if is_repo
235
+ git "config remote.origin.url #{url}"
236
+ git "config remote.parent.url #{current_origin}"
237
+ puts "#{user}/#{repo} forked"
238
+ else
239
+ puts "Giving GitHub a moment to create the fork..."
240
+ sleep 3
241
+ git_exec "clone #{url}"
242
+ end
236
243
  end
237
244
  end
238
245
 
239
246
  desc "Create a new GitHub repository from the current local repository"
247
+ usage "github create-from-local [repo_name]"
240
248
  flags :private => 'Create private repository'
241
- command :'create-from-local' do
249
+ command :'create-from-local' do |repo_name|
242
250
  cwd = sh "pwd"
243
- repo = File.basename(cwd)
251
+ if repo_name.nil?
252
+ repo = File.basename(cwd)
253
+ else
254
+ repo = repo_name
255
+ end
244
256
  is_repo = !git("status").match(/fatal/)
245
- raise "Not a git repository. Use gh create instead" unless is_repo
246
- created = sh "curl -F 'repository[name]=#{repo}' -F 'repository[public]=#{options[:private] != true}' -F 'login=#{github_user}' -F 'token=#{github_token}' https://github.com/repositories"
247
- if created.out =~ %r{You are being <a href="https://github.com/#{github_user}/([^"]+)"}
248
- git "remote add origin git@github.com:#{github_user}/#{$1}.git"
249
- git_exec "push origin master"
257
+ raise "Not a git repository. Use 'gh create' instead" unless is_repo
258
+ command = "curl -F 'name=#{repo}' -F 'public=#{options[:private] ? 0 : 1}' -F 'login=#{github_user}' -F 'token=#{github_token}' https://github.com/api/v2/json/repos/create"
259
+ output_json = sh command
260
+ output = JSON.parse(output_json)
261
+ if output["error"]
262
+ die output["error"]
250
263
  else
251
- #TODO try to explain why it failed
252
- die "error creating repository"
264
+ git "remote add origin git@github.com:#{github_user}/#{repo}.git"
265
+ git_exec "push origin master"
253
266
  end
254
267
  end
255
268
 
@@ -1,3 +1,3 @@
1
1
  module GitHub
2
- VERSION = "0.6.2"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: github
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.0
4
5
  prerelease:
5
- version: 0.6.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Chris Wanstrath
9
9
  - Kevin Ballard
10
10
  - Scott Chacon
@@ -12,109 +12,106 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
-
16
- date: 2011-04-03 00:00:00 -04:00
17
- default_executable:
18
- dependencies:
19
- - !ruby/object:Gem::Dependency
15
+ date: 2012-03-21 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
20
18
  name: text-hyphen
21
- requirement: &id001 !ruby/object:Gem::Requirement
19
+ requirement: &70209643793360 !ruby/object:Gem::Requirement
22
20
  none: false
23
- requirements:
24
- - - "="
25
- - !ruby/object:Gem::Version
21
+ requirements:
22
+ - - =
23
+ - !ruby/object:Gem::Version
26
24
  version: 1.0.0
27
25
  type: :runtime
28
26
  prerelease: false
29
- version_requirements: *id001
30
- - !ruby/object:Gem::Dependency
27
+ version_requirements: *70209643793360
28
+ - !ruby/object:Gem::Dependency
31
29
  name: text-format
32
- requirement: &id002 !ruby/object:Gem::Requirement
30
+ requirement: &70209643792860 !ruby/object:Gem::Requirement
33
31
  none: false
34
- requirements:
35
- - - "="
36
- - !ruby/object:Gem::Version
32
+ requirements:
33
+ - - =
34
+ - !ruby/object:Gem::Version
37
35
  version: 1.0.0
38
36
  type: :runtime
39
37
  prerelease: false
40
- version_requirements: *id002
41
- - !ruby/object:Gem::Dependency
38
+ version_requirements: *70209643792860
39
+ - !ruby/object:Gem::Dependency
42
40
  name: highline
43
- requirement: &id003 !ruby/object:Gem::Requirement
41
+ requirement: &70209643792400 !ruby/object:Gem::Requirement
44
42
  none: false
45
- requirements:
43
+ requirements:
46
44
  - - ~>
47
- - !ruby/object:Gem::Version
45
+ - !ruby/object:Gem::Version
48
46
  version: 1.5.1
49
47
  type: :runtime
50
48
  prerelease: false
51
- version_requirements: *id003
52
- - !ruby/object:Gem::Dependency
49
+ version_requirements: *70209643792400
50
+ - !ruby/object:Gem::Dependency
53
51
  name: json_pure
54
- requirement: &id004 !ruby/object:Gem::Requirement
52
+ requirement: &70209643791940 !ruby/object:Gem::Requirement
55
53
  none: false
56
- requirements:
54
+ requirements:
57
55
  - - ~>
58
- - !ruby/object:Gem::Version
56
+ - !ruby/object:Gem::Version
59
57
  version: 1.5.1
60
58
  type: :runtime
61
59
  prerelease: false
62
- version_requirements: *id004
63
- - !ruby/object:Gem::Dependency
60
+ version_requirements: *70209643791940
61
+ - !ruby/object:Gem::Dependency
64
62
  name: launchy
65
- requirement: &id005 !ruby/object:Gem::Requirement
63
+ requirement: &70209643791480 !ruby/object:Gem::Requirement
66
64
  none: false
67
- requirements:
65
+ requirements:
68
66
  - - ~>
69
- - !ruby/object:Gem::Version
67
+ - !ruby/object:Gem::Version
70
68
  version: 0.3.7
71
69
  type: :runtime
72
70
  prerelease: false
73
- version_requirements: *id005
74
- - !ruby/object:Gem::Dependency
71
+ version_requirements: *70209643791480
72
+ - !ruby/object:Gem::Dependency
75
73
  name: rake
76
- requirement: &id006 !ruby/object:Gem::Requirement
74
+ requirement: &70209643807460 !ruby/object:Gem::Requirement
77
75
  none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: "0"
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
82
80
  type: :development
83
81
  prerelease: false
84
- version_requirements: *id006
85
- - !ruby/object:Gem::Dependency
82
+ version_requirements: *70209643807460
83
+ - !ruby/object:Gem::Dependency
86
84
  name: rspec
87
- requirement: &id007 !ruby/object:Gem::Requirement
85
+ requirement: &70209643806920 !ruby/object:Gem::Requirement
88
86
  none: false
89
- requirements:
87
+ requirements:
90
88
  - - ~>
91
- - !ruby/object:Gem::Version
89
+ - !ruby/object:Gem::Version
92
90
  version: 1.3.1
93
91
  type: :development
94
92
  prerelease: false
95
- version_requirements: *id007
96
- - !ruby/object:Gem::Dependency
93
+ version_requirements: *70209643806920
94
+ - !ruby/object:Gem::Dependency
97
95
  name: activerecord
98
- requirement: &id008 !ruby/object:Gem::Requirement
96
+ requirement: &70209643806420 !ruby/object:Gem::Requirement
99
97
  none: false
100
- requirements:
98
+ requirements:
101
99
  - - ~>
102
- - !ruby/object:Gem::Version
100
+ - !ruby/object:Gem::Version
103
101
  version: 3.0.0
104
102
  type: :development
105
103
  prerelease: false
106
- version_requirements: *id008
107
- description: The official `github` command line helper for simplifying your GitHub experience.
108
- email:
104
+ version_requirements: *70209643806420
105
+ description: The official `github` command line helper for simplifying your GitHub
106
+ experience.
107
+ email:
109
108
  - drnicwilliams@gmail.com
110
- executables:
109
+ executables:
111
110
  - gh
112
111
  - github
113
112
  extensions: []
114
-
115
113
  extra_rdoc_files: []
116
-
117
- files:
114
+ files:
118
115
  - .gitignore
119
116
  - Gemfile
120
117
  - Gemfile.lock
@@ -161,41 +158,37 @@ files:
161
158
  - spec/resources/help_output.txt
162
159
  - spec/spec_helper.rb
163
160
  - spec/windoze_spec.rb
164
- has_rdoc: true
165
161
  homepage: https://github.com/defunkt/github-gem
166
162
  licenses: []
167
-
168
163
  post_install_message:
169
164
  rdoc_options: []
170
-
171
- require_paths:
165
+ require_paths:
172
166
  - lib
173
- required_ruby_version: !ruby/object:Gem::Requirement
167
+ required_ruby_version: !ruby/object:Gem::Requirement
174
168
  none: false
175
- requirements:
176
- - - ">="
177
- - !ruby/object:Gem::Version
178
- hash: 777213638936461035
179
- segments:
169
+ requirements:
170
+ - - ! '>='
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ segments:
180
174
  - 0
181
- version: "0"
182
- required_rubygems_version: !ruby/object:Gem::Requirement
175
+ hash: -244349371876441736
176
+ required_rubygems_version: !ruby/object:Gem::Requirement
183
177
  none: false
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- hash: 777213638936461035
188
- segments:
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ segments:
189
183
  - 0
190
- version: "0"
184
+ hash: -244349371876441736
191
185
  requirements: []
192
-
193
186
  rubyforge_project: github
194
- rubygems_version: 1.6.0
187
+ rubygems_version: 1.8.17
195
188
  signing_key:
196
189
  specification_version: 3
197
190
  summary: The official `github` command line helper for simplifying your GitHub experience.
198
- test_files:
191
+ test_files:
199
192
  - spec/command_spec.rb
200
193
  - spec/commands/command_admin_spec.rb
201
194
  - spec/commands/command_browse_spec.rb