Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update to latest github_api release

  • Loading branch information...
commit 4571faeefec2fdd7abe452151eb0ec60781eba60 1 parent 25b38af
@pangratz pangratz authored
Showing with 15 additions and 15 deletions.
  1. +1 −1  Gemfile
  2. +10 −10 Gemfile.lock
  3. +4 −4 lib/github_uploader.rb
View
2  Gemfile
@@ -9,7 +9,7 @@ gem "uglifier", :git => "https://github.com/lautis/uglifier.git"
group :development do
gem "rack"
gem "rest-client"
- gem "github_api", "0.4.11"
+ gem "github_api"
gem "ember-docs", :git => "https://github.com/emberjs/docs-generator.git"
gem "kicker"
end
View
20 Gemfile.lock
@@ -33,30 +33,30 @@ GIT
GEM
remote: http://rubygems.org/
specs:
- addressable (2.2.8)
colored (1.2)
execjs (1.4.0)
multi_json (~> 1.0)
- faraday (0.7.6)
- addressable (~> 2.2)
+ faraday (0.8.1)
multipart-post (~> 1.1)
- rack (~> 1.1)
- github_api (0.4.11)
- faraday (~> 0.7.6)
+ github_api (0.5.4)
+ faraday (~> 0.8.0)
hashie (~> 1.2.0)
multi_json (~> 1.3)
nokogiri (~> 1.5.2)
- oauth2 (~> 0.5.2)
+ oauth2 (~> 0.7)
hashie (1.2.0)
+ httpauth (0.1)
kicker (2.5.0)
rb-fsevent
mime-types (1.18)
multi_json (1.3.6)
multipart-post (1.1.5)
nokogiri (1.5.3)
- oauth2 (0.5.2)
- faraday (~> 0.7)
+ oauth2 (0.7.1)
+ faraday (~> 0.8)
+ httpauth (~> 0.1)
multi_json (~> 1.0)
+ rack (~> 1.4)
rack (1.4.1)
rake (0.9.2.2)
rb-fsevent (0.9.1)
@@ -70,7 +70,7 @@ PLATFORMS
DEPENDENCIES
colored
ember-docs!
- github_api (= 0.4.11)
+ github_api
kicker
rack
rake-pipeline!
View
8 lib/github_uploader.rb
@@ -64,21 +64,21 @@ def upload_file(filename, description, file)
gh = Github.new :user => @username, :repo => @repo, :oauth_token => @token
# remvove previous download with the same name
- gh.repos.downloads do |download|
+ gh.repos.downloads.list @username, @repo do |download|
if filename == download.name
- gh.repos.delete_download @username, @repo, download.id
+ gh.repos.downloads.delete @username, @repo, download.id
break
end
end
# step 1
- hash = gh.repos.create_download @username, @repo,
+ hash = gh.repos.downloads.create @username, @repo,
"name" => filename,
"size" => File.size(file),
"description" => description
# step 2
- gh.repos.upload hash, file
+ gh.repos.downloads.upload hash, file
return true
end
Please sign in to comment.
Something went wrong with that request. Please try again.