Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: intinig/github-key-upload
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: gcimmino/github-key-upload
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jan 28, 2013

  1. Copy the full SHA
    c9b3e88 View commit details
  2. version 0.0.4

    gcimmino committed Jan 28, 2013
    Copy the full SHA
    2930f51 View commit details

Commits on Feb 4, 2013

  1. Copy the full SHA
    cde6b20 View commit details
Showing with 7 additions and 3 deletions.
  1. +2 −1 bin/github-key-upload
  2. +4 −1 lib/github-key-upload.rb
  3. +1 −1 lib/github-key-upload/version.rb
3 changes: 2 additions & 1 deletion bin/github-key-upload
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ opts = Slop.parse(:longest_flag => 1, :help => true) do
on :t, :title=, "Key Title"
on :u, :user=, "Github username"
on :P, :password=, "Github password"
on :V, "--verify-cert", "Verify github https certificate", :argument => :optional
on :l, "--check-title", "Checks if the supplied key exists (by title)"
on :c, "--check-key", "Checks if the supplied key exists (by key)"
on :C, "--check-both", "Checks if the supplied key exists (exact combination of key and title)"
@@ -35,7 +36,7 @@ if opts[:t].nil? && (opts[:l] || opts[:C] || opts[:c].nil?)
need_to_break = true
end

if opts[:u].nil? || opts[:P].nil?
unless opts[:u] && opts[:P]
puts "You need to specify both username and password (-u or --user and -P or --password)"
need_to_break = true
end
5 changes: 4 additions & 1 deletion lib/github-key-upload.rb
Original file line number Diff line number Diff line change
@@ -5,7 +5,10 @@ module Github
module Key
module Upload
def self.create_auth(options)
github = Github.new :basic_auth => "#{options[:user]}:#{options[:password]}"
github = Github.new do |config|
config.basic_auth = "#{options[:user]}:#{options[:password]}"
config.ssl = { :verify => false } unless options[:v]
end
github.oauth.create 'scopes' => ['user']
github
end
2 changes: 1 addition & 1 deletion lib/github-key-upload/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Github
module Key
module Upload
VERSION = "0.0.3"
VERSION = "0.0.4"
end
end
end