tilt-pdf-rails 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f1e9cddeaf6577e1fb0ef6c891ab1f9bf2dffc22
4
+ data.tar.gz: ab3a65d6d215f76aacb47df7e74c1e3058c8dfff
5
+ SHA512:
6
+ metadata.gz: ef456e71e9c042fde4f2330089da28d7c5e3d6e4132d8756d958745a1b539c8f0dfe8f3cdd8370a71cb78749c3564644531dae0d7b4d6d70e1369eb7aafd2577
7
+ data.tar.gz: 88d99e903f7bbd1b04dd0fe87bb3321aee7b6a4dd09372eedaa356782a73924077e115a4ec3efb0907b2d0ef16fb716c936a8518b6725c958c35bd135d5d62c1
@@ -0,0 +1 @@
1
+ /test/*.pdf
@@ -0,0 +1,15 @@
1
+ AsciiComments:
2
+ Enabled: false
3
+ MethodLength:
4
+ Max: 30
5
+ ParameterLists:
6
+ CountKeywordArgs: false
7
+ Documentation:
8
+ Enabled: false
9
+ TrivialAccessors:
10
+ ExactNameMatch: true
11
+ AllowPredicates: true
12
+ AndOr:
13
+ Enabled: false
14
+ PerlBackrefs:
15
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,83 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ tilt-pdf (0.1.2)
5
+ pdfkit (~> 0.5.4)
6
+ tilt (~> 1.4.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ celluloid (0.15.2)
12
+ timers (~> 1.1.0)
13
+ coderay (1.0.9)
14
+ coffee-script (2.2.0)
15
+ coffee-script-source
16
+ execjs
17
+ coffee-script-source (1.7.0)
18
+ commonjs (0.2.7)
19
+ diff-lcs (1.2.4)
20
+ execjs (2.0.2)
21
+ ffi (1.9.0)
22
+ formatador (0.2.4)
23
+ guard (2.1.1)
24
+ formatador (>= 0.2.4)
25
+ listen (~> 2.1)
26
+ lumberjack (~> 1.0)
27
+ pry (>= 0.9.12)
28
+ thor (>= 0.18.1)
29
+ guard-rspec (4.0.3)
30
+ guard (>= 2.1.1)
31
+ rspec (~> 2.14)
32
+ less (2.4.0)
33
+ commonjs (~> 0.2.7)
34
+ libv8 (3.16.14.3)
35
+ listen (2.1.1)
36
+ celluloid (>= 0.15.2)
37
+ rb-fsevent (>= 0.9.3)
38
+ rb-inotify (>= 0.9)
39
+ lumberjack (1.0.4)
40
+ method_source (0.8.2)
41
+ pdfkit (0.5.4)
42
+ pry (0.9.12.2)
43
+ coderay (~> 1.0.5)
44
+ method_source (~> 0.8)
45
+ slop (~> 3.4)
46
+ rake (10.1.0)
47
+ rb-fsevent (0.9.3)
48
+ rb-inotify (0.9.2)
49
+ ffi (>= 0.5.0)
50
+ ref (1.0.5)
51
+ rspec (2.14.1)
52
+ rspec-core (~> 2.14.0)
53
+ rspec-expectations (~> 2.14.0)
54
+ rspec-mocks (~> 2.14.0)
55
+ rspec-core (2.14.6)
56
+ rspec-expectations (2.14.3)
57
+ diff-lcs (>= 1.1.3, < 2.0)
58
+ rspec-mocks (2.14.4)
59
+ slim (2.0.1)
60
+ temple (~> 0.6.6)
61
+ tilt (>= 1.3.3, < 2.1)
62
+ slop (3.4.6)
63
+ temple (0.6.7)
64
+ therubyracer (0.12.0)
65
+ libv8 (~> 3.16.14.0)
66
+ ref
67
+ thor (0.18.1)
68
+ tilt (1.4.1)
69
+ timers (1.1.0)
70
+
71
+ PLATFORMS
72
+ ruby
73
+
74
+ DEPENDENCIES
75
+ coffee-script
76
+ guard-rspec
77
+ less
78
+ pry
79
+ rake
80
+ rspec (~> 2.14)
81
+ slim
82
+ therubyracer
83
+ tilt-pdf!
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Loic Nageleisen
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.
@@ -0,0 +1,19 @@
1
+ # Tilt::PDF::Rails
2
+
3
+ Integrates Tilt::PDF into Rails ActionView
4
+
5
+ See [Tilt::PDF](https://github.com/lloeki/tilt-pdf) for details
6
+
7
+ ## Usage
8
+
9
+ ```ruby
10
+ gem 'tilt-pdf-rails', require: 'tilt/pdf/rails'
11
+ ```
12
+
13
+ Have a `FooController` `respond_to :pdf` and `render some_view` as usual.
14
+
15
+ Put your `some_view` template files either *together* in the relevant
16
+ `app/views/foo` view directory, or use absolute paths using application/engine
17
+ root.
18
+
19
+ Work is in progress to enable better integration with Rails file layout (notably assets).
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.push File.expand_path(File.join(__FILE__, '../..'))
4
+
5
+ require 'tilt-pdf'
6
+ require 'slim'
7
+
8
+ rpdf = ARGV.shift or fail('usage: rpdf filename')
9
+ pdf = Tilt.new(rpdf).render
10
+ File.open(File.basename(rpdf, '.rpdf') + '.pdf', 'wb') do |f|
11
+ f.write(pdf)
12
+ end
@@ -0,0 +1 @@
1
+ require 'tilt/pdf/rails'
@@ -0,0 +1,24 @@
1
+ require 'tilt-pdf'
2
+
3
+ module ActionView
4
+ class Template
5
+ module Handlers
6
+ class PDFTemplate
7
+ class_attribute :default_format
8
+ self.default_format = :pdf
9
+
10
+ def call(template)
11
+ "Tilt.new('#{template.identifier}').render(self)"
12
+ end
13
+ end
14
+ end
15
+
16
+ register_template_handler :rpdf, Handlers::PDFTemplate.new
17
+ end
18
+ end
19
+
20
+ module Tilt::PDFTemplate::Rails
21
+ class Railtie < ::Rails::Railtie
22
+ config.app_generators.template_engine :rpdf
23
+ end
24
+ end
@@ -0,0 +1,7 @@
1
+ module Tilt
2
+ module PDF
3
+ module Rails
4
+ VERSION = '0.10.0'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
+ require 'tilt/pdf/rails/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'tilt-pdf-rails'
7
+ s.version = Tilt::PDF::Rails::VERSION
8
+ s.authors = ['Loic Nageleisen']
9
+ s.email = ['loic.nageleisen@gmail.com']
10
+ s.homepage = 'http://github.com/lloeki/tilt-pdf-rails'
11
+ s.summary = %q{PDF files in Rails via Tilt}
12
+ s.description = %q{Integrates PDF generation with Tilt::PDF into ActionView}
13
+ s.license = 'MIT'
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n")
17
+ .map { |f| File.basename(f) }
18
+ s.require_paths = ['lib']
19
+
20
+ s.add_dependency 'tilt-pdf', '~> 0.10.0'
21
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tilt-pdf-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.10.0
5
+ platform: ruby
6
+ authors:
7
+ - Loic Nageleisen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: tilt-pdf
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.10.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.10.0
27
+ description: Integrates PDF generation with Tilt::PDF into ActionView
28
+ email:
29
+ - loic.nageleisen@gmail.com
30
+ executables:
31
+ - rpdf
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - .gitignore
36
+ - .rubocop.yml
37
+ - Gemfile
38
+ - Gemfile.lock
39
+ - LICENSE
40
+ - README.mdown
41
+ - bin/rpdf
42
+ - lib/tilt-pdf-rails.rb
43
+ - lib/tilt/pdf/rails.rb
44
+ - lib/tilt/pdf/rails/version.rb
45
+ - tilt-pdf-rails.gemspec
46
+ homepage: http://github.com/lloeki/tilt-pdf-rails
47
+ licenses:
48
+ - MIT
49
+ metadata: {}
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements: []
65
+ rubyforge_project:
66
+ rubygems_version: 2.0.14
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: PDF files in Rails via Tilt
70
+ test_files: []
71
+ has_rdoc: