octokit 3.3.1 → 3.4.0

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: e93f44b8f48aa69b44b90370ff09aaad974503bf
4
- data.tar.gz: a57e4ac826765d57536728784d62f72c0a8ed42b
3
+ metadata.gz: 9e11a0f4596908496aeb01ad219b5e261a84e126
4
+ data.tar.gz: f6277dab715a9e588cae19a07f5399ee42e64579
5
5
  SHA512:
6
- metadata.gz: 9387f542df7e3bb64f3309128812807a9bee867e477c0d37408a0d8627fa430345d932afb0dd8041c27cbe0ddd57c5e0d15f724b2f8afdf2f491f5ce020e04bb
7
- data.tar.gz: 8924124444df41bc5e5637fd6c9dbf641b63507386bc2670611550f688005a9b4321c4bf3c0c87520dc8337ddb27cd2dce19339e8051fc77efa20ffb5b5c7a68
6
+ metadata.gz: cae73a6fb070fe1f311a90fc55427904f37fb68a86d580a9f7edd4bc5c7bd1e5d1872d2b23043b53b4a2498d7a522169e7dbcff6b1c04586f07b120ee8385f0a
7
+ data.tar.gz: 450cdd6b34aaf2cc491cd4fadf197f85860b04bb36b1bf00ad70a1e60d21b91aee4e8ebe86bfe62200b44ab795b5e6239aa27e92d7e138fb8951d7fdc68c9625
data/README.md CHANGED
@@ -5,8 +5,8 @@ Ruby toolkit for the GitHub API.
5
5
  ![Logo][logo]
6
6
  [logo]: http://cl.ly/image/3Y013H0A2z3z/gundam-ruby.png
7
7
 
8
- Octokit 2.0 is out, check the [Upgrade Guide](#upgrading-guide) before
9
- upgrading from 1.x.
8
+ Upgrading? Check the [Upgrade Guide](#upgrading-guide) before bumping to a new
9
+ [major version][semver].
10
10
 
11
11
  ## Philosophy
12
12
 
@@ -360,6 +360,27 @@ construction currently used throughout the client.
360
360
 
361
361
  ## Upgrading guide
362
362
 
363
+ Version 3.0 includes a couple breaking changes when upgrading from v2.x.x:
364
+
365
+ The [default media type][default-media-type] is now `v3` instead of `beta`. If
366
+ you need to request the older media type, you can set the default media type
367
+ for the client:
368
+
369
+ ```ruby
370
+ Octokit.default_media_type = "application/vnd.github.beta+json"
371
+ ```
372
+ or per-request
373
+
374
+ ```ruby
375
+ Octokit.emails(:accept => "application/vnd.github.beta+json")
376
+ ```
377
+
378
+ The long-deprecated `Octokit::Client#create_download` method has been removed.
379
+
380
+ [default-media-type]: https://developer.github.com/changes/2014-01-07-upcoming-change-to-default-media-type/
381
+
382
+ ### Upgrading from 1.x.x
383
+
363
384
  Version 2.0 includes a completely rewritten `Client` factory that now memoizes
364
385
  client instances based on unique configuration options. Breaking changes also
365
386
  include:
@@ -531,6 +531,39 @@ module Octokit
531
531
  boolean_from_response :delete, "teams/#{team_id}/memberships/#{user}", options
532
532
  end
533
533
 
534
+ # List all organizations memberships for the authenticated user
535
+ #
536
+ # @return [Array<Sawyer::Resource>] Array of organizations memberships.
537
+ # @see https://developer.github.com/v3/orgs/members/#list-your-organization-memberships
538
+ def organization_memberships(options = {})
539
+ options = ensure_org_invitations_api_media_type(options)
540
+ paginate "user/memberships/orgs", options
541
+ end
542
+ alias :org_memberships :organization_memberships
543
+
544
+ # Get an organization membership for the authenticated user
545
+ #
546
+ # @param org [String] Organization GitHub login.
547
+ # @return [Sawyer::Resource] Hash representing the organization membership.
548
+ # @see https://developer.github.com/v3/orgs/members/#get-your-organization-membership
549
+ def organization_membership(org, options = {})
550
+ options = ensure_org_invitations_api_media_type(options)
551
+ get "user/memberships/orgs/#{org}", options
552
+ end
553
+ alias :org_membership :organization_membership
554
+
555
+ # Edit an organization membership for the authenticated user
556
+ #
557
+ # @param org [String] Organization GitHub login.
558
+ # @option options [String] :state The state that the membership should be in.
559
+ # @return [Sawyer::Resource] Hash representing the updated organization membership.
560
+ # @see https://developer.github.com/v3/orgs/members/#edit-your-organization-membership
561
+ def update_organization_membership(org, options = {})
562
+ options = ensure_org_invitations_api_media_type(options)
563
+ patch "user/memberships/orgs/#{org}", options
564
+ end
565
+ alias :update_org_membership :update_organization_membership
566
+
534
567
  private
535
568
 
536
569
  def ensure_org_invitations_api_media_type(options = {})
@@ -5,7 +5,6 @@ module Octokit
5
5
  #
6
6
  # @see https://developer.github.com/v3/repos/statuses/
7
7
  module Statuses
8
- COMBINED_STATUS_MEDIA_TYPE = "application/vnd.github.she-hulk-preview+json"
9
8
 
10
9
  # List all statuses for a given commit
11
10
  #
@@ -25,7 +24,6 @@ module Octokit
25
24
  # @return [Sawyer::Resource] The combined status for the commit
26
25
  # @see https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
27
26
  def combined_status(repo, ref, options = {})
28
- ensure_combined_status_api_media_type(options)
29
27
  get "#{Repository.path repo}/commits/#{ref}/status", options
30
28
  end
31
29
  alias :status :combined_status
@@ -44,24 +42,6 @@ module Octokit
44
42
  options.merge!(:state => state)
45
43
  post "#{Repository.path repo}/statuses/#{sha}", options
46
44
  end
47
-
48
- private
49
-
50
- def ensure_combined_status_api_media_type(options = {})
51
- unless options[:accept]
52
- options[:accept] = COMBINED_STATUS_MEDIA_TYPE
53
- warn_combined_status_preview
54
- end
55
- options
56
- end
57
-
58
- def warn_combined_status_preview
59
- octokit_warn <<-EOS
60
- WARNING: The preview version of the combined status API is not yet suitable
61
- for production use. You can avoid this message by supplying an appropriate
62
- media type in the 'Accept' header. See the blog post for details http://git.io/wtsdaA
63
- EOS
64
- end
65
45
  end
66
46
  end
67
47
  end
@@ -2,6 +2,6 @@ module Octokit
2
2
 
3
3
  # Current version
4
4
  # @return [String]
5
- VERSION = "3.3.1".freeze
5
+ VERSION = "3.4.0".freeze
6
6
 
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokit
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wynn Netherland
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-08-18 00:00:00.000000000 Z
13
+ date: 2014-09-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler