thinreports-rails 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,34 @@
1
+ language: ruby
2
+ script: ruby test/thinreports-rails_test.rb
3
+ rvm:
4
+ - 1.9.3
5
+ - 1.8.7
6
+ - jruby-18mode
7
+ gemfile:
8
+ - gemfiles/Gemfile-rails.3.0.x
9
+ - gemfiles/Gemfile-rails.3.1.x
10
+ - gemfiles/Gemfile-rails.3.2.x
11
+ jdk:
12
+ - oraclejdk7
13
+ - oraclejdk6
14
+ matrix:
15
+ exclude:
16
+ - rvm: 1.9.3
17
+ jdk: oraclejdk7
18
+ gemfile: gemfiles/Gemfile-rails.3.0.x
19
+ - rvm: 1.9.3
20
+ jdk: oraclejdk7
21
+ gemfile: gemfiles/Gemfile-rails.3.1.x
22
+ - rvm: 1.9.3
23
+ jdk: oraclejdk7
24
+ gemfile: gemfiles/Gemfile-rails.3.2.x
25
+ - rvm: 1.8.7
26
+ jdk: oraclejdk7
27
+ gemfile: gemfiles/Gemfile-rails.3.0.x
28
+ - rvm: 1.8.7
29
+ jdk: oraclejdk7
30
+ gemfile: gemfiles/Gemfile-rails.3.1.x
31
+ - rvm: 1.8.7
32
+ jdk: oraclejdk7
33
+ gemfile: gemfiles/Gemfile-rails.3.2.x
34
+
data/CHANGELOG ADDED
@@ -0,0 +1,10 @@
1
+
2
+ == 0.1.3
3
+ * Require: thinreports 0.7.6 later
4
+ * report.set_layout method is not required.
5
+ (See:
6
+ https://github.com/thinreports/thinreports-generator/commit/82660ff2d05c8b984e1298ab2569d266ffbf9171)
7
+
8
+ == 0.1.2
9
+ * First release.
10
+
data/README.md CHANGED
@@ -7,7 +7,7 @@ Oldname: thinreports-handler
7
7
 
8
8
  * Ruby 1.8.7, 1.9.3
9
9
  * Rails 3.0.X, 3.1.X, 3.2.X
10
- * ThinReports 0.7.X
10
+ * ThinReports 0.7.6 later
11
11
 
12
12
  ## Installation
13
13
 
@@ -41,7 +41,6 @@ end
41
41
  app/views/orders/index.pdf.thinreports
42
42
 
43
43
  ``` ruby
44
- report.set_layout # ! <= Required. default use: orders/index.tlf
45
44
  report.start_new_page
46
45
  report.page.values printed_at: Time.now
47
46
  @orders.each do |order|
@@ -102,7 +101,7 @@ For exsample to use, `app/views/orders/_header.pdf.thinreports`.
102
101
  report.partial! 'header', title: title
103
102
  ```
104
103
 
105
- ## Authour
104
+ ## Author
106
105
 
107
106
  * TwitterID: @takeshinoda
108
107
  * Blog: http://d.hatena.ne.jp/takeshinoda/
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gem 'rails', '~> 3.0.0'
3
+ gem 'thinreports-rails', :path => '..'
4
+
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gem 'rails', '~> 3.1.0'
3
+ gem 'thinreports-rails', :path => '..'
4
+
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gem 'rails', '~> 3.2.0'
3
+ gem 'thinreports-rails', :path => '..'
4
+
@@ -42,7 +42,7 @@ module ThinreportsRails
42
42
  return self.use_layout(full_path, *([_options[:layout_options]].compact))
43
43
  end
44
44
  end
45
- raise("#{tlf_path} not found.")
45
+ raise("#{tlf_path} not found.") unless _options[:allow_no_layout]
46
46
  end
47
47
  end
48
48
 
@@ -58,6 +58,7 @@ module ThinreportsRails
58
58
  generate_options = nil
59
59
  ThinReports::Report.create do |__report__|
60
60
  report = ThinreportsRails::ThinreportsTemplate.new(__report__, self, '#{template.virtual_path}')
61
+ report.set_layout :allow_no_layout => true
61
62
 
62
63
  #{template.source}
63
64
 
@@ -1,4 +1,4 @@
1
1
  module ThinreportsRails
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
4
4
 
@@ -0,0 +1,7 @@
1
+ report.partial! 'header'
2
+ @orders.each do |order|
3
+ report.page.list(:list).add_row do |row|
4
+ row.item(:col1).value order.name
5
+ row.item(:col2).value order.num
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ {"version":"0.7.0","finger-print":1367137149,"config":{"title":"Japanese Paper","option":{},"page":{"paper-type":"A4","orientation":"portrait","margin-top":"20","margin-bottom":"20","margin-left":"20","margin-right":"20"}},"svg":"<svg width=\"595.2\" height=\"841.8\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"none\" viewBox=\"0 0 595.2 841.8\"><g class=\"canvas\"><!--SHAPE{\"type\":\"s-tblock\",\"id\":\"printed_at\",\"display\":\"true\",\"desc\":null,\"multiple\":\"false\",\"valign\":\"\",\"line-height\":\"\",\"box\":{\"x\":339.1,\"y\":100,\"width\":236.1,\"height\":18},\"format\":{\"base\":\"\",\"type\":\"datetime\",\"datetime\":{\"format\":\"%Y/%m/%d %H:%M:%S\"}},\"value\":\"\",\"ref-id\":\"\",\"svg\":{\"tag\":\"text\",\"attrs\":{\"x\":339.1,\"y\":117,\"xml:space\":\"preserve\",\"kerning\":\"auto\",\"fill\":\"#000000\",\"fill-opacity\":\"1\",\"font-size\":\"18\",\"font-family\":\"Helvetica\",\"font-weight\":\"normal\",\"font-style\":\"normal\",\"text-anchor\":\"start\",\"text-decoration\":\"none\"}}}SHAPE--><!--LAYOUT<g class=\"s-tblock\" x-format-type=\"datetime\" x-value=\"\" x-format-base=\"\" x-ref-id=\"\" kerning=\"auto\" x-display=\"true\" x-multiple=\"false\" x-id=\"printed_at\" fill=\"#000000\" fill-opacity=\"1\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"236.1\" x-height=\"18\" x-left=\"339.1\" x-top=\"100\" x-format-datetime-format=\"%Y/%m/%d %H:%M:%S\"><rect class=\"s-tblock-box\" stroke=\"#7C4007\" fill=\"#f4e2c4\" stroke-width=\"0.28\" fill-opacity=\"0.8\" width=\"236.1\" height=\"18\" x=\"339.1\" y=\"100\"></rect><text class=\"s-tblock-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" kerning=\"auto\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"341.1\" y=\"111\">printed_at</text></g>LAYOUT--><g class=\"s-text\" stroke-width=\"0\" fill=\"#000000\" fill-opacity=\"1\" kerning=\"auto\" x-display=\"true\" x-id=\"\" font-size=\"48\" font-family=\"IPAPMincho\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"middle\" text-decoration=\"none\" x-width=\"263\" x-height=\"52\" x-left=\"166.1\" x-top=\"20\"><rect class=\"s-text-box\" stroke=\"none\" fill=\"#000000\" fill-opacity=\"0.001\" width=\"263\" height=\"52\" x=\"166.1\" y=\"20\"></rect><text class=\"s-text-l0\" xml:space=\"preserve\" stroke=\"none\" fill=\"inherit\" fill-opacity=\"1\" text-decoration=\"none\" x=\"297.6\" y=\"62\">\u30c6\u30b9\u30c8\u6ce8\u6587\u66f8</text></g><!--SHAPE{\"type\":\"s-list\",\"id\":\"list\",\"display\":\"true\",\"desc\":null,\"footer\":{\"height\":5.6,\"svg\":{\"tag\":\"g\",\"content\":\"\"},\"translate\":{\"x\":-47,\"y\":-42.999999999999986}},\"footer-enabled\":\"true\",\"page-footer\":{\"height\":5.6,\"svg\":{\"tag\":\"g\",\"content\":\"\"},\"translate\":{\"x\":-47,\"y\":-37.39999999999999}},\"page-footer-enabled\":\"true\",\"detail\":{\"height\":34.6,\"svg\":{\"tag\":\"g\",\"content\":\"<!---SHAPE{\\\"type\\\":\\\"s-tblock\\\",\\\"id\\\":\\\"col1\\\",\\\"display\\\":\\\"true\\\",\\\"desc\\\":null,\\\"multiple\\\":\\\"false\\\",\\\"valign\\\":\\\"\\\",\\\"line-height\\\":\\\"\\\",\\\"box\\\":{\\\"x\\\":67,\\\"y\\\":215.5,\\\"width\\\":274.1,\\\"height\\\":18},\\\"format\\\":{\\\"base\\\":\\\"\\\",\\\"type\\\":\\\"\\\"},\\\"value\\\":\\\"\\\",\\\"ref-id\\\":\\\"\\\",\\\"svg\\\":{\\\"tag\\\":\\\"text\\\",\\\"attrs\\\":{\\\"x\\\":67,\\\"y\\\":232.5,\\\"xml:space\\\":\\\"preserve\\\",\\\"kerning\\\":\\\"auto\\\",\\\"fill\\\":\\\"#000000\\\",\\\"fill-opacity\\\":\\\"1\\\",\\\"font-size\\\":\\\"18\\\",\\\"font-family\\\":\\\"Helvetica\\\",\\\"font-weight\\\":\\\"normal\\\",\\\"font-style\\\":\\\"normal\\\",\\\"text-anchor\\\":\\\"start\\\",\\\"text-decoration\\\":\\\"none\\\"}}}SHAPE---><!---SHAPE{\\\"type\\\":\\\"s-tblock\\\",\\\"id\\\":\\\"col2\\\",\\\"display\\\":\\\"true\\\",\\\"desc\\\":null,\\\"multiple\\\":\\\"false\\\",\\\"valign\\\":\\\"\\\",\\\"line-height\\\":\\\"\\\",\\\"box\\\":{\\\"x\\\":342.2,\\\"y\\\":215.5,\\\"width\\\":280,\\\"height\\\":18},\\\"format\\\":{\\\"base\\\":\\\"\\\",\\\"type\\\":\\\"\\\"},\\\"value\\\":\\\"\\\",\\\"ref-id\\\":\\\"\\\",\\\"svg\\\":{\\\"tag\\\":\\\"text\\\",\\\"attrs\\\":{\\\"x\\\":342.2,\\\"y\\\":232.5,\\\"xml:space\\\":\\\"preserve\\\",\\\"kerning\\\":\\\"auto\\\",\\\"fill\\\":\\\"#000000\\\",\\\"fill-opacity\\\":\\\"1\\\",\\\"font-size\\\":\\\"18\\\",\\\"font-family\\\":\\\"Helvetica\\\",\\\"font-weight\\\":\\\"normal\\\",\\\"font-style\\\":\\\"normal\\\",\\\"text-anchor\\\":\\\"start\\\",\\\"text-decoration\\\":\\\"none\\\"}}}SHAPE---><line stroke=\\\"#000000\\\" stroke-width=\\\"1\\\" fill=\\\"none\\\" class=\\\"s-line\\\" x-display=\\\"true\\\" x-stroke-type=\\\"solid\\\" stroke-dasharray=\\\"none\\\" x-id=\\\"\\\" x1=\\\"67\\\" x2=\\\"622.2\\\" y1=\\\"235\\\" y2=\\\"235\\\"></line><line stroke=\\\"#000000\\\" stroke-width=\\\"1\\\" fill=\\\"none\\\" class=\\\"s-line\\\" x-display=\\\"true\\\" x-stroke-type=\\\"solid\\\" stroke-dasharray=\\\"none\\\" x-id=\\\"\\\" x1=\\\"622.2\\\" x2=\\\"622.2\\\" y1=\\\"250.1\\\" y2=\\\"249.1\\\"></line>\"},\"translate\":{\"x\":-47,\"y\":-30}},\"header\":{\"height\":7.4,\"svg\":{\"tag\":\"g\",\"content\":\"\"},\"translate\":{\"x\":-47,\"y\":-30}},\"header-enabled\":\"true\",\"svg\":{\"tag\":\"g\",\"attrs\":{}},\"content-height\":503.70000000000005,\"page-break\":\"true\"}SHAPE--><!--LAYOUT<g class=\"s-list\" x-id=\"list\" x-header-enabled=\"true\" x-page-footer-enabled=\"true\" x-footer-enabled=\"true\" x-changing-page=\"true\" x-display=\"true\" width=\"555.2\" height=\"511.1\" x=\"20\" y=\"178.1\"><g class=\"s-list-header\" transform=\"translate(-47,-30) rotate(0 0 0)\" x-top=\"178.1\" x-height=\"7.4\"></g><g class=\"s-list-detail\" transform=\"translate(-47,-30) rotate(0 0 0)\" x-top=\"185.5\" x-height=\"34.6\"><g class=\"s-tblock\" x-format-type=\"\" x-value=\"\" x-format-base=\"\" x-ref-id=\"\" kerning=\"auto\" x-display=\"true\" x-multiple=\"false\" x-id=\"col1\" fill=\"#000000\" fill-opacity=\"1\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"274.1\" x-height=\"18\" x-left=\"67\" x-top=\"215.5\"><rect class=\"s-tblock-box\" stroke=\"#7C4007\" fill=\"#f4e2c4\" stroke-width=\"0.28\" fill-opacity=\"0.8\" width=\"274.1\" height=\"18\" x=\"67\" y=\"215.5\"></rect><text class=\"s-tblock-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" kerning=\"auto\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"69\" y=\"226.5\">col1</text></g><g class=\"s-tblock\" x-format-type=\"\" x-value=\"\" x-format-base=\"\" x-ref-id=\"\" kerning=\"auto\" x-display=\"true\" x-multiple=\"false\" x-id=\"col2\" fill=\"#000000\" fill-opacity=\"1\" font-size=\"18\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" text-decoration=\"none\" x-width=\"280\" x-height=\"18\" x-left=\"342.2\" x-top=\"215.5\"><rect class=\"s-tblock-box\" stroke=\"#7C4007\" fill=\"#f4e2c4\" stroke-width=\"0.28\" fill-opacity=\"0.8\" width=\"280\" height=\"18\" x=\"342.2\" y=\"215.5\"></rect><text class=\"s-tblock-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-decoration=\"none\" text-anchor=\"start\" kerning=\"auto\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"344.2\" y=\"226.5\">col2</text></g><line stroke=\"#000000\" stroke-width=\"1\" fill=\"none\" class=\"s-line\" x-display=\"true\" x-stroke-type=\"solid\" stroke-dasharray=\"none\" x-id=\"\" x1=\"67\" x2=\"622.2\" y1=\"235\" y2=\"235\"></line><line stroke=\"#000000\" stroke-width=\"1\" fill=\"none\" class=\"s-line\" x-display=\"true\" x-stroke-type=\"solid\" stroke-dasharray=\"none\" x-id=\"\" x1=\"622.2\" x2=\"622.2\" y1=\"250.1\" y2=\"249.1\"></line></g><g class=\"s-list-page-footer\" transform=\"translate(-47,-2.8) rotate(0 0 0)\" x-top=\"220.1\" x-height=\"5.6\"></g><g class=\"s-list-footer\" transform=\"translate(-47,-2.8) rotate(0 0 0)\" x-top=\"225.7\" x-height=\"5.6\"></g><text class=\"s-list-id\" font-size=\"11\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" text-anchor=\"start\" stroke=\"none\" fill=\"#7C4007\" fill-opacity=\"1\" x=\"22\" y=\"188.9\">list</text><rect stroke-dasharray=\"5\" stroke=\"#BBBBBB\" stroke-width=\"1\" fill=\"#FFFFFF\" fill-opacity=\"0\" class=\"s-list-face\" width=\"555.2\" height=\"511.1\" x=\"20\" y=\"178.1\"></rect></g>LAYOUT--><line stroke=\"#000000\" stroke-width=\"1\" fill=\"none\" class=\"s-line\" x-display=\"true\" x-stroke-type=\"solid\" stroke-dasharray=\"none\" x-id=\"\" x1=\"158.8\" x2=\"427.4\" y1=\"84\" y2=\"84\"></line></g></svg>"}
@@ -16,6 +16,7 @@ ThinreportsRailsTestApp::Application.routes.draw do
16
16
  collection do
17
17
  get 'no_tlf'
18
18
  get 'other_tlf_path'
19
+ get 'no_set_layout'
19
20
  end
20
21
  end
21
22
  end
@@ -47,5 +48,6 @@ class OrdersController < ApplicationController
47
48
  end
48
49
  alias no_tlf index
49
50
  alias other_tlf_path index
51
+ alias no_set_layout index
50
52
  end
51
53
 
@@ -23,6 +23,11 @@ class ThinReportsRailsTest < ActionController::TestCase
23
23
  assert_response :success
24
24
  end
25
25
 
26
+ test 'use default tlf. no call set_layout. ' do
27
+ get :no_set_layout, :format => :pdf
28
+ assert_response :success
29
+ end
30
+
26
31
  test 'tlf can not choose not. raise Exception.' do
27
32
  assert_raise(ActionView::Template::Error) { get :no_tlf, :format => :pdf }
28
33
  end
@@ -14,5 +14,5 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "thinreports-rails"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = ThinreportsRails::VERSION
17
- gem.add_dependency "thinreports", '~>0.7.0'
17
+ gem.add_dependency "thinreports", '~>0.7.6'
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinreports-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
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-07-03 00:00:00.000000000 Z
12
+ date: 2012-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thinreports
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.7.0
21
+ version: 0.7.6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.7.0
29
+ version: 0.7.6
30
30
  description: Rails plugin for Thinreports DSL.
31
31
  email:
32
32
  - takeshinoda@gmail.com
@@ -35,9 +35,14 @@ extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
37
  - .gitignore
38
+ - .travis.yml
39
+ - CHANGELOG
38
40
  - Gemfile
39
41
  - LICENSE
40
42
  - README.md
43
+ - gemfiles/Gemfile-rails.3.0.x
44
+ - gemfiles/Gemfile-rails.3.1.x
45
+ - gemfiles/Gemfile-rails.3.2.x
41
46
  - lib/thinreports-rails.rb
42
47
  - lib/thinreports-rails/railtie.rb
43
48
  - lib/thinreports-rails/template_handler.rb
@@ -46,6 +51,8 @@ files:
46
51
  - test/test_app/app/views/orders/_other_header.pdf.thinreports
47
52
  - test/test_app/app/views/orders/index.pdf.thinreports
48
53
  - test/test_app/app/views/orders/index.tlf
54
+ - test/test_app/app/views/orders/no_set_layout.pdf.thinreports
55
+ - test/test_app/app/views/orders/no_set_layout.tlf
49
56
  - test/test_app/app/views/orders/no_tlf.pdf.thinreports
50
57
  - test/test_app/app/views/orders/other_tlf_path.pdf.thinreports
51
58
  - test/test_app/app/views/reports/other.tlf
@@ -81,6 +88,8 @@ test_files:
81
88
  - test/test_app/app/views/orders/_other_header.pdf.thinreports
82
89
  - test/test_app/app/views/orders/index.pdf.thinreports
83
90
  - test/test_app/app/views/orders/index.tlf
91
+ - test/test_app/app/views/orders/no_set_layout.pdf.thinreports
92
+ - test/test_app/app/views/orders/no_set_layout.tlf
84
93
  - test/test_app/app/views/orders/no_tlf.pdf.thinreports
85
94
  - test/test_app/app/views/orders/other_tlf_path.pdf.thinreports
86
95
  - test/test_app/app/views/reports/other.tlf