inkjet 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 834476aeabcd5ab348125c5fb525db4859ee4dfa
4
- data.tar.gz: a6f6b0b36d1a46213858d02febd83774bfd7b14c
3
+ metadata.gz: 72acf255b3ae411d26608f105f579021e0c6a127
4
+ data.tar.gz: c43e6b1afdd90669d08920d7b7d314a38efc0bc5
5
5
  SHA512:
6
- metadata.gz: daf70655f31d52f49a3f29d7d0487d4824ab8eede474c7044a80b38ab58d61fc8ae589850e9584d0a36de9ee1326be9f4c747de134a2d1e42186c6dc17636e72
7
- data.tar.gz: 6024564d3bea03575d45bd7e00aeb1de9d172453385c775357c31cfcb8500e1128236e6dd4bb7a4e709a518c2fba462699df62d37bc2f9a98d0a21d0ab6c84fd
6
+ metadata.gz: 16368b8b5f32fc41401e47569622fd1f9b9c49a04f21811900be8d1c3519af4eae7e1add2e7919f582135e37074deb1ebcaad9a2b4f79d082be1ceef2a20a251
7
+ data.tar.gz: acf95b0fa218df2e838fb2dbdd8d1b97381d9743a0bbed8a8f22f5d9aa651f3f4f34c29b7848aaaff1592016671e6558ecc2f9691fa2894eee739ba6dac59dff
@@ -14,6 +14,13 @@ module Inkjet
14
14
  @args = args
15
15
  end
16
16
  end
17
+
18
+ def self.add_bindings(block)
19
+ block.binding.eval("define_method :puts do |output| Inkjet::Indent.puts(output); end")
20
+ block.binding.eval("define_method :print do |output| Inkjet::Indent.print(output); end")
21
+ block.binding.eval("define_method :format_with do |meth, *args| Inkjet::Indent.format_with(meth, *args); end")
22
+ block
23
+ end
17
24
 
18
25
  def self.indent(*args, &block)
19
26
  @@spaces ||= 0
@@ -21,7 +28,7 @@ module Inkjet
21
28
  @@spaces += args[0] || TABSTOP
22
29
  scoped_formatters = formatters.clone
23
30
 
24
- class_eval &block
31
+ add_bindings(block).call
25
32
 
26
33
  @@formatters = scoped_formatters
27
34
  @@spaces -= args[0] || TABSTOP
@@ -1,3 +1,3 @@
1
1
  module Inkjet
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inkjet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec