prawn_cocktail 0.2.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -47,7 +47,7 @@ class InvoiceDocument < PrawnCocktail::Document
47
47
  end
48
48
 
49
49
  def filename
50
- "invoice_#{@invoice.id}"
50
+ "invoice_#{@invoice.id}.pdf"
51
51
  end
52
52
 
53
53
  private
@@ -3,13 +3,11 @@ module PrawnCocktail
3
3
  private
4
4
 
5
5
  def send_pdf(document)
6
- filename = document.respond_to?(:filename) ? "#{document.filename}.pdf" : nil
7
-
8
6
  send_data(
9
7
  document.render,
10
8
  type: "application/pdf",
11
9
  disposition: "attachment",
12
- filename: filename
10
+ filename: document.filename
13
11
  )
14
12
  end
15
13
  end
@@ -13,6 +13,10 @@ module PrawnCocktail
13
13
  renderer.render_file(file)
14
14
  end
15
15
 
16
+ def filename
17
+ # Override in your subclass.
18
+ end
19
+
16
20
  private
17
21
 
18
22
  def renderer
@@ -1,3 +1,3 @@
1
1
  module PrawnCocktail
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn_cocktail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
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: 2013-02-19 00:00:00.000000000 Z
12
+ date: 2013-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: prawn
16
- requirement: &70299039222780 !ruby/object:Gem::Requirement
16
+ requirement: &70270245325880 !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: :runtime
23
23
  prerelease: false
24
- version_requirements: *70299039222780
24
+ version_requirements: *70270245325880
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rails
27
- requirement: &70299039222180 !ruby/object:Gem::Requirement
27
+ requirement: &70270245325220 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70299039222180
35
+ version_requirements: *70270245325220
36
36
  description:
37
37
  email:
38
38
  - henrik@barsoom.se