lawrencepit-remarkable_paperclip 0.5.8 → 0.6.2
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.
- data/lib/{have_attached_file_matcher.rb → matchers/have_attached_file_matcher.rb} +0 -0
- data/lib/{validate_attachment_content_type_matcher.rb → matchers/validate_attachment_content_type_matcher.rb} +0 -0
- data/lib/{validate_attachment_presence_matcher.rb → matchers/validate_attachment_presence_matcher.rb} +0 -0
- data/lib/{validate_attachment_size_matcher.rb → matchers/validate_attachment_size_matcher.rb} +0 -0
- data/lib/paperclip/extension.rb +28 -0
- data/lib/remarkable_paperclip.rb +6 -5
- metadata +6 -5
File without changes
|
File without changes
|
File without changes
|
data/lib/{validate_attachment_size_matcher.rb → matchers/validate_attachment_size_matcher.rb}
RENAMED
File without changes
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'paperclip' unless defined?(Paperclip)
|
2
|
+
|
3
|
+
# Always test using filesystem storage for speedy tests.
|
4
|
+
module Remarkable
|
5
|
+
module Paperclip
|
6
|
+
module Extensions
|
7
|
+
private
|
8
|
+
|
9
|
+
def self.included(base)
|
10
|
+
base.class_eval do
|
11
|
+
alias_method :initialize_without_remarkable, :initialize
|
12
|
+
alias_method :initialize, :initialize_with_remarkable
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize_with_remarkable(name, instance, options = {})
|
17
|
+
options[:storage] = :filesystem
|
18
|
+
initialize_without_remarkable(name, instance, options)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
if defined?(Paperclip::PaperclipAttachment)
|
25
|
+
Paperclip::PaperclipAttachment.send(:include, Remarkable::Paperclip::Extensions)
|
26
|
+
else
|
27
|
+
Paperclip::Attachment.send(:include, Remarkable::Paperclip::Extensions)
|
28
|
+
end
|
data/lib/remarkable_paperclip.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
1
|
+
require 'paperclip/extension'
|
2
|
+
require 'matchers/have_attached_file_matcher'
|
3
|
+
require 'matchers/validate_attachment_size_matcher'
|
4
|
+
require 'matchers/validate_attachment_presence_matcher'
|
5
|
+
require 'matchers/validate_attachment_content_type_matcher'
|
5
6
|
|
6
7
|
if defined?(Spec::Rails)
|
7
8
|
Remarkable.include_matchers!(Remarkable::Paperclip, Spec::Rails::Example::ModelExampleGroup)
|
@@ -9,4 +10,4 @@ else
|
|
9
10
|
Remarkable.include_matchers!(Remarkable::Paperclip, Spec::Example::ExampleGroup)
|
10
11
|
end
|
11
12
|
|
12
|
-
Remarkable.add_locale(File.dirname(__FILE__) + '/../locale/en.yml')
|
13
|
+
Remarkable.add_locale(File.dirname(__FILE__) + '/../locale/en.yml')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lawrencepit-remarkable_paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lawrence Pit
|
@@ -25,11 +25,12 @@ files:
|
|
25
25
|
- README.markdown
|
26
26
|
- MIT-LICENSE
|
27
27
|
- locale/en.yml
|
28
|
+
- lib/paperclip/extension.rb
|
28
29
|
- lib/remarkable_paperclip.rb
|
29
|
-
- lib/have_attached_file_matcher.rb
|
30
|
-
- lib/validate_attachment_presence_matcher.rb
|
31
|
-
- lib/validate_attachment_size_matcher.rb
|
32
|
-
- lib/validate_attachment_content_type_matcher.rb
|
30
|
+
- lib/matchers/have_attached_file_matcher.rb
|
31
|
+
- lib/matchers/validate_attachment_presence_matcher.rb
|
32
|
+
- lib/matchers/validate_attachment_size_matcher.rb
|
33
|
+
- lib/matchers/validate_attachment_content_type_matcher.rb
|
33
34
|
has_rdoc: false
|
34
35
|
homepage: http://github.com/lawrencepit/remarkable_paperclip
|
35
36
|
post_install_message:
|