awesome_print-carrierwave 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awesome_print-carrierwave.rb +3 -1
- data/lib/awesome_print/carrierwave.rb +19 -13
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09d8b49cd2a4ff2c7702451695c3130590b70c04
|
4
|
+
data.tar.gz: 056dd6ccb62160ee59c7d0cc24ba8b1d76ee9781
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17c01c232cd0d79cd3ce3208ccd97d23391c9df02bd1e5a61fd3bc0700d38ceed57ba4e7c4ab3ac3071322b8f5ae3a24ecd4e2b4c45ae15dfe0e9d8ccd8b9a6f
|
7
|
+
data.tar.gz: f8817f4425a84ba65d11f8b7c61dc9eee72b6e6d881189cae1d753ae4aaa0e8216cc94373f0d0dc8a8a6d00bb3c1f0afc4217fc9a27e576dbed5d48104ef0b05
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module AwesomePrint
|
2
|
-
module
|
2
|
+
module CarrierWave
|
3
3
|
def self.included(base)
|
4
4
|
base.send :alias_method, :cast_without_carrierwave, :cast
|
5
5
|
base.send :alias_method, :cast, :cast_with_carrierwave
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
|
+
# Add CarrierWave class names to the dispatcher pipeline.
|
8
9
|
def cast_with_carrierwave(object, type)
|
9
10
|
if defined?(::CarrierWave) && object.is_a?(::CarrierWave::Uploader::Base)
|
10
11
|
:carrierwave_uploader_instance
|
@@ -12,21 +13,26 @@ module AwesomePrint
|
|
12
13
|
cast_without_carrierwave(object, type)
|
13
14
|
end
|
14
15
|
end
|
15
|
-
|
16
|
+
|
16
17
|
private
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
|
19
|
+
# Format CarrierWave::Uploader instance object.
|
20
|
+
#
|
21
|
+
# NOTE: by default only uploader class name, storage and serialiazed
|
22
|
+
# versions are shown. To format CarrierWave::Instance instance as
|
23
|
+
# regular object showing its instance variables and accessors use
|
24
|
+
# <tt>raw: true</tt> option:
|
25
|
+
#
|
26
|
+
# ap record.uploader, raw: true
|
27
|
+
def awesome_carrierwave_uploader_instance(uploader)
|
28
|
+
if @options[:raw]
|
29
|
+
awesome_object(uploader)
|
25
30
|
else
|
26
|
-
|
31
|
+
"#{uploader.class.name} with #{uploader.class.storage_engines.key(uploader._storage.name)} " \
|
32
|
+
<< awesome_hash(uploader.serializable_hash)
|
27
33
|
end
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
31
37
|
|
32
|
-
AwesomePrint::Formatter.include(AwesomePrint::
|
38
|
+
AwesomePrint::Formatter.include(AwesomePrint::CarrierWave)
|
metadata
CHANGED
@@ -1,37 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesome_print-carrierwave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tõnis Simo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.3'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.3'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
14
|
+
name: awesome_print
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
19
|
version: '0'
|
34
|
-
type: :
|
20
|
+
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
@@ -67,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
53
|
version: '0'
|
68
54
|
requirements: []
|
69
55
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.4.
|
56
|
+
rubygems_version: 2.4.6
|
71
57
|
signing_key:
|
72
58
|
specification_version: 4
|
73
59
|
summary: AwesomePrint formatter for CarrierWave::Uploader instance objects
|