canned_tuna 0.0.6 → 0.0.7

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
  SHA256:
3
- metadata.gz: ae4cf59776aa39002650fa4497ab9af9207a545b83c1f601b9c4f46fb61477e8
4
- data.tar.gz: d0953722529d21d5381b242745bdf5080f619ed894f2ecc0e1d64ab2364c485d
3
+ metadata.gz: ab3bd07f29156d2138fad49b9d6663d2c87dcf07496c1dfb7e67a351f4a1b7d6
4
+ data.tar.gz: 909ecaa935f36453f431ada8eec179476f628588df634b8807b6a3814c4aab6a
5
5
  SHA512:
6
- metadata.gz: 6b9273d8db95cd502a7542c1972edaff57b7aca1c13f2582f48359eb8f256e36cf20abc9e792d75a8f04c84a192868cff91c6faaf3b6ef1e677bae8d81e9faed
7
- data.tar.gz: 8a231d9d12802a515ba49627c78dd237fc4fb28473cee240cd4574cb796d4ccd63d3b6e3b2c12210fcd7baccd6ffc3dae9d88f4f05820482dc2a0f48ab4ba93e
6
+ metadata.gz: 4700c5a854544712d94ee563b4851018cee36d3b583d3d43cae235f6c8ef67ee61e671266ea1d43cbb1537480528fc138bf8140d920324a440586a0e1233e8a9
7
+ data.tar.gz: fe777eacf18e4784d0a56c3a09c4acf6f7bb5c66c77c0de7c35b45f5d0752ab18f3ba12c1b8d9f1ce21d0d9b7254e7027eb3c7c1d377133b0f17818d6269aace
data/.gitignore CHANGED
@@ -6,3 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+
10
+ *.gem
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.4
1
+ 3.1.2
data/Gemfile.lock CHANGED
@@ -1,53 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- canned_tuna (0.0.6)
4
+ canned_tuna (0.0.7)
5
+ matrix
5
6
  prawn (~> 2.2)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
- Ascii85 (1.0.3)
11
+ Ascii85 (1.1.0)
11
12
  afm (0.2.2)
12
- ast (2.4.0)
13
+ ast (2.4.2)
13
14
  hashery (2.1.2)
14
- jaro_winkler (1.5.3)
15
- minitest (5.11.3)
16
- minitest-focus (1.2.0)
15
+ jaro_winkler (1.5.4)
16
+ matrix (0.4.2)
17
+ minitest (5.16.3)
18
+ minitest-focus (1.3.1)
17
19
  minitest (>= 4, < 6)
18
- parallel (1.17.0)
19
- parser (2.6.4.1)
20
- ast (~> 2.4.0)
21
- pdf-core (0.7.0)
20
+ parallel (1.22.1)
21
+ parser (3.1.2.1)
22
+ ast (~> 2.4.1)
23
+ pdf-core (0.9.0)
22
24
  pdf-inspector (1.3.0)
23
25
  pdf-reader (>= 1.0, < 3.0.a)
24
- pdf-reader (2.2.1)
25
- Ascii85 (~> 1.0.0)
26
+ pdf-reader (2.11.0)
27
+ Ascii85 (~> 1.0)
26
28
  afm (~> 0.2.1)
27
29
  hashery (~> 2.0)
28
30
  ruby-rc4
29
31
  ttfunk
30
- prawn (2.2.2)
31
- pdf-core (~> 0.7.0)
32
- ttfunk (~> 1.5)
33
- rainbow (3.0.0)
34
- rake (13.0.1)
35
- rubocop (0.72.0)
32
+ prawn (2.4.0)
33
+ pdf-core (~> 0.9.0)
34
+ ttfunk (~> 1.7)
35
+ rainbow (3.1.1)
36
+ rake (13.0.6)
37
+ rubocop (0.79.0)
36
38
  jaro_winkler (~> 1.5.1)
37
39
  parallel (~> 1.10)
38
- parser (>= 2.6)
40
+ parser (>= 2.7.0.1)
39
41
  rainbow (>= 2.2.2, < 4.0)
40
42
  ruby-progressbar (~> 1.7)
41
43
  unicode-display_width (>= 1.4.0, < 1.7)
42
- rubocop-performance (1.4.1)
44
+ rubocop-performance (1.5.2)
43
45
  rubocop (>= 0.71.0)
44
- ruby-progressbar (1.10.1)
46
+ ruby-progressbar (1.11.0)
45
47
  ruby-rc4 (0.1.5)
46
- standard (0.1.4)
47
- rubocop (~> 0.72.0)
48
- rubocop-performance (~> 1.4.0)
49
- ttfunk (1.5.1)
50
- unicode-display_width (1.6.0)
48
+ standard (0.1.10)
49
+ rubocop (~> 0.79.0)
50
+ rubocop-performance (~> 1.5.1)
51
+ ttfunk (1.7.0)
52
+ unicode-display_width (1.6.1)
51
53
 
52
54
  PLATFORMS
53
55
  ruby
@@ -62,4 +64,4 @@ DEPENDENCIES
62
64
  standard (~> 0.1.4)
63
65
 
64
66
  BUNDLED WITH
65
- 2.0.2
67
+ 2.3.25
data/README.md CHANGED
@@ -6,6 +6,22 @@ Organizing content in Prawn gets notoriously difficult as the size and complexit
6
6
 
7
7
  Components are an antidote to this approach. They encapsulate a self-contained piece of content which can be drawn in any document. This makes them easy to test and reuse.
8
8
 
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'canned_tuna'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install canned_tuna
24
+
9
25
  ## Example
10
26
  ```ruby
11
27
  class Box < CannedTuna::Component
@@ -37,27 +53,27 @@ end
37
53
  ## Outlets
38
54
 
39
55
  ### Default outlet
40
- Components can define a single content outlet using the short-hand syntax.
56
+ Components can define a single content outlet by using the `outlet` helper inside the template:
41
57
 
42
58
  ```ruby
43
- class Box < CannedTuna::Component
59
+ class Panel < CannedTuna::Component
44
60
  template do
45
61
  outlet
46
62
  end
47
63
  end
48
64
 
49
- Prawn::Document.generate("box.pdf") do
50
- draw Box do
51
- text "Inside the box"
65
+ Prawn::Document.generate("single_outlet.pdf") do
66
+ draw Panel do
67
+ text "Inside the panel"
52
68
  end
53
69
  end
54
70
  ```
55
71
 
56
72
  ### Named outlets
57
- Components can define multiple content outlets by yielding a content object that provides hooks for naming and defining multiple outlets.
73
+ Components can define multiple content outlets by passing their names to the `outlet` helper:
58
74
 
59
75
  ```ruby
60
- class Box < CannedTuna::Component
76
+ class Panel < CannedTuna::Component
61
77
  template do
62
78
  outlet(:header)
63
79
  outlet(:body)
@@ -65,8 +81,8 @@ class Box < CannedTuna::Component
65
81
  end
66
82
  end
67
83
 
68
- Prawn::Document.generate("outlets.pdf") do
69
- draw Box do |content|
84
+ Prawn::Document.generate("multiple_outlets.pdf") do
85
+ draw Panel do |content|
70
86
  content.outlet(:header) do
71
87
  text "I am the header"
72
88
  end
@@ -81,10 +97,10 @@ end
81
97
  ```
82
98
 
83
99
  ### Default content
84
- Components can define default content for their outlets
100
+ Components can define default content for their outlets by yielding a block to the `outlet` helper:
85
101
 
86
102
  ```ruby
87
- class Box < CannedTuna::Component
103
+ class Panel < CannedTuna::Component
88
104
  template do
89
105
  outlet(:header) { text "I am the header" }
90
106
  outlet(:body)
@@ -92,8 +108,8 @@ class Box < CannedTuna::Component
92
108
  end
93
109
  end
94
110
 
95
- Prawn::Document.generate("outlets.pdf") do
96
- draw Box do |content|
111
+ Prawn::Document.generate("default_content.pdf") do
112
+ draw Panel do |content|
97
113
  content.outlet(:body) do
98
114
  text "I am the body"
99
115
  end
@@ -101,22 +117,6 @@ Prawn::Document.generate("outlets.pdf") do
101
117
  end
102
118
  ```
103
119
 
104
- ## Installation
105
-
106
- Add this line to your application's Gemfile:
107
-
108
- ```ruby
109
- gem 'canned_tuna'
110
- ```
111
-
112
- And then execute:
113
-
114
- $ bundle
115
-
116
- Or install it yourself as:
117
-
118
- $ gem install canned_tuna
119
-
120
120
  ## Development
121
121
 
122
122
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/canned_tuna.gemspec CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.require_paths = ["lib"]
27
27
 
28
28
  spec.add_dependency "prawn", "~> 2.2"
29
+ spec.add_dependency "matrix"
29
30
  spec.add_development_dependency "bundler", "~> 2.0"
30
31
  spec.add_development_dependency "minitest", "~> 5.0"
31
32
  spec.add_development_dependency "minitest-focus", "~> 1.2"
@@ -1,7 +1,7 @@
1
1
  module CannedTuna
2
2
  module Interface
3
- def draw component, *args, &block
4
- component.new(*args).draw_in(self, &block)
3
+ def draw component, **args, &block
4
+ component.new(**args).draw_in(self, &block)
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module CannedTuna
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canned_tuna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Meyer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-03 00:00:00.000000000 Z
11
+ date: 2022-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: matrix
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -139,7 +153,7 @@ licenses:
139
153
  metadata:
140
154
  homepage_uri: https://github.com/kaspermeyer/canned_tuna
141
155
  source_code_uri: https://github.com/kaspermeyer/canned_tuna
142
- post_install_message:
156
+ post_install_message:
143
157
  rdoc_options: []
144
158
  require_paths:
145
159
  - lib
@@ -154,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
168
  - !ruby/object:Gem::Version
155
169
  version: '0'
156
170
  requirements: []
157
- rubygems_version: 3.0.3
158
- signing_key:
171
+ rubygems_version: 3.3.7
172
+ signing_key:
159
173
  specification_version: 4
160
174
  summary: Components for Prawn
161
175
  test_files: []