croudia 1.2.0 → 1.3.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjE5M2E5YTZmNGU1ZjE4ZTliMWMyNmMwZjRkZjU4ZjExMDM1OTA1YQ==
4
+ ZWQ5NmY1NTk4MWFkOWQ0OTE3OWNjODM3NTBkYzI1NzcxZDdkYzNmNQ==
5
5
  data.tar.gz: !binary |-
6
- NWMyNDM5YzgyM2Q0NjNjNzM0MWEyMmExNmZjMTFmYmU0YzgwODc2ZA==
6
+ OGY0Y2I1NTRjYzFiYzU0ZWFjZjg0NDdkM2Y2NWIxZTZiMjQ2ZjA3Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDVmZDBhMzIxOGMxMGNmODQzZDg3MjhmNzYyZWMwNTE3MmEyYjFmYjE5M2Nm
10
- Y2VhYWJiYjA3ZDhhM2FmYjA0ZDk4M2IyYTEzOWRmMzZmYmE5NmNmYmI2NTNk
11
- ZWNkNTE4NWU4NTBiZWJjOTQ3ODhjMjdmNjFhY2I1YzkwNmFiZDc=
9
+ YTllMDhhYTEyMzQ2Mjg3OTYzZGZmOTgxNDAzZGM4YWI0Mzk0MTQ0MDc5ZmNj
10
+ MjA1ODM2M2M5NmVmMDU1YmJjZDBlNzU5ZDZmYjgyOTM0MTY1YTMwOWYzNGYx
11
+ M2YxYmZhODcyYjNkYTk5M2MyOWRhNzA4NTU3Yzc0MmVhMzVmOGM=
12
12
  data.tar.gz: !binary |-
13
- NzRhZjVkNjdmNGRkNGIzMGFlZTc4NjU3YWNmMjNjNGI1NzQ3ODM2ZTVjNDZi
14
- NTVkNjUyODc1NjJjM2QxZjcxOWNlYzEwZGRhYTliNDJlMWIzNzMzOTIxNGY3
15
- ZjMyNTVjN2NkMzMxNTFiZjk3NjhiNzg4OTg2ZTFjZTYxNDk3OGI=
13
+ Njk1NDI1ZDZkODY0MmRkNjBkMzllZGZlZTlkMmExYmRlN2ZjMjZmM2JiODQ0
14
+ N2MwZDRjM2U3YWU1Nzg2YjUwNTc3NzQ4MTRhOTcyMDJmOThlMzM0OWI5M2Vk
15
+ ZmRjMmE3YmFjZTM3M2FiYWIyNDg5M2FjYzZmNzRmOWVkODliYzQ=
@@ -30,6 +30,22 @@ module Croudia
30
30
  Croudia::User.new(resp)
31
31
  end
32
32
 
33
+ # Update cover image
34
+ #
35
+ # @see https://developer.croudia.com/docs/39_account_update_cover_image
36
+ # @overload update_cover_image(image, params={})
37
+ # @param [File] image New cover image
38
+ # @param [Hash] params Addtional query parameters
39
+ # @overload update_cover_image(params={})
40
+ # @param [Hash] params Query parameters
41
+ # @option params [File] :image New cover image
42
+ # @return [Croudia::User] Current user's object updated
43
+ def update_cover_image(image, params={})
44
+ merge_file!(params, image, :image)
45
+ resp = post('/account/update_cover_image.json', params)
46
+ Croudia::User.new(resp)
47
+ end
48
+
33
49
  # Update profile
34
50
  #
35
51
  # @see https://developer.croudia.com/docs/37_account_update_profile
@@ -35,6 +35,7 @@ module Croudia
35
35
  # @overload update_with_media(status, media, params={})
36
36
  # @param [String] status Status text
37
37
  # @param [File, #to_io] media Image to upload with
38
+ # @param [Hash] params Additional query parameters
38
39
  # @option params [String, Integer] :in_reply_to_status_id
39
40
  # @option params [String] :in_reply_with_quote Set true if quote
40
41
  # @option params [String] :include_entities Set false to exclude entities
@@ -44,7 +45,7 @@ module Croudia
44
45
  # @option params [String, Integer] :in_reply_to_status_id
45
46
  # @option params [String] :in_reply_with_quote Set true if quote
46
47
  # @option params [String] :include_entities Set false to exclude entities
47
- # @option params [File, #to_io] media Image to upload with
48
+ # @option params [File, #to_io] :media Image to upload with
48
49
  # @option params [String] :status Status text
49
50
  # @option params [String] :trim_user Set true to return compact user objects
50
51
  # @return [Croudia::Status]
data/lib/croudia/user.rb CHANGED
@@ -8,6 +8,7 @@ module Croudia
8
8
  attr_reader(
9
9
  :blocking,
10
10
  :connections,
11
+ :cover_image_url_https,
11
12
  :description,
12
13
  :favorites_count,
13
14
  :follow_request_sent,
@@ -1,3 +1,3 @@
1
1
  module Croudia
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -42,6 +42,25 @@ describe Croudia::API::Account do
42
42
  end
43
43
  end
44
44
 
45
+ describe '#update_cover_image' do
46
+ before do
47
+ stub_post('/account/update_cover_image.json').to_return(
48
+ body: fixture(:user),
49
+ headers: { content_type: 'application/json; charset=utf-8' }
50
+ )
51
+ end
52
+
53
+ it 'requests the correct resource' do
54
+ @client.update_cover_image(fixture('image.jpg'))
55
+ expect(a_post('/account/update_cover_image.json')).to have_been_made
56
+ end
57
+
58
+ it 'returns a Croudia::User' do
59
+ subject = @client.update_cover_image(fixture('image.jpg'))
60
+ expect(subject).to be_a Croudia::User
61
+ end
62
+ end
63
+
45
64
  describe '#update_profile' do
46
65
  before do
47
66
  stub_post('/account/update_profile.json').to_return(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: croudia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - wktk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2014-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday