yt 0.10.4 → 0.10.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83e093f9574237e7acfe751a152ebe9f2b700cd5
4
- data.tar.gz: f136bf0de7f233e096444e5a7b3c51e5efa37d14
3
+ metadata.gz: b514aef834131736bd47325d004cd67c38f3fcaa
4
+ data.tar.gz: 1939130b4afa95148532b4f04aa97d0e09c87ef4
5
5
  SHA512:
6
- metadata.gz: 409c0e3eb775a2a4d06b99a5f76edefb006d7430d8cfa0722cf4774e0a44db2a912c82b44a3f6f7b2a0c58a3df85a713fd725b8b6f41a767cc2390c24c9d47d4
7
- data.tar.gz: 4b7ed9f82d43e2f4bcd536c9e1d3bdc0e67a7bfb5e3eadab8b0ecd4bb144c2812c0e6c829482dfad0b48cba298debb4041ad96c6c199f830c6cb2e3ff77b4189
6
+ metadata.gz: 6ec9dbfb86d648c0b76ccc70f62bc203a76bc38ac5496c8aaaf032b00e7620e61c50d710463e9997ca3a0b13c2d414bfb05f40ae51547e86ea5929c8257c3850
7
+ data.tar.gz: 88f5254c83f8c689568d8dca5b6acb21711b68cc9812b7e9631e45f8a58709694ecc3c392146de63d743e0fcc9b906fc705a76be8f25fdff50e7a2357169ba86
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ For more information about changelogs, check
6
6
  [Keep a Changelog](http://keepachangelog.com) and
7
7
  [Vandamme](http://tech-angels.github.io/vandamme).
8
8
 
9
+ ## 0.10.5 - 2014-08-17
10
+
11
+ * [ENHANCEMENT] Use PATCH rather than PUT to partially update a MatchPolicy
12
+
9
13
  ## 0.10.4 - 2014-08-15
10
14
 
11
15
  * [BUGFIX] List tags of videos retrieved with channel.videos and account.videos
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yt (0.10.4)
4
+ yt (0.10.5)
5
5
  activesupport
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -41,7 +41,7 @@ To install on your system, run
41
41
 
42
42
  To use inside a bundled Ruby project, add this line to the Gemfile:
43
43
 
44
- gem 'yt', '~> 0.10.4'
44
+ gem 'yt', '~> 0.10.5'
45
45
 
46
46
  Since the gem follows [Semantic Versioning](http://semver.org),
47
47
  indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
@@ -0,0 +1,19 @@
1
+ require 'yt/actions/modify'
2
+
3
+ module Yt
4
+ module Actions
5
+ module Patch
6
+ include Modify
7
+
8
+ private
9
+
10
+ def do_patch(extra_patch_params = {}, &block)
11
+ do_modify patch_params.deep_merge(extra_patch_params), &block
12
+ end
13
+
14
+ def patch_params
15
+ modify_params.tap{|params| params[:method] = :patch}
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,5 +1,6 @@
1
1
  require 'yt/actions/delete'
2
2
  require 'yt/actions/update'
3
+ require 'yt/actions/patch'
3
4
 
4
5
  require 'yt/associations/has_authentication'
5
6
  require 'yt/associations/has_many'
@@ -14,6 +15,7 @@ module Yt
14
15
  class Base
15
16
  include Actions::Delete
16
17
  include Actions::Update
18
+ include Actions::Patch
17
19
 
18
20
  extend Associations::HasReports
19
21
  extend Associations::HasViewerPercentages
@@ -11,19 +11,18 @@ module Yt
11
11
  @auth = options[:auth]
12
12
  end
13
13
 
14
- # @note Only policyId can be currently updated, not rules.
15
14
  def update(attributes = {})
16
15
  underscore_keys! attributes
17
- do_update body: {policyId: attributes[:policy_id]}
16
+ do_patch body: {policyId: attributes[:policy_id]}
18
17
  true
19
18
  end
20
19
 
21
20
  private
22
21
 
23
- # @return [Hash] the parameters to submit to YouTube to update an asset
22
+ # @return [Hash] the parameters to submit to YouTube to patch an asset
24
23
  # match policy.
25
- # @see https://developers.google.com/youtube/partner/docs/v1/assetMatchPolicy/update
26
- def update_params
24
+ # @see https://developers.google.com/youtube/partner/docs/v1/assetMatchPolicy/patch
25
+ def patch_params
27
26
  super.tap do |params|
28
27
  params[:path] = "/youtube/partner/v1/assets/#{@asset_id}/matchPolicy"
29
28
  params[:params] = {onBehalfOfContentOwner: @auth.owner_name}
data/lib/yt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.10.4'
2
+ VERSION = '0.10.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.4
4
+ version: 0.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-15 00:00:00.000000000 Z
11
+ date: 2014-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -122,6 +122,7 @@ files:
122
122
  - lib/yt/actions/insert.rb
123
123
  - lib/yt/actions/list.rb
124
124
  - lib/yt/actions/modify.rb
125
+ - lib/yt/actions/patch.rb
125
126
  - lib/yt/actions/update.rb
126
127
  - lib/yt/associations/has_authentication.rb
127
128
  - lib/yt/associations/has_many.rb