carrierwave-unoconv 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +75 -0
- data/Rakefile +2 -0
- data/carrierwave-unoconv.gemspec +19 -0
- data/lib/carrierwave-unoconv.rb +2 -0
- data/lib/carrierwave-unoconv/unoconv.rb +23 -0
- data/lib/carrierwave-unoconv/version.rb +5 -0
- metadata +68 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e7a3d7c74381eb244ca69d4de4b7c868b5cbd272
|
4
|
+
data.tar.gz: 74672947e48a1cac5b99b3fa80b1f4ec1d75e53a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1f530fdb5ea75d11d13f4e755fbbddae39bdadff73d48fc648167d3686fc5efc51b6f006fbe6f2717b25c5ecaebc5b28f7d9ff88774484caa062268403606a32
|
7
|
+
data.tar.gz: 5b4607551f77fdace8eac465a46822099886e5915ea7443b4a5122789566e6e50aed8ad488f2863fdc5e951b51b64d4087ef0fd91b4fcfc898a4b4e4c66922ea
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Mike MacDonald
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# CarrierWave::UNOConv
|
2
|
+
|
3
|
+
Additional processing to use LibrOffice via [UNOConv](https://github.com/dagwieers/unoconv) into [CarrierWave](https://github.com/jnicklas/carrierwave).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install unoconv, and make sure it's in the `PATH` of your app's user
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'carrierwave-unoconv'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install carrierwave-unoconv
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
To use those, you should include specified module (UNOConv) into your uploader and use processors:
|
24
|
+
```ruby
|
25
|
+
class AvatarUploader < CarrierWave::Uploader::Base
|
26
|
+
include CarrierWave::UNOConv
|
27
|
+
.....
|
28
|
+
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
You also should start an `unoconv` listener when your app starts, otherwise there may be issues with concurrency.
|
33
|
+
|
34
|
+
## Method implemented
|
35
|
+
|
36
|
+
uno_convert
|
37
|
+
|
38
|
+
|
39
|
+
## Example
|
40
|
+
```ruby
|
41
|
+
class Uploader < CarrierWave::Uploader::Base
|
42
|
+
include CarrierWave::UNOConv
|
43
|
+
|
44
|
+
process uno_convert: 'pdf'
|
45
|
+
|
46
|
+
end
|
47
|
+
```
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
1. Fork it
|
51
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
52
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
53
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
54
|
+
5. Create new Pull Request
|
55
|
+
|
56
|
+
|
57
|
+
## Author
|
58
|
+
|
59
|
+
crazymykl, you can follow me on twitter [@Crazy_MYKL](http://twitter.com/Crazy_MYKL) or take a look at my [blog](http://crazymykl.herokuapp.com)
|
60
|
+
|
61
|
+
## Copyright
|
62
|
+
|
63
|
+
Copyright (C) 2012 Mike MacDonald - [@Crazy_MYKL](http://twitter.com/Crazy_MYKL)
|
64
|
+
|
65
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
66
|
+
associated documentation files (the “Software”), to deal in the Software without restriction, including without
|
67
|
+
limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
68
|
+
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
69
|
+
|
70
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
71
|
+
|
72
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
73
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM,
|
74
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
75
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/carrierwave-unoconv/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Mike MacDonald"]
|
6
|
+
gem.email = ["crazymykl@gmail.com"]
|
7
|
+
gem.description = "CarrierWave Additional processing to support LibreOffice via unoconv"
|
8
|
+
gem.summary = "unoconv carrierwave processor"
|
9
|
+
gem.homepage = "http://github.com/crazymykl/carrierwave-unoconv"
|
10
|
+
|
11
|
+
gem.extra_rdoc_files = ["README.md"]
|
12
|
+
|
13
|
+
gem.add_dependency 'carrierwave'
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($\)
|
16
|
+
gem.name = "carrierwave-unoconv"
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
gem.version = CarrierWave::UNOConv::VERSION
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module CarrierWave
|
2
|
+
module UNOConv
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
module ClassMethods
|
5
|
+
def uno_convert format
|
6
|
+
process uno_convert: format
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def uno_convert format
|
11
|
+
directory = File.dirname( current_path )
|
12
|
+
tmpfile = File.join( directory, "tmpfile" )
|
13
|
+
|
14
|
+
File.rename( current_path, tmpfile )
|
15
|
+
|
16
|
+
raise CarrierWave::ProcessingError, "UNOconv failed." unless system "unoconv -f #{format} '#{tmpfile}'"
|
17
|
+
|
18
|
+
File.rename( File.join(directory, "tmpfile.#{format}"), current_path )
|
19
|
+
|
20
|
+
File.delete( tmpfile )
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: carrierwave-unoconv
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mike MacDonald
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: carrierwave
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: CarrierWave Additional processing to support LibreOffice via unoconv
|
28
|
+
email:
|
29
|
+
- crazymykl@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files:
|
33
|
+
- README.md
|
34
|
+
files:
|
35
|
+
- .gitignore
|
36
|
+
- Gemfile
|
37
|
+
- LICENSE
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- carrierwave-unoconv.gemspec
|
41
|
+
- lib/carrierwave-unoconv.rb
|
42
|
+
- lib/carrierwave-unoconv/unoconv.rb
|
43
|
+
- lib/carrierwave-unoconv/version.rb
|
44
|
+
homepage: http://github.com/crazymykl/carrierwave-unoconv
|
45
|
+
licenses: []
|
46
|
+
metadata: {}
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 2.0.0
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: unoconv carrierwave processor
|
67
|
+
test_files: []
|
68
|
+
has_rdoc:
|