wfarr-github 0.4.2 → 0.4.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rake'
4
4
  begin
5
5
  require 'echoe'
6
6
 
7
- Echoe.new('github', '0.4.2') do |p|
7
+ Echoe.new('github', '0.4.2.1') do |p|
8
8
  p.rubyforge_name = 'github'
9
9
  p.summary = "The official `github` command line helper for simplifying your GitHub experience."
10
10
  p.description = "The official `github` command line helper for simplifying your GitHub experience."
@@ -13,7 +13,8 @@ begin
13
13
  p.email = "chris@ozmm.org"
14
14
  p.dependencies = [
15
15
  "text-format >=1.0.0",
16
- "highline ~>1.5.1"
16
+ "highline ~>1.5.1",
17
+ "json >= 1.2.0"
17
18
  ]
18
19
  end
19
20
 
@@ -2,37 +2,39 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{wfarr-github}
5
- s.version = "0.4.2"
5
+ s.version = "0.4.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Chris Wanstrath, Kevin Ballard, Scott Chacon, Dr Nic Williams"]
9
- s.date = %q{2009-11-11}
9
+ s.date = %q{2009-11-19}
10
10
  s.description = %q{The official `github` command line helper for simplifying your GitHub experience.}
11
11
  s.email = %q{chris@ozmm.org}
12
12
  s.executables = ["gh", "github"]
13
13
  s.extra_rdoc_files = ["LICENSE", "README.md", "bin/gh", "bin/github", "lib/commands/commands.rb", "lib/commands/helpers.rb", "lib/commands/issues.rb", "lib/commands/network.rb", "lib/github.rb", "lib/github/command.rb", "lib/github/extensions.rb", "lib/github/helper.rb", "lib/github/ui.rb"]
14
14
  s.files = ["History.txt", "LICENSE", "Manifest", "README.md", "Rakefile", "bin/gh", "bin/github", "lib/commands/commands.rb", "lib/commands/helpers.rb", "lib/commands/issues.rb", "lib/commands/network.rb", "lib/github.rb", "lib/github/command.rb", "lib/github/extensions.rb", "lib/github/helper.rb", "lib/github/ui.rb", "setup.rb", "spec/command_spec.rb", "spec/commands/command_browse_spec.rb", "spec/commands/command_clone_spec.rb", "spec/commands/command_create-from-local_spec.rb", "spec/commands/command_fetch_spec.rb", "spec/commands/command_fork_spec.rb", "spec/commands/command_helper.rb", "spec/commands/command_home_spec.rb", "spec/commands/command_info_spec.rb", "spec/commands/command_issues_spec.rb", "spec/commands/command_network_spec.rb", "spec/commands/command_pull-request_spec.rb", "spec/commands/command_pull_spec.rb", "spec/commands/command_search_spec.rb", "spec/commands/command_track_spec.rb", "spec/commands_spec.rb", "spec/extensions_spec.rb", "spec/github_spec.rb", "spec/helper_spec.rb", "spec/spec_helper.rb", "spec/windoze_spec.rb", "github.gemspec"]
15
- s.has_rdoc = true
16
15
  s.homepage = %q{http://github.com/}
17
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Github", "--main", "README.md"]
18
17
  s.require_paths = ["lib"]
19
18
  s.rubyforge_project = %q{github}
20
- s.rubygems_version = %q{1.3.1}
19
+ s.rubygems_version = %q{1.3.5}
21
20
  s.summary = %q{The official `github` command line helper for simplifying your GitHub experience.}
22
21
 
23
22
  if s.respond_to? :specification_version then
24
23
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
- s.specification_version = 2
24
+ s.specification_version = 3
26
25
 
27
26
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
27
  s.add_runtime_dependency(%q<text-format>, [">= 1.0.0"])
29
28
  s.add_runtime_dependency(%q<highline>, ["~> 1.5.1"])
29
+ s.add_runtime_dependency(%q<json>, [">= 0", "= 1.2.0"])
30
30
  else
31
31
  s.add_dependency(%q<text-format>, [">= 1.0.0"])
32
32
  s.add_dependency(%q<highline>, ["~> 1.5.1"])
33
+ s.add_dependency(%q<json>, [">= 0", "= 1.2.0"])
33
34
  end
34
35
  else
35
36
  s.add_dependency(%q<text-format>, [">= 1.0.0"])
36
37
  s.add_dependency(%q<highline>, ["~> 1.5.1"])
38
+ s.add_dependency(%q<json>, [">= 0", "= 1.2.0"])
37
39
  end
38
40
  end
@@ -181,7 +181,7 @@ flags :rdoc => 'Create README.rdoc'
181
181
  flags :rst => 'Create README.rst'
182
182
  flags :private => 'Create private repository'
183
183
  command :create do |repo|
184
- sh "curl -F 'repository[name]=#{repo}' -F 'repository[public]=#{!options[:private]}' -F 'login=#{github_user}' -F 'token=#{github_token}' http://github.com/repositories"
184
+ http_post(URI.parse('http://github.com/repositories'),{'repository[name]'=> repo, 'repository[public]'=> !options[:private], 'login' => github_user, 'token' => github_token})
185
185
  mkdir repo
186
186
  cd repo
187
187
  git "init"
@@ -211,7 +211,7 @@ command :fork do |user, repo|
211
211
  end
212
212
  end
213
213
 
214
- sh "curl -F 'login=#{github_user}' -F 'token=#{github_token}' http://github.com/#{user}/#{repo}/fork"
214
+ http_post(URI.parse("http://github.com/#{user}/#{repo}/fork"), 'login' => github_user, 'token' => github_token)
215
215
 
216
216
  url = "git@github.com:#{github_user}/#{repo}.git"
217
217
  if is_repo
@@ -231,7 +231,9 @@ command :'create-from-local' do
231
231
  repo = File.basename(cwd)
232
232
  is_repo = !git("status").match(/fatal/)
233
233
  raise "Not a git repository. Use gh create instead" unless is_repo
234
- sh "curl -F 'repository[name]=#{repo}' -F 'repository[public]=#{!options[:private].inspect} -F 'login=#{github_user}' -F 'token=#{github_token}' http://github.com/repositories"
234
+ http_post(URI.parse('http://github.com/repositories'),
235
+ 'repository[name]' => repo, 'repository[public]' => !options[:private].inspect,
236
+ 'login' => github_user, 'token' => github_token)
235
237
  git "remote add origin git@github.com:#{github_user}/#{repo}.git"
236
238
  git_exec "push origin master"
237
239
  end
@@ -9,6 +9,8 @@ require 'open-uri'
9
9
  require 'json'
10
10
  require 'yaml'
11
11
  require 'text/format'
12
+ require 'net/http'
13
+ require 'uri'
12
14
 
13
15
  ##
14
16
  # Starting simple.
@@ -44,7 +44,13 @@ module GitHub
44
44
  def git_exec(command)
45
45
  run :exec, command
46
46
  end
47
-
47
+
48
+ def http_post(*args)
49
+ #require 'net/http' #need to work out a more appropriate place to put this
50
+ GitHub.learn "Net::HTTP.post_form: " + args.inspect
51
+ Net::HTTP.post_form(*args)
52
+ end
53
+
48
54
  def run(method, command)
49
55
  if command.is_a? Array
50
56
  command = [ 'git', command ].flatten
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wfarr-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath, Kevin Ballard, Scott Chacon, Dr Nic Williams
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-11 00:00:00 -05:00
12
+ date: 2009-11-19 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -32,6 +32,19 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.5.1
34
34
  version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: json
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ - - "="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.2.0
47
+ version:
35
48
  description: The official `github` command line helper for simplifying your GitHub experience.
36
49
  email: chris@ozmm.org
37
50
  executables:
@@ -124,7 +137,7 @@ requirements: []
124
137
  rubyforge_project: github
125
138
  rubygems_version: 1.3.5
126
139
  signing_key:
127
- specification_version: 2
140
+ specification_version: 3
128
141
  summary: The official `github` command line helper for simplifying your GitHub experience.
129
142
  test_files: []
130
143