octokit 1.7.0 → 1.8.0

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.
@@ -1,5 +1,6 @@
1
1
  # CHANGELOG
2
2
 
3
+ * [1.8.0 - June 18, 2012](https://github.com/pengwynn/octokit/compare/v1.7.0...v1.8.0)
3
4
  * [1.7.0 - June 18, 2012](https://github.com/pengwynn/octokit/compare/v1.6.1...v1.7.0)
4
5
  * [1.6.1 - June 14, 2012](https://github.com/pengwynn/octokit/compare/v1.6.0...v1.6.1)
5
6
  * [1.6.0 - June 14, 2012](https://github.com/pengwynn/octokit/compare/v1.5.0...v1.6.0)
data/README.md CHANGED
@@ -103,6 +103,16 @@ implementation, you will be personally responsible for providing patches in a
103
103
  timely fashion. If critical issues for a particular implementation exist at the
104
104
  time of a major release, support for that Ruby version may be dropped.
105
105
 
106
+ ## Contributors
107
+
108
+ Octokit was initially created by Wynn Netherland and [Adam
109
+ Stacoviak](http://twitter.com/adamstac) but has
110
+ turned into a true community effort. Special thanks to the following core
111
+ contributors:
112
+
113
+ * [Erik Michaels-Ober](http://github.com/sferik)
114
+ * [Clint Shryock](http://github.com/ctshryock)
115
+
106
116
  ## Inspiration
107
117
  Octokit was inspired by [Octopi][] and aims to be a lightweight,
108
118
  less-ActiveResourcey alternative.
@@ -20,6 +20,7 @@ require 'octokit/client/users'
20
20
  require 'octokit/client/events'
21
21
  require 'octokit/client/authorizations'
22
22
  require 'octokit/client/refs'
23
+ require 'octokit/client/contents'
23
24
 
24
25
  module Octokit
25
26
  class Client
@@ -52,5 +53,6 @@ module Octokit
52
53
  include Octokit::Client::Events
53
54
  include Octokit::Client::Authorizations
54
55
  include Octokit::Client::Refs
56
+ include Octokit::Client::Contents
55
57
  end
56
58
  end
@@ -0,0 +1,51 @@
1
+ module Octokit
2
+ class Client
3
+ module Contents
4
+
5
+ # Receive the default Readme for a repository
6
+ #
7
+ # @param repo [String, Repository, Hash] A GitHub repository
8
+ # @param ref [String] The String name of the Commit/Branch/Tag. Defaults to “master”.
9
+ # @option options [String] :ref name of the Commit/Branch/Tag. Defaults to “master”.
10
+ # @return [Hash] The detail of the readme
11
+ # @see http://developer.github.com/v3/repos/contents/
12
+ # @example Get the readme file for a repo
13
+ # Octokit.readme("pengwynn/octokit")
14
+ def readme(repo, options={})
15
+ get("/repos/#{Repository.new repo}/readme", options, 3)
16
+ end
17
+
18
+ # Receive a listing of a repository folder or the contents of a file
19
+ #
20
+ # @param repo [String, Repository, Hash] A GitHub repository
21
+ # @option options [String] :path A folder or file path
22
+ # @option options [String] :ref name of the Commit/Branch/Tag. Defaults to “master”.
23
+ # @return [Hash] The contents of a file or list of the files in the folder
24
+ # @see http://developer.github.com/v3/repos/contents/
25
+ # @example List the contents of lib/octokit.rb
26
+ # Octokit.contents("pengwynn/octokit", :path => 'lib/octokit.rb')
27
+ def contents(repo, options={})
28
+ repo_path = options.delete :path
29
+ url = "/repos/#{Repository.new repo}/contents/#{repo_path}"
30
+ get(url, options, 3)
31
+ end
32
+
33
+ # This method will provide a URL to download a tarball or zipball archive for a repository.
34
+ #
35
+ # @param repo [String, Repository, Hash] A GitHub repository.
36
+ # @option options format [String] Either tarball (default) or zipball.
37
+ # @option options [String] :ref Optional valid Git reference, defaults to master.
38
+ # @return [String] Location of the download
39
+ # @see http://developer.github.com/v3/repos/contents/
40
+ # @example Get archive link for pengwynn/octokit
41
+ # Octokit.archive_link("pengwynn/octokit")
42
+ def archive_link(repo, options={})
43
+ repo_ref = options.delete :ref
44
+ format = (options.delete :format) || 'tarball'
45
+ url = "/repos/#{Repository.new repo}/#{format}/#{repo_ref}"
46
+ headers = get(url, options, 3, false, true).headers
47
+ return headers['location']
48
+ end
49
+ end
50
+ end
51
+ end
@@ -26,7 +26,16 @@ module Octokit
26
26
  get("repos/#{Repository.new(repo)}/downloads/#{id}", options, 3)
27
27
  end
28
28
 
29
-
29
+ # Create a download in a repository
30
+ #
31
+ # @param repo [String, Repository, Hash] A GitHub repository
32
+ # @param name [String, Repository, Hash] A display name for the download
33
+ # @option options [String] :description The download description
34
+ # @option options [String] :content_type The content type. Defaults to 'text/plain'
35
+ # @return [Download] A single download from the repository
36
+ # @see http://developer.github.com/v3/repos/downloads/#create-a-new-download-part-1-create-the-resource
37
+ # @example Create the "Robawt" download on Github/Hubot
38
+ # Octokit.create_download("github/hubot", 'Robawt')
30
39
  def create_download(repo, name, options={})
31
40
  options[:content_type] ||= 'text/plain'
32
41
  file = Faraday::UploadIO.new(name, options[:content_type])
@@ -84,6 +84,13 @@ module Octokit
84
84
  end
85
85
  alias :remove_team_repo :remove_team_repository
86
86
 
87
+ def remove_organization_member(org, user, options={})
88
+ # this is a synonym for: for team in org.teams: remove_team_member(team.id, user)
89
+ # provided in the GH API v3
90
+ delete("orgs/#{org}/members/#{user}", options, 3, true, raw=true).status == 204
91
+ end
92
+ alias :remove_org_member :remove_organization_member
93
+
87
94
  def publicize_membership(org, user, options={})
88
95
  put("orgs/#{org}/public_members/#{user}", options, 3, true, raw=true).status == 204
89
96
  end
@@ -60,10 +60,12 @@ module Octokit
60
60
  alias :delete_repo :delete_repository
61
61
 
62
62
  def set_private(repo, options={})
63
+ # GitHub Api for setting private updated to use private attr, rather than public
63
64
  update_repository repo, options.merge({ :private => true })
64
65
  end
65
66
 
66
67
  def set_public(repo, options={})
68
+ # GitHub Api for setting private updated to use private attr, rather than public
67
69
  update_repository repo, options.merge({ :private => false })
68
70
  end
69
71
 
@@ -127,6 +129,19 @@ module Octokit
127
129
  get "/repos/#{Repository.new repo}/branches", options, 3
128
130
  end
129
131
 
132
+ # Get a single branch from a repository
133
+ #
134
+ # @param repo [String, Repository, Hash] A GitHub repository
135
+ # @param branch [String] Branch name
136
+ # @return [Branch] The branch requested, if it exists
137
+ # @see http://developer.github.com/v3/repos/#get-branch
138
+ # @example Get branch 'master` from pengwynn/octokit
139
+ # Octokit.issue("pengwynn/octokit", "master")
140
+ def branch(repo, branch, options={})
141
+ get "/repos/#{Repository.new repo}/branches/#{branch}", options, 3
142
+ end
143
+ alias :get_branch :branch
144
+
130
145
  def hooks(repo, options={})
131
146
  get "/repos/#{Repository.new repo}/hooks", options, 3
132
147
  end
@@ -1,3 +1,3 @@
1
1
  module Octokit
2
- VERSION = "1.7.0" unless defined?(Octokit::VERSION)
2
+ VERSION = "1.8.0" unless defined?(Octokit::VERSION)
3
3
  end
@@ -14,9 +14,9 @@ Gem::Specification.new do |gem|
14
14
  gem.add_development_dependency 'simplecov'
15
15
  gem.add_development_dependency 'webmock'
16
16
  gem.add_development_dependency 'yard'
17
- gem.authors = ["Wynn Netherland", "Adam Stacoviak", "Erik Michaels-Ober"]
17
+ gem.authors = ["Wynn Netherland", "Erik Michaels-Ober", "Clint Shryock"]
18
18
  gem.description = %q{Simple wrapper for the GitHub v3 API}
19
- gem.email = ['wynn.netherland@gmail.com', 'adam@stacoviak.com', 'sferik@gmail.com']
19
+ gem.email = ['wynn.netherland@gmail.com', 'sferik@gmail.com', 'clint@ctshryock.com']
20
20
  gem.files = `git ls-files`.split("\n")
21
21
  gem.homepage = 'https://github.com/pengwynn/octokit'
22
22
  gem.name = 'octokit'
@@ -0,0 +1,14 @@
1
+ {
2
+ "type": "file",
3
+ "content": "cmVxdWlyZSAnb2N0b2tpdC9jb25maWd1cmF0aW9uJwpyZXF1aXJlICdvY3Rv\na2l0L2NsaWVudCcKcmVxdWlyZSAnb2N0b2tpdC9lcnJvcicKCm1vZHVsZSBP\nY3Rva2l0CiAgZXh0ZW5kIENvbmZpZ3VyYXRpb24KICBjbGFzcyA8PCBzZWxm\nCiAgICAjIEFsaWFzIGZvciBPY3Rva2l0OjpDbGllbnQubmV3CiAgICAjCiAg\nICAjIEByZXR1cm4gW09jdG9raXQ6OkNsaWVudF0KICAgIGRlZiBuZXcob3B0\naW9ucz17fSkKICAgICAgT2N0b2tpdDo6Q2xpZW50Lm5ldyhvcHRpb25zKQog\nICAgZW5kCgogICAgIyBEZWxlZ2F0ZSB0byBPY3Rva2l0OjpDbGllbnQubmV3\nCiAgICBkZWYgbWV0aG9kX21pc3NpbmcobWV0aG9kLCAqYXJncywgJmJsb2Nr\nKQogICAgICByZXR1cm4gc3VwZXIgdW5sZXNzIG5ldy5yZXNwb25kX3RvPyht\nZXRob2QpCiAgICAgIG5ldy5zZW5kKG1ldGhvZCwgKmFyZ3MsICZibG9jaykK\nICAgIGVuZAoKICAgIGRlZiByZXNwb25kX3RvPyhtZXRob2QsIGluY2x1ZGVf\ncHJpdmF0ZT1mYWxzZSkKICAgICAgbmV3LnJlc3BvbmRfdG8/KG1ldGhvZCwg\naW5jbHVkZV9wcml2YXRlKSB8fCBzdXBlcihtZXRob2QsIGluY2x1ZGVfcHJp\ndmF0ZSkKICAgIGVuZAogIGVuZAplbmQK\n",
4
+ "sha": "21787fb105676aad095f575bd00f9d18ddcb5a42",
5
+ "encoding": "base64",
6
+ "size": 609,
7
+ "_links": {
8
+ "html": "https://github.com/pengwynn/octokit/blob/master/lib/octokit.rb",
9
+ "self": "https://api.github.com/repos/pengwynn/octokit/contents/lib/octokit.rb",
10
+ "git": "https://api.github.com/repos/pengwynn/octokit/git/blobs/21787fb105676aad095f575bd00f9d18ddcb5a42"
11
+ },
12
+ "name": "lib/octokit.rb",
13
+ "path": "lib/octokit.rb"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "_links": {
3
+ "html": "https://github.com/pengwynn/octokit/blob/master/README.md",
4
+ "self": "https://api.github.com/repos/pengwynn/octokit/contents/README.md",
5
+ "git": "https://api.github.com/repos/pengwynn/octokit/git/blobs/f8be7910362f4576d2eb3ba721f9c4cd6ee06569"
6
+ },
7
+ "type": "file",
8
+ "content": "IyBPY3Rva2l0IFshW0J1aWxkIFN0YXR1c10oaHR0cHM6Ly9zZWN1cmUudHJh\ndmlzLWNpLm9yZy9wZW5nd3lubi9vY3Rva2l0LnBuZz9icmFuY2g9bWFzdGVy\nKV1bdHJhdmlzXSBbIVtEZXBlbmRlbmN5IFN0YXR1c10oaHR0c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udGF0aW9uLCB5b3Ugd2lsbCBiZSBwZXJz\nb25hbGx5IHJlc3BvbnNpYmxlIGZvciBwcm92aWRpbmcgcGF0Y2hlcyBpbiBh\nCnRpbWVseSBmYXNoaW9uLiBJZiBjcml0aWNhbCBpc3N1ZXMgZm9yIGEgcGFy\ndGljdWxhciBpbXBsZW1lbnRhdGlvbiBleGlzdCBhdCB0aGUKdGltZSBvZiBh\nIG1ham9yIHJlbGVhc2UsIHN1cHBvcnQgZm9yIHRoYXQgUnVieSB2ZXJzaW9u\nIG1heSBiZSBkcm9wcGVkLgoKIyMgSW5zcGlyYXRpb24KT2N0b2tpdCB3YXMg\naW5zcGlyZWQgYnkgW09jdG9waV1bXSBhbmQgYWltcyB0byBiZSBhIGxpZ2h0\nd2VpZ2h0LApsZXNzLUFjdGl2ZVJlc291cmNleSBhbHRlcm5hdGl2ZS4KCltv\nY3RvcGldOiBodHRwczovL2dpdGh1Yi5jb20vZmNvdXJ5L29jdG9waQoKIyMg\nQ29weXJpZ2h0CkNvcHlyaWdodCAoYykgMjAxMSBXeW5uIE5ldGhlcmxhbmQs\nIEFkYW0gU3RhY292aWFrLCBFcmlrIE1pY2hhZWxzLU9iZXIuIFNlZQpbTElD\nRU5TRV1bXSBmb3IgZGV0YWlscy4KCltsaWNlbnNlXTogaHR0cHM6Ly9naXRo\ndWIuY29tL3Blbmd3eW5uL29jdG9raXQvYmxvYi9tYXN0ZXIvTElDRU5TRQo=\n",
9
+ "sha": "f8be7910362f4576d2eb3ba721f9c4cd6ee06569",
10
+ "encoding": "base64",
11
+ "size": 5354,
12
+ "name": "README.md",
13
+ "path": "README.md"
14
+ }
@@ -0,0 +1,48 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ describe Octokit::Client::Contents do
5
+
6
+ before do
7
+ @client = Octokit::Client.new(:login => 'sferik')
8
+ end
9
+
10
+ describe ".readme" do
11
+
12
+ it "should return the default readme" do
13
+ stub_get("/repos/pengwynn/octokit/readme").
14
+ to_return(:body => fixture("v3/readme.json"))
15
+ readme = @client.readme('pengwynn/octokit')
16
+ readme.encoding.should == "base64"
17
+ readme.type.should == "file"
18
+ end
19
+
20
+ end
21
+
22
+ describe ".contents" do
23
+
24
+ it "should return the contents of a file" do
25
+ stub_get("/repos/pengwynn/octokit/contents/lib/octokit.rb").
26
+ to_return(:body => fixture("v3/contents.json"))
27
+ contents = @client.contents('pengwynn/octokit', :path => "lib/octokit.rb")
28
+ contents.path.should == "lib/octokit.rb"
29
+ contents.name.should == "lib/octokit.rb"
30
+ contents.encoding.should == "base64"
31
+ contents.type.should == "file"
32
+ end
33
+
34
+ end
35
+
36
+ describe ".archive_link" do
37
+
38
+ it "should return the headers of the request" do
39
+ stub_get("/repos/pengwynn/octokit/tarball/master").
40
+ to_return(:status => 302, :body => '', :headers =>
41
+ { 'location' => "https://nodeload.github.com/repos/pengwynn/octokit/tarball/"})
42
+ archive_link = @client.archive_link('pengwynn/octokit', :ref => "master")
43
+ archive_link == "https://nodeload.github.com/pengwynn/octokit/tarball/"
44
+ end
45
+
46
+ end
47
+
48
+ end
@@ -170,6 +170,15 @@ describe Octokit::Client::Organizations do
170
170
 
171
171
  end
172
172
 
173
+ describe ".remove_organization_member" do
174
+ it "should remove a member from an organization" do
175
+ stub_delete("https://api.github.com/orgs/codeforamerica/members/glow-mdsol").
176
+ to_return(:status => 204)
177
+ result = @client.remove_organization_member("codeforamerica", "glow-mdsol")
178
+ result.should be_true
179
+ end
180
+
181
+ end
173
182
  describe ".team_repositories" do
174
183
 
175
184
  it "should return team repositories" do
@@ -315,6 +315,14 @@ describe Octokit::Client::Repositories do
315
315
  master.commit.sha.should == "88553a397f7293b3ba176dc27cd1ab6bb93d5d14"
316
316
  end
317
317
 
318
+ it "should return a single branch" do
319
+ branch = JSON.parse(fixture("v3/branches.json").read).last
320
+ stub_get("/repos/pengwynn/octokit/branches/master").
321
+ to_return(:body => branch)
322
+ branch = @client.branch("pengwynn/octokit", "master")
323
+ branch.commit.sha.should == "88553a397f7293b3ba176dc27cd1ab6bb93d5d14"
324
+ end
325
+
318
326
  end
319
327
 
320
328
  describe ".hooks" do
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Wynn Netherland
9
- - Adam Stacoviak
10
9
  - Erik Michaels-Ober
10
+ - Clint Shryock
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-06-18 00:00:00.000000000 Z
14
+ date: 2012-06-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable
18
- requirement: &70266235724000 !ruby/object:Gem::Requirement
18
+ requirement: &70323095283380 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '2.2'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70266235724000
26
+ version_requirements: *70323095283380
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
- requirement: &70266235739020 !ruby/object:Gem::Requirement
29
+ requirement: &70323095282500 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: '0.8'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70266235739020
37
+ version_requirements: *70323095282500
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: faraday_middleware
40
- requirement: &70266235738180 !ruby/object:Gem::Requirement
40
+ requirement: &70323095281440 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ~>
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0.8'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70266235738180
48
+ version_requirements: *70323095281440
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: hashie
51
- requirement: &70266235737060 !ruby/object:Gem::Requirement
51
+ requirement: &70323095280200 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ~>
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '1.2'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *70266235737060
59
+ version_requirements: *70323095280200
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: multi_json
62
- requirement: &70266235735960 !ruby/object:Gem::Requirement
62
+ requirement: &70323095278780 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '1.3'
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *70266235735960
70
+ version_requirements: *70323095278780
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: json
73
- requirement: &70266235735400 !ruby/object:Gem::Requirement
73
+ requirement: &70323095278340 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *70266235735400
81
+ version_requirements: *70323095278340
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: maruku
84
- requirement: &70266235734700 !ruby/object:Gem::Requirement
84
+ requirement: &70323095276940 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *70266235734700
92
+ version_requirements: *70323095276940
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: rake
95
- requirement: &70266235733720 !ruby/object:Gem::Requirement
95
+ requirement: &70323095272780 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: '0'
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *70266235733720
103
+ version_requirements: *70323095272780
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: rspec
106
- requirement: &70266235732800 !ruby/object:Gem::Requirement
106
+ requirement: &70323095267460 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,10 +111,10 @@ dependencies:
111
111
  version: '0'
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *70266235732800
114
+ version_requirements: *70323095267460
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: simplecov
117
- requirement: &70266235748160 !ruby/object:Gem::Requirement
117
+ requirement: &70323095265340 !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements:
120
120
  - - ! '>='
@@ -122,10 +122,10 @@ dependencies:
122
122
  version: '0'
123
123
  type: :development
124
124
  prerelease: false
125
- version_requirements: *70266235748160
125
+ version_requirements: *70323095265340
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: webmock
128
- requirement: &70266235746260 !ruby/object:Gem::Requirement
128
+ requirement: &70323095263880 !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ! '>='
@@ -133,10 +133,10 @@ dependencies:
133
133
  version: '0'
134
134
  type: :development
135
135
  prerelease: false
136
- version_requirements: *70266235746260
136
+ version_requirements: *70323095263880
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: yard
139
- requirement: &70266235745600 !ruby/object:Gem::Requirement
139
+ requirement: &70323095263180 !ruby/object:Gem::Requirement
140
140
  none: false
141
141
  requirements:
142
142
  - - ! '>='
@@ -144,12 +144,12 @@ dependencies:
144
144
  version: '0'
145
145
  type: :development
146
146
  prerelease: false
147
- version_requirements: *70266235745600
147
+ version_requirements: *70323095263180
148
148
  description: Simple wrapper for the GitHub v3 API
149
149
  email:
150
150
  - wynn.netherland@gmail.com
151
- - adam@stacoviak.com
152
151
  - sferik@gmail.com
152
+ - clint@ctshryock.com
153
153
  executables: []
154
154
  extensions: []
155
155
  extra_rdoc_files: []
@@ -170,6 +170,7 @@ files:
170
170
  - lib/octokit/client.rb
171
171
  - lib/octokit/client/authorizations.rb
172
172
  - lib/octokit/client/commits.rb
173
+ - lib/octokit/client/contents.rb
173
174
  - lib/octokit/client/downloads.rb
174
175
  - lib/octokit/client/events.rb
175
176
  - lib/octokit/client/gists.rb
@@ -209,6 +210,7 @@ files:
209
210
  - spec/fixtures/v3/commit_comments.json
210
211
  - spec/fixtures/v3/commit_create.json
211
212
  - spec/fixtures/v3/commits.json
213
+ - spec/fixtures/v3/contents.json
212
214
  - spec/fixtures/v3/contributors.json
213
215
  - spec/fixtures/v3/download.json
214
216
  - spec/fixtures/v3/download_create.json
@@ -247,6 +249,7 @@ files:
247
249
  - spec/fixtures/v3/pull_created.json
248
250
  - spec/fixtures/v3/pull_request.json
249
251
  - spec/fixtures/v3/pull_requests.json
252
+ - spec/fixtures/v3/readme.json
250
253
  - spec/fixtures/v3/ref.json
251
254
  - spec/fixtures/v3/ref_create.json
252
255
  - spec/fixtures/v3/ref_update.json
@@ -269,6 +272,7 @@ files:
269
272
  - spec/helper.rb
270
273
  - spec/octokit/client/authorizations_spec.rb
271
274
  - spec/octokit/client/commits_spec.rb
275
+ - spec/octokit/client/contents_spec.rb
272
276
  - spec/octokit/client/downloads_spec.rb
273
277
  - spec/octokit/client/events_spec.rb
274
278
  - spec/octokit/client/gists_spec.rb
@@ -330,6 +334,7 @@ test_files:
330
334
  - spec/fixtures/v3/commit_comments.json
331
335
  - spec/fixtures/v3/commit_create.json
332
336
  - spec/fixtures/v3/commits.json
337
+ - spec/fixtures/v3/contents.json
333
338
  - spec/fixtures/v3/contributors.json
334
339
  - spec/fixtures/v3/download.json
335
340
  - spec/fixtures/v3/download_create.json
@@ -368,6 +373,7 @@ test_files:
368
373
  - spec/fixtures/v3/pull_created.json
369
374
  - spec/fixtures/v3/pull_request.json
370
375
  - spec/fixtures/v3/pull_requests.json
376
+ - spec/fixtures/v3/readme.json
371
377
  - spec/fixtures/v3/ref.json
372
378
  - spec/fixtures/v3/ref_create.json
373
379
  - spec/fixtures/v3/ref_update.json
@@ -390,6 +396,7 @@ test_files:
390
396
  - spec/helper.rb
391
397
  - spec/octokit/client/authorizations_spec.rb
392
398
  - spec/octokit/client/commits_spec.rb
399
+ - spec/octokit/client/contents_spec.rb
393
400
  - spec/octokit/client/downloads_spec.rb
394
401
  - spec/octokit/client/events_spec.rb
395
402
  - spec/octokit/client/gists_spec.rb