Permalink
Browse files

use Jeweler development release

  • Loading branch information...
1 parent 9a33dd2 commit 22b8eaed0f336dacfab1d49f38e6e03a40b2d1fe @helios committed Apr 22, 2013
Showing with 16 additions and 14 deletions.
  1. +1 −1 Gemfile
  2. +15 −13 lib/bio-gem/mod/jeweler.rb
View
@@ -3,7 +3,7 @@ source "http://rubygems.org"
# Example:
# gem "activesupport", ">= 2.3.5"
gem "bundler", ">= 1.0.21"
-gem "jeweler"
+gem "jeweler", "~> 1.8.4", :git => 'https://github.com/technicalpickles/jeweler.git'
gem "rdoc"
# Add dependencies to develop your gem here.
View
@@ -21,6 +21,8 @@ def initialize(options = {})
development_dependencies.delete_if { |k,v| k == "rcov" }
# Jeweler has a bug for bundler
development_dependencies.delete_if { |k,v| k == "bundler" }
+ development_dependencies.delete_if { |k,v| k == "jeweler" }
+ development_dependencies << ["jeweler",'~> 1.8.4", :git => "https://github.com/technicalpickles/jeweler.git']
development_dependencies << ["bundler", ">= 1.0.21"]
# development_dependencies << ["bio-logger"]
development_dependencies << ["bio", ">= 1.4.2"]
@@ -73,20 +75,20 @@ def puts_template_message(message, length=70, padding=4)
end
def create_and_push_repo
- return if $UNITTEST # skip github create when testing
- begin
- Net::HTTP.post_form URI.parse('http://github.com/api/v2/yaml/repos/create'),
- 'login' => github_username,
- 'token' => github_token,
- 'description' => summary,
- 'name' => github_repo_name
- # BY DEFAULT THE REPO IS CREATED
- # DO NOT PUSH THE REPO BECAUSE USER MUST ADD INFO TO CONFIGURATION FILES
- # TODO do a HEAD request to see when it's ready?
- #@repo.push('origin')
- rescue SocketError => se
- puts_template_message("Seems you are not connected to Internet, can't create a remote repository. Do not forget to create it by hand, from GitHub, and sync it with this project.")
+ puts "Please provide your Github password to create the Github repository"
+ begin
+ login = github_username
+ password = ask("Password: ") { |q| q.echo = false }
+ github = Github.new(:login => login.strip, :password => password.strip)
+ github.repos.create(:name => project_name, :description => summary)
+ rescue Github::Error::Unauthorized
+ puts "Wrong login/password! Please try again"
+ retry
+ rescue Github::Error::UnprocessableEntity
+ raise GitRepoCreationFailed, "Can't create that repo. Does it already exist?"
end
+ # TODO do a HEAD request to see when it's ready?
+ @repo.push('origin')
end
end #Generator
end #Jeweler

0 comments on commit 22b8eae

Please sign in to comment.