carrierwave-flickr 0.1.1 → 0.1.2

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: 4c7d32240cc16ce4e9a3f86c00ee5bffd29bd3cc
4
- data.tar.gz: fad3d365a301af1a46ed9a20e5d26a4f1e072b73
3
+ metadata.gz: 044c49d5de32eb12a0cfb0292d0503c1234da284
4
+ data.tar.gz: 6261500914ba7c14fcced7b6469fe4a318ddaca3
5
5
  SHA512:
6
- metadata.gz: 4364574f0e9c5c8ae493b30844e8f8edc6b3bb5c9f5544e8edaa6784f6165a2f402d0906d0fa71967da869e2d28578ba8a08cfdeaabbcaf8c219ea151b13b79f
7
- data.tar.gz: e96b703440f2c04b786a50240752b634b302bd68da162d6469212c67548456464e090ce5e5f2571599af6ea4c19deee3fe7cde6d58f3e01be34672b7112d3bb1
6
+ metadata.gz: 82a54f951b4f8e48961a699b0cef948b1d0c4aa9fd1ac2a4ee069125535348ef3d910f65e4cee781a1fba42f78414b37e308be857b1bf389a89a5c457fad9376
7
+ data.tar.gz: ad4992fbe10c1766dd4d4f4c8b2c5e96010de1d68704041dc7d65931a3e8cd3b152edea0f9ffff765c82d118ed3c5e9f0152432e53d6f57920be6974b9b1b97d
data/README.md CHANGED
@@ -36,6 +36,9 @@ CarrierWave.configure do |config|
36
36
  end
37
37
  ```
38
38
 
39
+ **This library uses [flickraw](https://github.com/hanklords/flickraw) under the hood.
40
+ See its [Authentication section](https://github.com/hanklords/flickraw#authentication) to obtain secret and token**
41
+
39
42
  If you want all photos to be stored in a specific album you can specify it
40
43
 
41
44
  ```ruby
@@ -55,6 +58,14 @@ CarrierWave.configure do |config|
55
58
  end
56
59
  ```
57
60
 
61
+ To get an URL to the photo of a different format you can use
62
+
63
+ ```ruby
64
+ avatar.image.url(format: :square)
65
+ ```
66
+
67
+ The list of available formats you can find [there](https://github.com/hanklords/flickraw#flickr-url-helpers)
68
+
58
69
  ## Contributing
59
70
 
60
71
  Bug reports and pull requests are welcome on GitHub at https://github.com/hirurg103/carrierwave-flickr.
@@ -1,5 +1,5 @@
1
1
  module Carrierwave
2
2
  module Flickr
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -82,6 +82,8 @@ module CarrierWave
82
82
 
83
83
  add_to_album(photo_id) if album.present?
84
84
 
85
+ apply_license(photo_id, license_id) if license_id.present?
86
+
85
87
  file.close if file && !file.closed?
86
88
 
87
89
  @info = flickr.photos.getInfo('photo_id' => photo_id)
@@ -91,6 +93,8 @@ module CarrierWave
91
93
  flickr.photos.delete 'photo_id' => @info['id']
92
94
  end
93
95
 
96
+ private
97
+
94
98
  def add_to_album(photo_id)
95
99
  flickr.photosets.addPhoto(
96
100
  'photo_id' => photo_id,
@@ -101,7 +105,15 @@ module CarrierWave
101
105
  @uploader.flickr_credentials[:album]
102
106
  end
103
107
 
104
- private
108
+ def apply_license(photo_id, license_id)
109
+ flickr.photos.licenses.setLicense(
110
+ 'license_id' => license_id,
111
+ 'photo_id' => photo_id)
112
+ end
113
+
114
+ def license_id
115
+ @uploader.flickr_credentials[:license_id]
116
+ end
105
117
 
106
118
  def store_options
107
119
  {}.tap do |options|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-flickr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Kavalionak
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-18 00:00:00.000000000 Z
11
+ date: 2017-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  version: '0'
166
166
  requirements: []
167
167
  rubyforge_project:
168
- rubygems_version: 2.4.6
168
+ rubygems_version: 2.4.8
169
169
  signing_key:
170
170
  specification_version: 4
171
171
  summary: Save your image attachments in http://flickr.com/ using Carrierwave