git_hub_bub 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 833f07fd265f877003b7f27782bd3c0b40b63cfe
4
- data.tar.gz: 4e63581207216c9c6147a384f7ea411c3432fd04
3
+ metadata.gz: 5a831b1f3d872ae4e48c2bc73ed9e50237ae8c8b
4
+ data.tar.gz: 32d3db1faf622bc54f5eaad2fe17ff977749e326
5
5
  SHA512:
6
- metadata.gz: 78424f9c9e28d47175c5c7ae70a9f5ac247be3bec1659cd7e33a3393e2167cc6a55675f81d14a891492564a48ddb48ff6037703a54a8c1e0bc8980a921a59583
7
- data.tar.gz: 73fe92e332b1098962208a9ebe487855981c2cbeddea6f003208f0e5b6d128fc7f4d4b65dc8da2b08bf13d903e1c80a140905ed430837dacca8f3ea53042edd2
6
+ metadata.gz: 0a90a9852e3ee0667579a58ea3a48dc70e70a85e397e4bd71dcb4295f58c117015bbbc4ce5c68b5ddfb9eaa107856b05faf3639296e0890bf183790259d0e51a
7
+ data.tar.gz: 52bf1b48b14df6884f6266e8749f911d272672494d140d136edd8e906c582d3d162e4ac4410e84b6a363466a92cf954baf62bdf2ed97075b6cf94e90a12f37c0
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  .env
2
2
  .DS_Store
3
- Gemfile.lock
3
+ Gemfile.lock
4
+ *.gem
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # GitHubBub
2
2
 
3
+ [![Build Status](https://travis-ci.org/schneems/git_hub_bub.png?branch=master)](https://travis-ci.org/schneems/git_hub_bub)
4
+
3
5
  A low level GitHub client that makes the disgusting issue of header based url pagination simple.
4
6
 
5
7
  ## What
@@ -106,7 +108,7 @@ You will need to use one of these every time the GitHub api says "as an authenti
106
108
  If you want to mess with the url or options before sending a request you can set a callback globally
107
109
 
108
110
  ```ruby
109
- GitHubBub::Request.set_callback do |request|
111
+ GitHubBub::Request.set_before_callback do |request|
110
112
  request.url = "http://schneems.com"
111
113
  request.options = {do: "anything you want to _all_ the requests" }
112
114
  end
data/changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.0.2 (07/15/2013)
2
+
3
+ - Fix randomly changing github API requirements. (https://github.com/geemus/excon/issues/249#issuecomment-21002566)
4
+
1
5
  ## 0.0.1 (05/21/2012)
2
6
 
3
7
  - Hello World
@@ -8,13 +8,14 @@ module GitHubBub
8
8
  GITHUB_VERSION = "vnd.github.3.raw+json"
9
9
  EXTRA_HEADERS ||= {}
10
10
  BASE_HEADERS = EXTRA_HEADERS.merge({'Accept' => "application/#{GITHUB_VERSION}", "User-Agent" => USER_AGENT})
11
+ BASE_OPTIONS = { omit_default_port: true }
11
12
  RETRIES = 1
12
13
 
13
14
  def initialize(url, query = {}, options = {})
14
- self.url = url.include?("http") ? url : File.join(BASE_URI, url)
15
- self.options = options || {}
16
- self.options[:query] = query if query && !query.empty?
17
- options[:headers] = BASE_HEADERS.merge(options[:headers]|| {})
15
+ self.url = url.include?("http") ? url : File.join(BASE_URI, url)
16
+ self.options = BASE_OPTIONS.merge(options || {})
17
+ self.options[:query] = query if query && !query.empty?
18
+ self.options[:headers] = BASE_HEADERS.merge(options[:headers]|| {})
18
19
  end
19
20
 
20
21
  def self.head(url, query = {}, options = {})
@@ -1,3 +1,3 @@
1
1
  module GitHubBub
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.github.com/user?name=Richard%20Schneeman
5
+ uri: https://api.github.com/user?name=USER_NAME
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"name":"<USER_NAME>"}'
@@ -62,6 +62,6 @@ http_interactions:
62
62
  enjoy contributing to open source projects. If you find yourself at an austinonrails.org
63
63
  meeting you''ll likely find me in the crowd or giving a presentation. Come
64
64
  say hi!","public_repos":77,"followers":273,"following":3,"created_at":"2009-03-03T16:11:07Z","updated_at":"2013-05-21T20:03:31Z","public_gists":63,"total_private_repos":7,"owned_private_repos":3,"disk_usage":37476,"collaborators":4,"plan":{"name":"micro","space":614400,"collaborators":1,"private_repos":5},"private_gists":109,"site_admin":false}'
65
- http_version:
65
+ http_version:
66
66
  recorded_at: Tue, 21 May 2013 20:03:41 GMT
67
67
  recorded_with: VCR 2.5.0
data/test/test_helper.rb CHANGED
@@ -28,11 +28,11 @@ VCR.configure do |c|
28
28
  c.cassette_library_dir = 'test/fixtures/vcr_cassettes'
29
29
  c.hook_into :webmock # or :fakeweb
30
30
 
31
- %W{GITHUB_API_KEY OWNER REPO USER_NAME WATCH_OWNER WATCH_REPO}.each do |secure|
32
- c.filter_sensitive_data("<#{secure}>") { ENV[secure] ||= secure }
31
+ 'GITHUB_API_KEY OWNER REPO USER_NAME WATCH_OWNER WATCH_REPO'.split(' ').each do |secure|
32
+ sensitive = ENV[secure] ||= secure
33
+ c.filter_sensitive_data("<#{secure}>") { sensitive }
33
34
  end
34
35
  end
35
36
 
36
-
37
37
  require 'dotenv'
38
- Dotenv.load
38
+ Dotenv.load
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_hub_bub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-22 00:00:00.000000000 Z
11
+ date: 2013-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rrrretry
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.0.2
145
+ rubygems_version: 2.0.3
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: git_hub_bub makes github requests