File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,5 +56,8 @@ development_dependencies:
5656 ameba :
5757 github : crystal-ameba/ameba
5858 version : ~> 1.6.4
59+ awscr-s3 :
60+ github : taylorfinnell/awscr-s3
61+ version : ~> 0.10.0
5962
6063license : MIT
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ describe Lucky::Attachment::Uploader do
9494 context " error handling" do
9595 it " raises Error when no storages are not configured" do
9696 Lucky ::Attachment .configure do |settings |
97- settings.storages = {} of String => Lucky ::Attachment ::Storage :: Base
97+ settings.storages = {} of String => Lucky ::Attachment ::Storage
9898 end
9999
100100 expect_raises(
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ module Lucky::Attachment
1010 # NOTE: Additional stores are not supported yet. Please reach out if that
1111 # is something you need.
1212 #
13- setting storages : Hash (String , Storage :: Base ) = {} of String => Storage :: Base
13+ setting storages : Hash (String , Storage ) = {} of String => Storage
1414
1515 # Path prefix for uploads. Possible keywords are:
1616 # - `:model` (an underscored string of the model name)
@@ -27,7 +27,7 @@ module Lucky::Attachment
2727 # Lucky::Attachment.find_storage("missing") # raises Lucky::Attachment::Error
2828 # ```
2929 #
30- def self.find_storage (name : String ) : Storage :: Base
30+ def self.find_storage (name : String ) : Storage
3131 settings.storages[name]? ||
3232 raise Error .new(
3333 String .build do |io |
Original file line number Diff line number Diff line change 22# Implementations must provide methods for uploading, retreiving, checking
33# existence, and deleting files.
44#
5- abstract class Lucky::Attachment::Storage::Base
5+ abstract class Lucky::Attachment::Storage
66 # Uploads an IO to the given location (id) in the storage.
77 #
88 # ```
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ require "../storage"
1515# end
1616# ```
1717#
18- class Lucky::Attachment::Storage::FileSystem < Lucky::Attachment::Storage::Base
18+ class Lucky::Attachment::Storage::FileSystem < Lucky::Attachment::Storage
1919 DEFAULT_PERMISSIONS = File ::Permissions .new(0o644 )
2020 DEFAULT_DIRECTORY_PERMISSIONS = File ::Permissions .new(0o755 )
2121
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ require "../storage"
1111# end
1212# ```
1313#
14- class Lucky::Attachment::Storage::Memory < Lucky::Attachment::Storage::Base
14+ class Lucky::Attachment::Storage::Memory < Lucky::Attachment::Storage
1515 getter store : Hash (String , Bytes )
1616 getter base_url : String ?
1717
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ class Lucky::Attachment::StoredFile
110110 end
111111
112112 # Returns the storage instance this file is stored in.
113- def storage : Storage :: Base
113+ def storage : Storage
114114 ::Lucky ::Attachment .find_storage(storage_key)
115115 end
116116
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ abstract struct Lucky::Attachment::Uploader
2222 end
2323
2424 # Returns the storage instance for this uploader.
25- def storage : Storage :: Base
25+ def storage : Storage
2626 Lucky ::Attachment .find_storage(storage_key)
2727 end
2828
You can’t perform that action at this time.
0 commit comments