thinreports-handler 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Thinreports::Handler
1
+ # ThinreportsHandler
2
2
  ThinReporsHandler is constructed by Rails Template Handler [ThinReports](http://www.thinreports.org/ "ThinReposts") the PDF.
3
3
 
4
4
  ## Supported versions
@@ -23,12 +23,12 @@ Or install it yourself as:
23
23
 
24
24
  ## Usage
25
25
 
26
- ### PDF is display in the browser.
26
+ ### Example to, Display in the browser.
27
27
 
28
28
  #### Controllers
29
29
  ``` ruby
30
30
  class OrdersController < ApplicationController
31
- def def index
31
+ def index
32
32
  @orders = Order.all
33
33
  end
34
34
  end
@@ -39,7 +39,7 @@ end
39
39
  app/views/orders/index.pdf.thinreports
40
40
 
41
41
  ``` ruby
42
- report.set_layout
42
+ report.set_layout # ! <= Required. default use: orders/index.tlf
43
43
  report.start_new_page
44
44
  report.page.values printed_at: Time.now
45
45
  @orders.each do |order|
@@ -50,11 +50,11 @@ report.page.values printed_at: Time.now
50
50
  end
51
51
  ```
52
52
 
53
- ### Download
53
+ ### Example to, Download PDF.
54
54
 
55
55
  ``` ruby
56
56
  class OrdersController < ApplicationController
57
- def def index
57
+ def index
58
58
  @orders = Order.all
59
59
  respond_to do |format|
60
60
  format.pdf {
@@ -67,13 +67,15 @@ end
67
67
 
68
68
  ### Configuration
69
69
 
70
- ### layout file
70
+ ### Layout file(.tlf) and options.
71
71
 
72
- To app/views/reports/index.tlf for example.
73
- Write code like this to index.pdf.thinreports.
72
+ Example of using the `app/views/reports/index.tlf`.
73
+ Write code like this to `index.pdf.thinreports`.
74
+
75
+ `:layout_options` is an option `ThinReports::Report::Base#use_layout` method.
74
76
 
75
77
  ``` ruby
76
- report.set_layout 'reports/index'
78
+ report.set_layout tlf: 'reports/index', layout_options: { default: true }
77
79
  ```
78
80
 
79
81
  ### generate options.
@@ -91,17 +93,17 @@ report.generate_options(security: {
91
93
 
92
94
  ### Partial
93
95
 
94
- For exsample to use, app/views/orders/_header.pdf.thinreports.
95
- title is local variable in _header.pdf.thinreports.
96
+ For exsample to use, `app/views/orders/_header.pdf.thinreports`.
97
+ `title` is local variable in `_header.pdf.thinreports`.
96
98
 
97
99
  ``` ruby
98
- report.partial 'header', title: title
100
+ report.partial! 'header', title: title
99
101
  ```
100
102
 
101
103
  ## Authour
102
104
 
103
- TwitterID: @takeshinoda
104
- Blog: http://d.hatena.ne.jp/takeshinoda/
105
+ * TwitterID: @takeshinoda
106
+ * Blog: http://d.hatena.ne.jp/takeshinoda/
105
107
 
106
108
  ## Contributing
107
109
 
@@ -25,7 +25,7 @@ module ThinreportsHandler
25
25
  end
26
26
 
27
27
  def search_tlf_path(virtual_path)
28
- virtual_path ? virtual_path + '.tlf': "#{@_template_virtual_path}.tlf"
28
+ "#{virtual_path || @_template_virtual_path}.tlf"
29
29
  end
30
30
 
31
31
  def generate_options(options)
@@ -1,5 +1,3 @@
1
- module Thinreports
2
- module Handler
3
- VERSION = "0.1.0"
4
- end
1
+ module ThinreportsHandler
2
+ VERSION = "0.1.1"
5
3
  end
@@ -13,6 +13,6 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = "thinreports-handler"
15
15
  gem.require_paths = ["lib"]
16
- gem.version = Thinreports::Handler::VERSION
16
+ gem.version = ThinreportsHandler::VERSION
17
17
  gem.add_dependency "thinreports", '~>0.7.0'
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinreports-handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-27 00:00:00.000000000 Z
12
+ date: 2012-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thinreports