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 +4 -4
- data/lib/inkjet/indent.rb +8 -1
- data/lib/inkjet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72acf255b3ae411d26608f105f579021e0c6a127
|
4
|
+
data.tar.gz: c43e6b1afdd90669d08920d7b7d314a38efc0bc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16368b8b5f32fc41401e47569622fd1f9b9c49a04f21811900be8d1c3519af4eae7e1add2e7919f582135e37074deb1ebcaad9a2b4f79d082be1ceef2a20a251
|
7
|
+
data.tar.gz: acf95b0fa218df2e838fb2dbdd8d1b97381d9743a0bbed8a8f22f5d9aa651f3f4f34c29b7848aaaff1592016671e6558ecc2f9691fa2894eee739ba6dac59dff
|
data/lib/inkjet/indent.rb
CHANGED
@@ -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
|
-
|
31
|
+
add_bindings(block).call
|
25
32
|
|
26
33
|
@@formatters = scoped_formatters
|
27
34
|
@@spaces -= args[0] || TABSTOP
|
data/lib/inkjet/version.rb
CHANGED