shrine-flickr 1.0.1 → 1.1.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: cc2d7fbc4c13c40d1387e6e41649f1a7f9be6902
4
- data.tar.gz: 68441b4122dc2a1a12374bc776997a09de50073e
3
+ metadata.gz: 2a9b6f05a35d4800a0487a80a75442d07ff13ca1
4
+ data.tar.gz: 067eb45830f966d722c48b53008d8bc6b0152854
5
5
  SHA512:
6
- metadata.gz: 68e29fdc553bf82ebf3e010652d334e6e970bbfde15809e16beef3bcd72cb0faf9766dbba5cd0ebc230e622de2ac8d8013b396e4a6734379d1c3f91eda0100ef
7
- data.tar.gz: 22da03e3228090cafe401210223e64d514649b06c9f81f42b7b26077a56a2d8601903f2051098992496a0faa03e1c1b767de10e634c4e11ca6975a3c98843a88
6
+ metadata.gz: d4f4925219258f513686fc6ddbdbf956e835cd12245fe63fd52fff101855a53f547de779a4ed78d19a4a2530ed7cf91e9614f1ea9aff4c1bfe5c7652e0df756b
7
+ data.tar.gz: 0f2dbd8b9564526d7918f734fa7ce65c6506c5bbeabd18995038b7a10fc7c265d44b5cea766f66825e16ff45172273cec633952e6d6c904f196a206bfc5a4671
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
- # Shrine::Flickr
1
+ # Shrine::Storage::Flickr
2
2
 
3
- Provides [Flickr] storage for [Shrine].
3
+ Provides [Flickr] storage for [Shrine]. Flickr is a photo sharing service which
4
+ automatically generates different sizes of uploaded photos.
4
5
 
5
6
  ## Installation
6
7
 
@@ -77,12 +78,23 @@ class MyUploader < Shrine
77
78
  end
78
79
  ```
79
80
 
81
+ ### Updating
82
+
83
+ If you want to update the title and description of the photo, you can use the
84
+ `#update` method:
85
+
86
+ ```rb
87
+ flickr = Shrine::Storage::Flickr.new(**flickr_options)
88
+ # ...
89
+ flickr.update(id, title: "Title", description: "Description")
90
+ ```
91
+
80
92
  ### Clearing storage
81
93
 
82
94
  If you want to delete all photos from this storage, you can call `#clear!`:
83
95
 
84
96
  ```rb
85
- flickr = Shrine::Storage::Flickr.new(access_token: ["...", "..."])
97
+ flickr = Shrine::Storage::Flickr.new(**flickr_options)
86
98
  # ...
87
99
  flickr.clear!(:confirm)
88
100
  ```
@@ -16,10 +16,10 @@ class Shrine
16
16
  @album = @flickr.sets.find(album) if album
17
17
  end
18
18
 
19
- def upload(io, id, metadata = {})
20
- options = {title: metadata["filename"]}
19
+ def upload(io, id, shrine_metadata: {}, **upload_options)
20
+ options = {title: shrine_metadata["filename"]}
21
+ options.update(@upload_options)
21
22
  options.update(upload_options)
22
- options.update(metadata.delete("flickr") || {})
23
23
 
24
24
  photo_id = flickr.upload(io, options)
25
25
  album.add_photo(photo_id) if album
@@ -34,6 +34,10 @@ class Shrine
34
34
  Down.download(url(id, size: "Original"))
35
35
  end
36
36
 
37
+ def update(id, options = {})
38
+ photo(photo_id(id)).set_meta(options)
39
+ end
40
+
37
41
  def open(id)
38
42
  download(id)
39
43
  end
@@ -62,8 +66,7 @@ class Shrine
62
66
  end
63
67
  end
64
68
 
65
- def clear!(confirm = nil)
66
- raise Shrine::Confirm unless confirm == :confirm
69
+ def clear!
67
70
  if album
68
71
  album.photos.each(&:delete)
69
72
  else
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "shrine-flickr"
3
- gem.version = "1.0.1"
3
+ gem.version = "1.1.0"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.files = Dir["README.md", "LICENSE.txt", "lib/**/*.rb", "shrine-flickr.gemspec"]
14
14
  gem.require_path = "lib"
15
15
 
16
- gem.add_dependency "shrine", "~> 1.1"
16
+ gem.add_dependency "shrine", "~> 2.0"
17
17
  gem.add_dependency "flickr-objects", ">= 0.6.1"
18
18
  gem.add_dependency "down", ">= 1.0.5"
19
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shrine-flickr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-27 00:00:00.000000000 Z
11
+ date: 2016-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shrine
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.1'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.1'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: flickr-objects
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.4.5
128
+ rubygems_version: 2.5.1
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Provides Flickr storage for Shrine.