scribd-carrierwave 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.md +43 -0
- data/lib/scribd-carrierwave/version.rb +2 -4
- data/lib/scribd-carrierwave.rb +1 -1
- data/scribd-carrierwave.gemspec +1 -1
- metadata +18 -16
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Aubrey Rhodes
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
Scribd-CarrierWave
|
2
|
+
==================
|
3
|
+
|
4
|
+
Integrates [CarrierWave](https://github.com/jnicklas/carrierwave) with [Scribd](http://scribd.com/). This plugin was heavily influenced by [Scribd_fu](https://github.com/ProtectedMethod/scribd_fu).
|
5
|
+
|
6
|
+
Install
|
7
|
+
-------
|
8
|
+
|
9
|
+
````gem install scribd-carrierwave````
|
10
|
+
|
11
|
+
With bundler:
|
12
|
+
|
13
|
+
````gem 'scribd-carrierwave'````
|
14
|
+
|
15
|
+
Configure
|
16
|
+
---------
|
17
|
+
1. Sign up for a Scribd API key [here](http://www.scribd.com/developers/signup_api)
|
18
|
+
|
19
|
+
2. The following configuration settings need to be made (e.g. in an initializer):
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
ScribdCarrierWave.config.key = {{Scribd API Key}}
|
23
|
+
ScribdCarrierWave.config.secret = {{Scribd Secret Key}}
|
24
|
+
ScribdCarrierWave.config.username = {{Scribd Username}}
|
25
|
+
ScribdCarrierWave.config.password = {{Scribd Password}}
|
26
|
+
```
|
27
|
+
3. In the CarrierWave uploader you wish you use with Scribd, add the line ````has_ipaper````
|
28
|
+
4. For each attribute the uploader is mounted as, add the following attributes to the model. For instance, if the uploader is mounted as :attachement add
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
t.integer :attachment_ipaper_id
|
32
|
+
t.string :attachment_ipaper_access_key
|
33
|
+
````
|
34
|
+
|
35
|
+
Scribd-CarrierWave will now automatically upload new attachments to Scribd as a private document, and save the id and access_key on the model.
|
36
|
+
|
37
|
+
Viewing A Document
|
38
|
+
------------------
|
39
|
+
Just add ````<%= attachment.display_ipaper %>```` into your view.
|
40
|
+
|
41
|
+
To display multiple documents on the same page, you need to pass in a unique id for each one:
|
42
|
+
|
43
|
+
````<%= attachment.display_ipaper({id: '_attachemment1'}) %>````
|
data/lib/scribd-carrierwave.rb
CHANGED
data/scribd-carrierwave.gemspec
CHANGED
@@ -4,7 +4,7 @@ require "scribd-carrierwave/version"
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "scribd-carrierwave"
|
7
|
-
s.version =
|
7
|
+
s.version = ScribdCarrierwave::VERSION
|
8
8
|
s.authors = ["Aubrey Rhodes"]
|
9
9
|
s.email = ["aubrey.c.rhodes@gmail.com"]
|
10
10
|
s.homepage = ""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scribd-carrierwave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-23 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70269923032540 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70269923032540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mocha
|
27
|
-
requirement: &
|
27
|
+
requirement: &70269923032000 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70269923032000
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: cover_me
|
38
|
-
requirement: &
|
38
|
+
requirement: &70269923031460 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70269923031460
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rscribd
|
49
|
-
requirement: &
|
49
|
+
requirement: &70269923030960 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70269923030960
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: carrierwave
|
60
|
-
requirement: &
|
60
|
+
requirement: &70269923030500 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70269923030500
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: configatron
|
71
|
-
requirement: &
|
71
|
+
requirement: &70269923030060 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70269923030060
|
80
80
|
description: Allows you to have a CarrierWave uploader automatically upload to scribd
|
81
81
|
email:
|
82
82
|
- aubrey.c.rhodes@gmail.com
|
@@ -86,6 +86,8 @@ extra_rdoc_files: []
|
|
86
86
|
files:
|
87
87
|
- .gitignore
|
88
88
|
- Gemfile
|
89
|
+
- LICENSE
|
90
|
+
- README.md
|
89
91
|
- Rakefile
|
90
92
|
- lib/scribd-carrierwave.rb
|
91
93
|
- lib/scribd-carrierwave/config.rb
|
@@ -107,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
109
|
version: '0'
|
108
110
|
segments:
|
109
111
|
- 0
|
110
|
-
hash:
|
112
|
+
hash: 2480320641395577377
|
111
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
114
|
none: false
|
113
115
|
requirements:
|
@@ -116,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
118
|
version: '0'
|
117
119
|
segments:
|
118
120
|
- 0
|
119
|
-
hash:
|
121
|
+
hash: 2480320641395577377
|
120
122
|
requirements: []
|
121
123
|
rubyforge_project: scribd-carrierwave
|
122
124
|
rubygems_version: 1.8.10
|