prawn_commander 0.1.1 → 0.1.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -7,6 +7,14 @@ module Prawn
7
7
  @prawn_commands = []
8
8
  @options = options
9
9
  end
10
+
11
+ def prawn_commands(&block)
12
+ ctx = @prawn_commands
13
+ if block
14
+ block.arity < 1 ? ctx.instance_eval(&block) : block.call(ctx)
15
+ end
16
+ ctx
17
+ end
10
18
 
11
19
  def raw_prawn_commands
12
20
  raw_commands = []
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{prawn_commander}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
@@ -1,7 +1,7 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
2
2
 
3
3
  describe Prawn::Commander do
4
- let (:doc) { Prawn::Document.new(:page_size => "A4") }
4
+ let (:doc) { Prawn::Document.new }
5
5
 
6
6
  before(:each) do
7
7
  @commander = Prawn::Commander.new
@@ -17,6 +17,9 @@ describe Prawn::Commander do
17
17
  it "should add 'move_down' to command stack" do
18
18
  @commander.prawn_command(:move_down, 10)
19
19
  @commander.prawn_commands.first.should be_command(:move_down, 10)
20
+ @commander.prawn_commands do |c|
21
+ c.first.should be_command(:move_down, 10)
22
+ end
20
23
  end
21
24
  end
22
25
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup