caracal-rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -25
- data/caracal-rails.gemspec +1 -1
- data/lib/caracal/rails/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d865a2d764c382f053cd7d3fdb2e87e5ec74c1a5
|
4
|
+
data.tar.gz: 1038673a260a51f1c0779d200d867c4d17be4615
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7617c0e9bb09b7b03798fa51e5e727370e80591e4f044870109270b8e9d4ddec323e9ff3d752245223832c951781b916ad36f44f8a93be9bda2f2db00780a81
|
7
|
+
data.tar.gz: ea093ab7e547eaa8a228492d277d26d40780f134a49e97cb07fd281c5aee9af95f03d6bfb34da4ee34e0f4e15183a39f3f6730341e9d3de3090d9feb6a8e5335
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Caracal-Rails
|
2
2
|
|
3
|
-
[Caracal](https://github.com/
|
3
|
+
[Caracal](https://github.com/trade-informatics/caracal) is a ruby library for dynamically creating professional-quality Microsoft Word documents.
|
4
4
|
|
5
|
-
Caracal-Rails is a drop in solution for registering the Microsoft Word mime type and for establishing a template handler in Rails for the :docx format. All caracal documents are rendered with an explicit block passing
|
5
|
+
Caracal-Rails is a drop in solution for registering the Microsoft Word mime type and for establishing a template handler in Rails for the :docx format. All caracal documents are rendered with an explicit block passing a reference to the Caracal::Document object named `docx`.
|
6
6
|
|
7
7
|
|
8
8
|
## Installation
|
@@ -32,9 +32,6 @@ Then add a view file with the Caracal extension:
|
|
32
32
|
|
33
33
|
Inside your view, simply issue Caracal commands on the document object:
|
34
34
|
|
35
|
-
docx.file_name 'quarterly_report'
|
36
|
-
|
37
|
-
docx.font 'Arial'
|
38
35
|
docx.font 'Droid Serif'
|
39
36
|
|
40
37
|
docx.style 'special' do
|
@@ -43,39 +40,39 @@ Inside your view, simply issue Caracal commands on the document object:
|
|
43
40
|
size 16
|
44
41
|
end
|
45
42
|
|
46
|
-
docx.
|
47
|
-
|
48
|
-
|
49
|
-
h2
|
50
|
-
p 'Lorem ipsum dolor...'
|
51
|
-
p do
|
52
|
-
text '
|
53
|
-
link '
|
54
|
-
text '
|
43
|
+
docx.h1 'Quarterly Report'
|
44
|
+
docx.hr
|
45
|
+
@report.clients.each do |client|
|
46
|
+
docx.h2 client.name
|
47
|
+
docx.p 'Lorem ipsum dolor...'
|
48
|
+
docx.p do
|
49
|
+
text 'This is a sentence with a '
|
50
|
+
link 'link', 'http://www.google.com/', style: 'special'
|
51
|
+
text ' in the middle.'
|
55
52
|
end
|
56
|
-
img image_url('example.png'), width: 300, height: 200, align: 'right'
|
57
|
-
br
|
58
|
-
table
|
59
|
-
cell_style rows
|
53
|
+
docx.img image_url('https://www.example.com/logo.png'), width: 300, height: 200, align: 'right'
|
54
|
+
docx.br
|
55
|
+
docx.table client.tablular_data, border_size: 4 do
|
56
|
+
cell_style rows[0], background_color: '3366cc', color: 'ffffff', bold: true
|
60
57
|
end
|
61
|
-
page
|
62
|
-
p 'This is an bulleted list'
|
63
|
-
ul do
|
58
|
+
docx.page
|
59
|
+
docx.p 'This is an bulleted list.'
|
60
|
+
docx.ul do
|
64
61
|
li do
|
65
62
|
strong 'Item 1'
|
66
63
|
text 'More text'
|
67
64
|
end
|
68
65
|
li 'Item 2'
|
69
66
|
end
|
70
|
-
...
|
71
67
|
end
|
72
68
|
|
73
|
-
|
69
|
+
|
70
|
+
*See the [Caracal](https://github.com/trade-informatics/caracal) library for more details.*
|
74
71
|
|
75
72
|
|
76
73
|
## Contributing
|
77
74
|
|
78
|
-
1. Fork it ( https://github.com/
|
75
|
+
1. Fork it ( https://github.com/trade-informatics/caracal-rails/fork )
|
79
76
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
80
77
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
81
78
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -96,4 +93,4 @@ A tip of the hat to the wonderful PDF generation libraries [Prawn](https://githu
|
|
96
93
|
|
97
94
|
Copyright (c) 2014 Trade Informatics, Inc
|
98
95
|
|
99
|
-
[MIT License](https://github.com/
|
96
|
+
[MIT License](https://github.com/trade-informatics/caracal-rails/blob/master/LICENSE.txt)
|
data/caracal-rails.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'caracal', '~> 0.
|
21
|
+
spec.add_dependency 'caracal', '~> 0.2'
|
22
22
|
spec.add_dependency 'rails', '>= 3.2'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'appraisal', '~> 1.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caracal-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trade Informatics
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: caracal
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0.
|
20
|
+
version: '0.2'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '0.
|
27
|
+
version: '0.2'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rails
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|