chute 2.1.6 → 2.2.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: 3c1511c46bb1733f578d4c2431be12ad429e02df
4
- data.tar.gz: a9509a95f7eeebf5329475a8d7389a25a14d39f5
3
+ metadata.gz: d3495db2763a7d259675a69a069fac218eff1e4d
4
+ data.tar.gz: e663fd0116d0d112bc4f9fa166c1f1e9a5e0f5b8
5
5
  SHA512:
6
- metadata.gz: 9ef66bb4335a75215cdaac033f1da0ea1bb3239a07cc254ea15186f042de1a02324ff814fd9ebc02a2d38a85f54598e47f93d66f7abe753f6ed7aba84383e382
7
- data.tar.gz: 51c7e79690077a6d7c6b7017c88be18de07b6a5c0b7439f1bc9e36b173374f1ccf7df538fbef4ef44dff18d35865a03ae4d75453574497d8de81b2bf7e87c3db
6
+ metadata.gz: b77e63b51e72ab4434d4ed052cdfbfc27b207f69630383c4e30f47352ae4656d74afe859ca79b3c25c38d7a7c557157d43ce9647277c3cda1a9574bf25075137
7
+ data.tar.gz: aa7022770b0a66bbea317da124d1f9216e5d9d18f239816f79acfc977efbf9318328fd065998be6113c99d8ef37b21cbbff6dd1128331fcf7fe27174727d7dbd
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gem 'rest-client'
6
6
  # Add dependencies to develop your gem here.
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
  group :development do
9
- gem 'rspec', '~> 2.8.0'
9
+ gem 'rspec', '~> 3.3.0'
10
10
  gem 'rdoc', '~> 3.12'
11
11
  gem 'bundler'
12
12
  gem 'jeweler'
@@ -10,7 +10,7 @@ GIT
10
10
  GEM
11
11
  remote: http://rubygems.org/
12
12
  specs:
13
- addressable (2.3.7)
13
+ addressable (2.3.8)
14
14
  builder (3.2.2)
15
15
  codeclimate-test-reporter (0.4.6)
16
16
  simplecov (>= 0.7.1, < 1.0.0)
@@ -18,7 +18,7 @@ GEM
18
18
  safe_yaml (~> 1.0.0)
19
19
  descendants_tracker (0.0.4)
20
20
  thread_safe (~> 0.3, >= 0.3.1)
21
- diff-lcs (1.1.3)
21
+ diff-lcs (1.2.5)
22
22
  docile (1.1.5)
23
23
  faraday (0.9.1)
24
24
  multipart-post (>= 1.2, < 3)
@@ -31,8 +31,8 @@ GEM
31
31
  multi_json (>= 1.7.5, < 2.0)
32
32
  nokogiri (~> 1.6.3)
33
33
  oauth2
34
- hashie (3.4.0)
35
- highline (1.7.0)
34
+ hashie (3.4.2)
35
+ highline (1.7.2)
36
36
  httparty (0.13.3)
37
37
  json (~> 1.8)
38
38
  multi_xml (>= 0.5.2)
@@ -45,11 +45,11 @@ GEM
45
45
  nokogiri (>= 1.5.10)
46
46
  rake
47
47
  rdoc
48
- json (1.8.2)
49
- jwt (1.2.1)
48
+ json (1.8.3)
49
+ jwt (1.5.1)
50
50
  mime-types (2.4.3)
51
51
  mini_portile (0.6.2)
52
- multi_json (1.10.1)
52
+ multi_json (1.11.2)
53
53
  multi_xml (0.5.5)
54
54
  multipart-post (2.0.0)
55
55
  netrc (0.10.2)
@@ -61,28 +61,33 @@ GEM
61
61
  multi_json (~> 1.3)
62
62
  multi_xml (~> 0.5)
63
63
  rack (~> 1.2)
64
- rack (1.6.0)
64
+ rack (1.6.4)
65
65
  rake (10.4.2)
66
66
  rdoc (3.12.2)
67
67
  json (~> 1.4)
68
68
  rest-client (1.7.3)
69
69
  mime-types (>= 1.16, < 3.0)
70
70
  netrc (~> 0.7)
71
- rspec (2.8.0)
72
- rspec-core (~> 2.8.0)
73
- rspec-expectations (~> 2.8.0)
74
- rspec-mocks (~> 2.8.0)
75
- rspec-core (2.8.0)
76
- rspec-expectations (2.8.0)
77
- diff-lcs (~> 1.1.2)
78
- rspec-mocks (2.8.0)
71
+ rspec (3.3.0)
72
+ rspec-core (~> 3.3.0)
73
+ rspec-expectations (~> 3.3.0)
74
+ rspec-mocks (~> 3.3.0)
75
+ rspec-core (3.3.2)
76
+ rspec-support (~> 3.3.0)
77
+ rspec-expectations (3.3.1)
78
+ diff-lcs (>= 1.2.0, < 2.0)
79
+ rspec-support (~> 3.3.0)
80
+ rspec-mocks (3.3.2)
81
+ diff-lcs (>= 1.2.0, < 2.0)
82
+ rspec-support (~> 3.3.0)
83
+ rspec-support (3.3.0)
79
84
  safe_yaml (1.0.4)
80
85
  simplecov (0.9.2)
81
86
  docile (~> 1.1.0)
82
87
  multi_json (~> 1.0)
83
88
  simplecov-html (~> 0.9.0)
84
89
  simplecov-html (0.9.0)
85
- thread_safe (0.3.4)
90
+ thread_safe (0.3.5)
86
91
  vcr (2.9.3)
87
92
  webmock (1.20.4)
88
93
  addressable (>= 2.3.6)
@@ -99,7 +104,7 @@ DEPENDENCIES
99
104
  jeweler
100
105
  rdoc (~> 3.12)
101
106
  rest-client
102
- rspec (~> 2.8.0)
107
+ rspec (~> 3.3.0)
103
108
  rspec_junit_formatter!
104
109
  simplecov
105
110
  vcr
data/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/chute.svg)](http://badge.fury.io/rb/chute)
5
5
  [![Code Climate](https://codeclimate.com/github/chute/chute-ruby/badges/gpa.svg)](https://codeclimate.com/github/chute/chute-ruby)
6
6
  [![Test Coverage](https://codeclimate.com/github/chute/chute-ruby/badges/coverage.svg)](https://codeclimate.com/github/chute/chute-ruby/code)
7
+ [![PullReview stats](https://www.pullreview.com/github/chute/chute-ruby/badges/master.svg?)](https://www.pullreview.com/github/chute/chute-ruby/reviews/master)
7
8
 
8
9
  > [Chute API](http://docs.chute.apiary.io) SDK for Ruby
9
10
 
@@ -68,6 +69,13 @@ Responses are recorded for reuse by VCR. If you need to re-run some of them remo
68
69
  Test coverage is automatically calculated. To see it, open browser at `/coverage/index.html`.
69
70
 
70
71
 
72
+ ### Release
73
+
74
+ 1. Update version in `lib/chute/version.rb`
75
+ 2. `git commit -am 'Version X.Y.Z'`
76
+ 3. `rake release`
77
+
78
+
71
79
  ## License
72
80
 
73
81
  Copyright (c) 2012-2015 Chute Corporation. Released under the terms of the MIT License.
@@ -2,20 +2,19 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: chute 2.1.6 ruby lib
5
+ # stub: chute 2.2.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "chute"
9
- s.version = "2.1.6"
9
+ s.version = "2.2.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Chute Corporation"]
14
- s.date = "2015-02-24"
14
+ s.date = "2015-12-22"
15
15
  s.description = "Ruby SDK for the Chute API http://docs.chute.apiary.io"
16
16
  s.email = "support@getchute.com"
17
17
  s.extra_rdoc_files = [
18
- "CHANGELOG.md",
19
18
  "LICENSE.md",
20
19
  "README.md"
21
20
  ]
@@ -35,6 +34,7 @@ Gem::Specification.new do |s|
35
34
  "lib/chute/response.rb",
36
35
  "lib/chute/v2/accounts.rb",
37
36
  "lib/chute/v2/albums.rb",
37
+ "lib/chute/v2/apps.rb",
38
38
  "lib/chute/v2/assets.rb",
39
39
  "lib/chute/v2/campaigns.rb",
40
40
  "lib/chute/v2/comments.rb",
@@ -52,6 +52,7 @@ Gem::Specification.new do |s|
52
52
  "spec/chute/response_spec.rb",
53
53
  "spec/chute/v2/accounts_spec.rb",
54
54
  "spec/chute/v2/albums_spec.rb",
55
+ "spec/chute/v2/apps_spec.rb",
55
56
  "spec/chute/v2/assets_spec.rb",
56
57
  "spec/chute/v2/campaigns_spec.rb",
57
58
  "spec/chute/v2/comments_spec.rb",
@@ -88,6 +89,7 @@ Gem::Specification.new do |s|
88
89
  "spec/fixtures/chute_cassettes/campaigns/campaigns_create.yml",
89
90
  "spec/fixtures/chute_cassettes/campaigns/storage.yml",
90
91
  "spec/fixtures/chute_cassettes/comments/comments_create.yml",
92
+ "spec/fixtures/chute_cassettes/comments/comments_delete.yml",
91
93
  "spec/fixtures/chute_cassettes/comments/comments_list.yml",
92
94
  "spec/fixtures/chute_cassettes/flags/flags_methods.yml",
93
95
  "spec/fixtures/chute_cassettes/hearts/hearts_methods.yml",
@@ -108,7 +110,7 @@ Gem::Specification.new do |s|
108
110
  ]
109
111
  s.homepage = "https://github.com/chute/chute-ruby"
110
112
  s.licenses = ["MIT"]
111
- s.rubygems_version = "2.4.5"
113
+ s.rubygems_version = "2.4.6"
112
114
  s.summary = "Chute API SDK"
113
115
 
114
116
  if s.respond_to? :specification_version then
@@ -118,7 +120,7 @@ Gem::Specification.new do |s|
118
120
  s.add_runtime_dependency(%q<httparty>, [">= 0"])
119
121
  s.add_runtime_dependency(%q<hashie>, [">= 0"])
120
122
  s.add_runtime_dependency(%q<rest-client>, [">= 0"])
121
- s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
123
+ s.add_development_dependency(%q<rspec>, ["~> 3.3.0"])
122
124
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
123
125
  s.add_development_dependency(%q<bundler>, [">= 0"])
124
126
  s.add_development_dependency(%q<jeweler>, [">= 0"])
@@ -127,7 +129,7 @@ Gem::Specification.new do |s|
127
129
  s.add_dependency(%q<httparty>, [">= 0"])
128
130
  s.add_dependency(%q<hashie>, [">= 0"])
129
131
  s.add_dependency(%q<rest-client>, [">= 0"])
130
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
132
+ s.add_dependency(%q<rspec>, ["~> 3.3.0"])
131
133
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
132
134
  s.add_dependency(%q<bundler>, [">= 0"])
133
135
  s.add_dependency(%q<jeweler>, [">= 0"])
@@ -137,7 +139,7 @@ Gem::Specification.new do |s|
137
139
  s.add_dependency(%q<httparty>, [">= 0"])
138
140
  s.add_dependency(%q<hashie>, [">= 0"])
139
141
  s.add_dependency(%q<rest-client>, [">= 0"])
140
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
142
+ s.add_dependency(%q<rspec>, ["~> 3.3.0"])
141
143
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
142
144
  s.add_dependency(%q<bundler>, [">= 0"])
143
145
  s.add_dependency(%q<jeweler>, [">= 0"])
@@ -22,7 +22,7 @@ module Chute
22
22
 
23
23
  def self.request(request_type, url, body="")
24
24
  body = body.to_json unless String === body
25
- options = body.empty? ? {:headers => headers} : {:headers => headers, :body => body}
25
+ options = body.empty? ? {headers: headers} : {headers: headers, body: body}
26
26
  begin
27
27
  response = self.send(request_type, "#{base_uri}#{url}", options)
28
28
  =begin
@@ -12,7 +12,7 @@ module Chute
12
12
  end
13
13
 
14
14
  def update(id, account = {})
15
- Chute::Client.put("/v2/accounts/#{id}", :account => account)
15
+ Chute::Client.put("/v2/accounts/#{id}", account: account)
16
16
  end
17
17
  end
18
18
  end
@@ -4,7 +4,7 @@ module Chute
4
4
  class << self
5
5
  # Album Listing
6
6
  def all(page=nil, per_page=nil)
7
- Chute::Client.get("/v2/albums", :page=> page, :per_page=> per_page)
7
+ Chute::Client.get("/v2/albums", page: page, per_page: per_page)
8
8
  end
9
9
 
10
10
  # Album Details
@@ -19,27 +19,27 @@ module Chute
19
19
 
20
20
  # Album Assets
21
21
  def assets(id, page, per_page)
22
- Chute::Client.get("/v2/albums/#{id}/assets", :page=> page, :per_page=> per_page)
22
+ Chute::Client.get("/v2/albums/#{id}/assets", page: page, per_page: per_page)
23
23
  end
24
24
 
25
25
  # Import Album Assets
26
26
  def import(album_id, *urls)
27
- Chute::Client.post("/v2/albums/#{album_id}/assets/import", :urls=> urls)
27
+ Chute::Client.post("/v2/albums/#{album_id}/assets/import", urls: urls)
28
28
  end
29
29
 
30
30
  # Import from Instagram Ids
31
31
  def import_from_instagram(album_id, *ids)
32
- Chute::Client.post("/v2/albums/#{album_id}/assets/import", :instagram_ids => ids)
32
+ Chute::Client.post("/v2/albums/#{album_id}/assets/import", instagram_ids: ids)
33
33
  end
34
34
 
35
35
  # Album Create
36
36
  def create(album)
37
- Chute::Client.post("/v2/albums", :album => album)
37
+ Chute::Client.post("/v2/albums", album: album)
38
38
  end
39
39
 
40
40
  # Album Update
41
41
  def update(id, album={})
42
- Chute::Client.put("/v2/albums/#{id}", :album => album)
42
+ Chute::Client.put("/v2/albums/#{id}", album: album)
43
43
  end
44
44
 
45
45
  # Album Delete
@@ -52,11 +52,11 @@ module Chute
52
52
  end
53
53
 
54
54
  def add_assets(album_id, *asset_ids)
55
- Chute::Client.post("/v2/albums/#{album_id}/add_assets", :asset_ids => asset_ids)
55
+ Chute::Client.post("/v2/albums/#{album_id}/add_assets", asset_ids: asset_ids)
56
56
  end
57
57
 
58
58
  def remove_assets(album_id, *asset_ids)
59
- Chute::Client.post("/v2/albums/#{album_id}/remove_assets",:asset_ids => asset_ids)
59
+ Chute::Client.post("/v2/albums/#{album_id}/remove_assets",asset_ids: asset_ids)
60
60
  end
61
61
 
62
62
  # Move asset from one album to another, preserving all asset's metadata
@@ -0,0 +1,15 @@
1
+ module Chute
2
+ module V2
3
+ class Apps
4
+ class << self
5
+ def all
6
+ Chute::Client.get "/v2/apps"
7
+ end
8
+
9
+ def find id
10
+ Chute::Client.get "/v2/apps/#{id}"
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -28,11 +28,11 @@ module Chute
28
28
  end
29
29
 
30
30
  def upload(album_id, f)
31
- response = RestClient::Request.execute(:url => "#{Chute.upload_endpoint}/v2/albums/#{album_id}/assets/upload", :method => :post,
32
- :payload => {
33
- :multipart => true,
34
- :filedata => f
35
- },:headers => {"Authorization" => "Bearer #{Chute.access_token}"}
31
+ response = RestClient::Request.execute(url: "#{Chute.upload_endpoint}/v2/albums/#{album_id}/assets/upload", method: :post,
32
+ payload: {
33
+ multipart: true,
34
+ filedata: f
35
+ },headers: {"Authorization" => "Bearer #{Chute.access_token}"}
36
36
  )
37
37
  Chute::Connection.parse(JSON.parse(response.body))
38
38
  end
@@ -4,7 +4,7 @@ module Chute
4
4
  class << self
5
5
  # Campaign Listing
6
6
  def all(page=nil, per_page=nil)
7
- Chute::Client.get("/v2/campaigns", :page=> page, :per_page=> per_page)
7
+ Chute::Client.get("/v2/campaigns", page: page, per_page: per_page)
8
8
  end
9
9
 
10
10
  # Campaign Details
@@ -14,7 +14,7 @@ module Chute
14
14
 
15
15
  # Campaign Create
16
16
  def create(campaign)
17
- Chute::Client.post("/v2/campaigns", :campaign => campaign)
17
+ Chute::Client.post("/v2/campaigns", campaign: campaign)
18
18
  end
19
19
 
20
20
  [:temp, :private, :public].each do |type|
@@ -11,8 +11,8 @@ module Chute
11
11
  Chute::Client.post("/v2/albums/#{album_id}/assets/#{asset_id}/hearts")
12
12
  end
13
13
 
14
- def unheart(album_id, asset_id, id)
15
- Chute::Client.delete("/v2/albums/#{album_id}/assets/#{asset_id}/hearts/#{id}")
14
+ def unheart(album_id, asset_id, identifier)
15
+ Chute::Client.delete("/v2/albums/#{album_id}/assets/#{asset_id}/hearts/#{identifier}")
16
16
  end
17
17
 
18
18
  end
@@ -10,17 +10,17 @@ module Chute
10
10
 
11
11
  # Change the complete list of tags for an asset inside an album
12
12
  def update_asset_tags(album_id, asset_id, *tags)
13
- Chute::Client.put("/v2/albums/#{album_id}/assets/#{asset_id}/tags", :tags => process_array(tags))
13
+ Chute::Client.put("/v2/albums/#{album_id}/assets/#{asset_id}/tags", tags: process_array(tags))
14
14
  end
15
15
 
16
16
  # Add new tags to existing assets, without replacing the current ones
17
17
  def add_asset_tags(album_id, asset_id, *tags)
18
- Chute::Client.post("/v2/albums/#{album_id}/assets/#{asset_id}/tags", :tags => process_array(tags))
18
+ Chute::Client.post("/v2/albums/#{album_id}/assets/#{asset_id}/tags", tags: process_array(tags))
19
19
  end
20
20
 
21
21
  # Delete all tags from an asset
22
22
  def delete_asset_tags(album_id, asset_id, *tags)
23
- Chute::Client.delete("/v2/albums/#{album_id}/assets/#{asset_id}/tags", :tags => process_array(tags))
23
+ Chute::Client.delete("/v2/albums/#{album_id}/assets/#{asset_id}/tags", tags: process_array(tags))
24
24
  end
25
25
 
26
26
  private
@@ -9,11 +9,11 @@ module Chute
9
9
  end
10
10
 
11
11
  def create(url, event)
12
- Chute::Client.post("/v2/triggers", :url => url, :event => event)
12
+ Chute::Client.post("/v2/triggers", url: url, event: event)
13
13
  end
14
14
 
15
15
  def update(trigger_id,url, event)
16
- Chute::Client.put("/v2/triggers/#{trigger_id}", :url => url, :event => event)
16
+ Chute::Client.put("/v2/triggers/#{trigger_id}", url: url, event: event)
17
17
  end
18
18
 
19
19
  def delete(trigger_id)
@@ -1,8 +1,8 @@
1
1
  module Chute
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 1
5
- PATCH = 6
4
+ MINOR = 2
5
+ PATCH = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -29,12 +29,12 @@ describe Chute::Client do
29
29
  describe 'with class configuration' do
30
30
  before do
31
31
  @config = {
32
- :api_endpoint => 'api',
33
- :auth_endpoint => 'auth',
34
- :upload_endpoint => "upload",
35
- :app_id => 'id',
36
- :app_secret => 'secret',
37
- :access_token => 'token',
32
+ api_endpoint: 'api',
33
+ auth_endpoint: 'auth',
34
+ upload_endpoint: "upload",
35
+ app_id: 'id',
36
+ app_secret: 'secret',
37
+ access_token: 'token',
38
38
  }
39
39
  end
40
40
 
@@ -24,7 +24,7 @@ describe Chute::V2::Accounts do
24
24
 
25
25
  describe "GET Accounts List" do
26
26
  before do
27
- VCR.insert_cassette 'accounts/me', :record => :new_episodes
27
+ VCR.insert_cassette 'accounts/me', record: :new_episodes
28
28
  end
29
29
 
30
30
  it "should be able to list all of a users accounts" do
@@ -35,7 +35,7 @@ describe Chute::V2::Accounts do
35
35
 
36
36
  describe "GET Account" do
37
37
  before do
38
- VCR.insert_cassette 'accounts/find', :record => :new_episodes
38
+ VCR.insert_cassette 'accounts/find', record: :new_episodes
39
39
  end
40
40
 
41
41
  it "should be able to fetch info about an account" do
@@ -51,7 +51,7 @@ describe Chute::V2::Accounts do
51
51
 
52
52
  it 'should be able to update the invalid_token flag on an account' do
53
53
  response = Chute::V2::Accounts.update(666, {invalid_token: true})
54
- response.data['invalid_token'].should be_true
54
+ response.data['invalid_token'].should be_truthy
55
55
  end
56
56
  end
57
57
  end