git_hub_bub 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/README.md +3 -1
- data/changelog.md +4 -0
- data/lib/git_hub_bub/request.rb +5 -4
- data/lib/git_hub_bub/version.rb +1 -1
- data/test/fixtures/vcr_cassettes/PATCH_user.yml +2 -2
- data/test/test_helper.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a831b1f3d872ae4e48c2bc73ed9e50237ae8c8b
|
4
|
+
data.tar.gz: 32d3db1faf622bc54f5eaad2fe17ff977749e326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a90a9852e3ee0667579a58ea3a48dc70e70a85e397e4bd71dcb4295f58c117015bbbc4ce5c68b5ddfb9eaa107856b05faf3639296e0890bf183790259d0e51a
|
7
|
+
data.tar.gz: 52bf1b48b14df6884f6266e8749f911d272672494d140d136edd8e906c582d3d162e4ac4410e84b6a363466a92cf954baf62bdf2ed97075b6cf94e90a12f37c0
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# GitHubBub
|
2
2
|
|
3
|
+
[](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.
|
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
data/lib/git_hub_bub/request.rb
CHANGED
@@ -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
|
15
|
-
self.options
|
16
|
-
self.options[:query]
|
17
|
-
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 = {})
|
data/lib/git_hub_bub/version.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://api.github.com/user?name=
|
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
|
-
|
32
|
-
|
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.
|
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-
|
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.
|
145
|
+
rubygems_version: 2.0.3
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: git_hub_bub makes github requests
|