Skip to content

Commit

Permalink
Only require github token if you are creating a repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
technicalpickles committed May 6, 2009
1 parent 66962cb commit fb05ff2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion ROADMAP
@@ -1,6 +1,5 @@
= 1.0 = 1.0


* Integrate more closely with rubyforge (less generated Rakefile stuff)
* Support github user/token on generator command line * Support github user/token on generator command line
* Add command to output the Jeweler::Tasks to help with upgrading/migrating * Add command to output the Jeweler::Tasks to help with upgrading/migrating
* Improve documentation on wiki/readme * Improve documentation on wiki/readme
Expand Down
6 changes: 4 additions & 2 deletions lib/jeweler/generator.rb
Expand Up @@ -182,8 +182,10 @@ def use_user_git_config
raise NoGitHubUser raise NoGitHubUser
end end


unless git_config.has_key? 'github.token' if should_create_repo
raise NoGitHubToken unless git_config.has_key? 'github.token'
raise NoGitHubToken
end
end end


self.user_name = git_config['user.name'] self.user_name = git_config['user.name']
Expand Down
4 changes: 2 additions & 2 deletions test/test_generator_initialization.rb
Expand Up @@ -68,9 +68,9 @@ def stub_git_config(options = {})
stub_git_config 'user.name' => @git_name, 'user.email' => @git_email, 'github.user' => @github_user stub_git_config 'user.name' => @git_name, 'user.email' => @git_email, 'github.user' => @github_user
end end


should 'raise NoGitHubToken' do should 'raise NoGitHubToken if creating repo' do
assert_raise Jeweler::NoGitHubToken do assert_raise Jeweler::NoGitHubToken do
Jeweler::Generator.new(@project_name) Jeweler::Generator.new(@project_name, :create_repo => true)
end end
end end
end end
Expand Down

0 comments on commit fb05ff2

Please sign in to comment.