docscape 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in docscape.gemspec
4
+ gemspec
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 Giuseppe Privitera & Rosario Pizzo
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.textile ADDED
@@ -0,0 +1,8 @@
1
+ h1. docscape
2
+
3
+ convert inkscape (SVG) files to pdf documents. require inkscape
4
+
5
+ the gem is still under development
6
+
7
+
8
+ h2. Copyright 2011 Giuseppe Privitera & Rosario Pizzo
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/docscape.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "docscape/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "docscape"
7
+ s.version = Docscape::VERSION
8
+ s.authors = ["Giuseppe Privitera", "Rosario Pizzo"]
9
+ s.email = ["priviterag@gmail.com"]
10
+ s.homepage = "http://github.com/priviterag/docscape"
11
+ s.summary = %q{convert inkscape (SVG) files to pdf}
12
+ s.description = %q{convert inkscape (SVG) files to pdf documents}
13
+
14
+ s.rubyforge_project = "docscape"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ # s.add_runtime_dependency "rest-client"
24
+ end
@@ -0,0 +1,3 @@
1
+ module Docscape
2
+ VERSION = "0.0.1"
3
+ end
data/lib/docscape.rb ADDED
@@ -0,0 +1,19 @@
1
+ require "docscape/version"
2
+ require "action_controller"
3
+ require "tempfile"
4
+ Mime::Type.register "application/pdf", :docscape
5
+
6
+ ActionController::Renderers.add :docscape do |filename, options|
7
+ #logger.debug "*************#{filename} #{options}*************"
8
+ #*************contents {:prefixes=>["subscriptions", "inherited_resources/base", "application"], :template=>"show", :stream=>nil}*************
9
+ text = render_to_string(options)
10
+ f = Tempfile.new(["#{filename}",".svg"], "#{Rails.root}/tmp")
11
+ f.write text
12
+ f.close
13
+ system "inkscape -f #{f.path} -A #{f.path}.pdf"
14
+ send_file("#{f.path}.pdf", :filename => "#{filename}.pdf", :type => "application/pdf", :disposition => 'inline')
15
+ end
16
+
17
+
18
+
19
+
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: docscape
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Giuseppe Privitera
9
+ - Rosario Pizzo
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2011-12-22 00:00:00.000000000Z
14
+ dependencies: []
15
+ description: convert inkscape (SVG) files to pdf documents
16
+ email:
17
+ - priviterag@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - .gitignore
23
+ - Gemfile
24
+ - MIT-LICENSE
25
+ - README.textile
26
+ - Rakefile
27
+ - docscape.gemspec
28
+ - lib/docscape.rb
29
+ - lib/docscape/version.rb
30
+ homepage: http://github.com/priviterag/docscape
31
+ licenses: []
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubyforge_project: docscape
50
+ rubygems_version: 1.8.10
51
+ signing_key:
52
+ specification_version: 3
53
+ summary: convert inkscape (SVG) files to pdf
54
+ test_files: []