ink 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ink/helper.rb CHANGED
@@ -13,8 +13,8 @@ module Ink
13
13
  # <%= format @code, "Rakefile" %>
14
14
  # <%= format @code, "Rakefile", :line_numbers => true %>
15
15
  #
16
- def format(code, file, options = {})
17
- Ink::Formatter.format(code, file, options)
16
+ def format(code, file, options = {}, &block)
17
+ Ink::Formatter.format(code, file, options, &block)
18
18
  end
19
19
 
20
20
  # Return a code snippet highlighted in the specified
data/lib/ink/version.rb CHANGED
@@ -2,7 +2,7 @@ module Ink
2
2
  module Version # :nodoc: all
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 2
5
+ PATCH = 3
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -30,4 +30,11 @@ class Ink::HelperTest < Test::Unit::TestCase
30
30
  assert_match %r{<td class="line">1</td>}, html
31
31
  assert_match %r{<td class="code">(.*?)</td>}, html
32
32
  end
33
+
34
+ def test_format_with_block
35
+ @helper.format(%[Object.new], "file.rb") do |type, html|
36
+ assert_equal :code, type
37
+ assert_match %r{<pre>(.*?)</pre>}, html
38
+ end
39
+ end
33
40
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nando Vieira