caracal-rails 0.1.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adb1feddfbe63116a2ee52a308f0bc0db2ee8942
4
- data.tar.gz: 39165bf8dd33040c07d6e0ca600026d5ccf64e98
3
+ metadata.gz: d865a2d764c382f053cd7d3fdb2e87e5ec74c1a5
4
+ data.tar.gz: 1038673a260a51f1c0779d200d867c4d17be4615
5
5
  SHA512:
6
- metadata.gz: 85c6d51dc91ee6573adc4e04efd8851bc9aa4b9ac9c06b9d85de6f57a4b7a8fd28a5c0089d0c623acd28c67956ec9bbeb817f23eb02e666a2536a34f90d1ac59
7
- data.tar.gz: 9307effc71b92b3bad2e0dd7a08404280f979d6c692f9271f83aa28b8bd47c95eeeec27979e11fe152a3108f9f11d0df99157c49ed6cd3fdf805659dbc70d079
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/ibpinc/caracal) is a ruby library for dynamically creating professional-quality Microsoft Word documents (.docx).
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 an argument named `docx`.
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.content do
47
- h1 'Quarterly Report'
48
- hr
49
- h2 'Client A'
50
- p 'Lorem ipsum dolor...'
51
- p do
52
- text 'Normal text'
53
- link 'Link text', 'http://www.google.com/', class: 'special
54
- text 'More normal 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 data, border: 1 do
59
- cell_style rows(0), background_color: '3366cc', color: 'ffffff', bold: true
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
- *See the [Caracal](https://github.com/ibpinc/caracal) library for more details.*
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/ibpinc/caracal-rails/fork )
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/ibpinc/caracal-rails/blob/master/LICENSE.txt)
96
+ [MIT License](https://github.com/trade-informatics/caracal-rails/blob/master/LICENSE.txt)
@@ -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.1'
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'
@@ -1,5 +1,5 @@
1
1
  module Caracal
2
2
  module Rails
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
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.1.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-08-16 00:00:00.000000000 Z
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.1'
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.1'
27
+ version: '0.2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rails
30
30
  requirement: !ruby/object:Gem::Requirement