docverter-server 1.0.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.buildpacks +2 -0
  2. data/.gitignore +6 -0
  3. data/.vendor_urls +3 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +55 -0
  6. data/LICENSE +67 -0
  7. data/Procfile +1 -0
  8. data/README.md +32 -0
  9. data/Rakefile +23 -0
  10. data/config.ru +3 -0
  11. data/doc/api.md +1664 -0
  12. data/doc/examples/html_to_encrypted_pdf/convert.sh +16 -0
  13. data/doc/examples/html_to_encrypted_pdf/imfeldoublepica.ttf +0 -0
  14. data/doc/examples/html_to_encrypted_pdf/input.html +27 -0
  15. data/doc/examples/html_to_encrypted_pdf/marcellus.ttf +0 -0
  16. data/doc/examples/html_to_encrypted_pdf/stylesheet.css +22 -0
  17. data/doc/examples/html_to_pdf/convert.sh +16 -0
  18. data/doc/examples/html_to_pdf/imfeldoublepica.ttf +0 -0
  19. data/doc/examples/html_to_pdf/input.html +27 -0
  20. data/doc/examples/html_to_pdf/marcellus.ttf +0 -0
  21. data/doc/examples/html_to_pdf/stylesheet.css +22 -0
  22. data/doc/examples/markdown_to_epub/chapter1.md +11 -0
  23. data/doc/examples/markdown_to_epub/chapter2.md +10 -0
  24. data/doc/examples/markdown_to_epub/convert.sh +20 -0
  25. data/doc/examples/markdown_to_epub/document-open.png +0 -0
  26. data/doc/examples/markdown_to_epub/markdown_to_epub.epub +241 -0
  27. data/doc/examples/markdown_to_epub/markdown_to_epub.epub.html +251 -0
  28. data/doc/examples/markdown_to_epub/metadata.xml +2 -0
  29. data/doc/examples/markdown_to_epub/stylesheet.css +216 -0
  30. data/doc/examples/markdown_to_epub/title.txt +2 -0
  31. data/doc/examples/markdown_to_mobi/chapter1.md +11 -0
  32. data/doc/examples/markdown_to_mobi/chapter2.md +10 -0
  33. data/doc/examples/markdown_to_mobi/convert.sh +20 -0
  34. data/doc/examples/markdown_to_mobi/document-open.png +0 -0
  35. data/doc/examples/markdown_to_mobi/metadata.xml +2 -0
  36. data/doc/examples/markdown_to_mobi/stylesheet.css +216 -0
  37. data/doc/examples/markdown_to_mobi/title.txt +2 -0
  38. data/doc/examples/markdown_to_pdf/chapter1.md +11 -0
  39. data/doc/examples/markdown_to_pdf/chapter2.md +10 -0
  40. data/doc/examples/markdown_to_pdf/convert.sh +18 -0
  41. data/doc/examples/markdown_to_pdf/imfeldoublepica.ttf +0 -0
  42. data/doc/examples/markdown_to_pdf/manifest.yml +8 -0
  43. data/doc/examples/markdown_to_pdf/marcellus.ttf +0 -0
  44. data/doc/examples/markdown_to_pdf/stylesheet.css +22 -0
  45. data/docverter.gemspec +28 -0
  46. data/lib/docverter-server/app.rb +50 -0
  47. data/lib/docverter-server/conversion.rb +38 -0
  48. data/lib/docverter-server/conversion_types.rb +59 -0
  49. data/lib/docverter-server/jars/bcprov-ext-jdk15-1.43.jar +0 -0
  50. data/lib/docverter-server/jars/htmlcleaner-2.2.jar +0 -0
  51. data/lib/docverter-server/manifest.rb +107 -0
  52. data/lib/docverter-server/runner/base.rb +36 -0
  53. data/lib/docverter-server/runner/calibre.rb +10 -0
  54. data/lib/docverter-server/runner/pandoc.rb +18 -0
  55. data/lib/docverter-server/runner/pdf.rb +91 -0
  56. data/lib/docverter-server/version.rb +3 -0
  57. data/lib/docverter-server.rb +11 -0
  58. metadata +230 -0
data/.buildpacks ADDED
@@ -0,0 +1,2 @@
1
+ https://github.com/peterkeen/heroku-buildpack-vendorbinaries.git
2
+ https://github.com/jruby/heroku-buildpack-jruby.git
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ .rbenv-version
2
+ .DS_Store
3
+ pkg
4
+ doc/examples/*/*.pdf
5
+ doc/examples/*/*.mobi
6
+ doc/examples/*/*.epub
data/.vendor_urls ADDED
@@ -0,0 +1,3 @@
1
+ https://s3.amazonaws.com/docverter-binaries/calibre.tar.gz
2
+ https://s3.amazonaws.com/docverter-binaries/pandoc.tar.gz
3
+ https://s3.amazonaws.com/docverter-binaries/pandoc-templates.tar.gz
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,55 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ docverter-server (1.0.0-java)
5
+ flying_saucer
6
+ mime-types
7
+ mizuno
8
+ rake
9
+ sinatra
10
+
11
+ GEM
12
+ remote: http://rubygems.org/
13
+ specs:
14
+ activesupport (3.2.9)
15
+ i18n (~> 0.6)
16
+ multi_json (~> 1.0)
17
+ childprocess (0.3.6)
18
+ ffi (~> 1.0, >= 1.0.6)
19
+ choice (0.1.6)
20
+ ffi (1.2.0-java)
21
+ flying_saucer (0.8.0-java)
22
+ i18n (0.6.1)
23
+ metaclass (0.0.1)
24
+ mime-types (1.19)
25
+ mizuno (0.6.4)
26
+ childprocess (>= 0.2.6)
27
+ choice (>= 0.1.0)
28
+ ffi (>= 1.0.0)
29
+ rack (>= 1.0.0)
30
+ mocha (0.13.0)
31
+ metaclass (~> 0.0.1)
32
+ multi_json (1.3.7)
33
+ rack (1.4.1)
34
+ rack-protection (1.2.0)
35
+ rack
36
+ rake (10.0.2)
37
+ shoulda (3.3.2)
38
+ shoulda-context (~> 1.0.1)
39
+ shoulda-matchers (~> 1.4.1)
40
+ shoulda-context (1.0.1)
41
+ shoulda-matchers (1.4.1)
42
+ activesupport (>= 3.0.0)
43
+ sinatra (1.3.3)
44
+ rack (~> 1.3, >= 1.3.6)
45
+ rack-protection (~> 1.2)
46
+ tilt (~> 1.3, >= 1.3.3)
47
+ tilt (1.3.3)
48
+
49
+ PLATFORMS
50
+ java
51
+
52
+ DEPENDENCIES
53
+ docverter-server!
54
+ mocha
55
+ shoulda
data/LICENSE ADDED
@@ -0,0 +1,67 @@
1
+ Docverter
2
+ =========
3
+
4
+ Copyright (c) 2012 Pete Keen (pete@bugsplat.info)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11
+
12
+
13
+ Bouncy Castle (bcprov-ext-jdk15-1.43.jar)
14
+ =========================================
15
+
16
+ Copyright (c) 2000-2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
17
+
18
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software
19
+ and associated documentation files (the "Software"), to deal in the Software without restriction,
20
+ including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
21
+ and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
22
+ subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in all copies or substantial
25
+ portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
28
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
29
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
31
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
32
+ DEALINGS IN THE SOFTWARE.
33
+
34
+ HTML Cleaner (htmlcleaner-2.2.jar)
35
+ ==================================
36
+
37
+ Copyright (c) 2006-2012, HtmlCleaner team.
38
+ All rights reserved.
39
+
40
+ Redistribution and use of this software in source and binary forms,
41
+ with or without modification, are permitted provided that the
42
+ following conditions are met:
43
+
44
+ * Redistributions of source code must retain the above
45
+ copyright notice, this list of conditions and the
46
+ following disclaimer.
47
+
48
+ * Redistributions in binary form must reproduce the above
49
+ copyright notice, this list of conditions and the
50
+ following disclaimer in the documentation and/or other
51
+ materials provided with the distribution.
52
+
53
+ * The name of HtmlCleaner may not be used to endorse or promote
54
+ products derived from this software without specific prior
55
+ written permission.
56
+
57
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
58
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
59
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
60
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
61
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
62
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
63
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
64
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
65
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
66
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
67
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/Procfile ADDED
@@ -0,0 +1 @@
1
+ web: mizuno -I lib -p $PORT
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Docverter Server
2
+
3
+ Docverter is a document conversion server with an HTTP interface. It wrap the following open source software in a JRuby app:
4
+
5
+ * [Pandoc](http://johnmacfarlane.net/pandoc/) for plain text to HTML and ePub conversion
6
+ * [Flying Saucer](http://code.google.com/p/flying-saucer/) for HTML to PDF
7
+ * [Calibre](http://calibre-ebook.com/) for ePub to MOBI conversion
8
+
9
+ ## Installation
10
+
11
+ Installing on Heroku is the easiest option. Simply clone the repo, create an app, and push:
12
+
13
+ $ git clone https://github.com/Docverter/docverter.git
14
+ $ cd docverter
15
+ $ heroku create --buildpack https://github.com/ddollar/heroku-buildpack-multi.git
16
+ $ heroku config:add PATH=bin:/app/bin:/app/jruby/bin:/usr/bin:/bin
17
+ $ git push heroku master
18
+
19
+ If you'd like to install locally, first ensure that Jruby, Pandoc and Calibre are installed and available. Then (for Ubuntu):
20
+
21
+ $ jruby -S gem install foreman
22
+ $ git clone https://github.com/docverter/docverter.git
23
+ $ cd docverter
24
+ $ sudo foreman export upstart /etc/init -u <some app user> -a docverter -l /var/log/docverter
25
+ $ sudo service docverter start
26
+
27
+ Other distributions will be similar. See the documentation for [Foreman](http://ddollar.github.com/foreman/) for
28
+ more export options.
29
+
30
+ ## Usage
31
+
32
+ See `doc/api.md` and [Docverter Ruby](https://github.com/docverter/docverter-ruby) for usage documentation.
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task :server do
4
+ sh "jruby -S rackup -Ilib -s mizuno -p 9595"
5
+ end
6
+
7
+ task :build_examples do
8
+ sh "mkdir -p public/examples"
9
+ Dir.chdir('examples') do
10
+ Dir.glob('*') do |example_name|
11
+ next unless File.directory?(example_name)
12
+ puts example_name
13
+
14
+ Dir.chdir(example_name) do
15
+ sh "zip ../../public/examples/#{example_name}.zip *"
16
+ output = `./convert.sh #{args[:api_key]}`.strip
17
+ sh "mv #{output} ../../public/examples"
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+
data/config.ru ADDED
@@ -0,0 +1,3 @@
1
+ require 'docverter-server'
2
+
3
+ run DocverterServer::App.new