dot_why 1.0.0 → 1.0.1
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 +4 -4
- data/lib/dot_why.rb +13 -7
- 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: 39eb8e2e9d1c535efe41ff75c1db523e8d2d2105
|
4
|
+
data.tar.gz: 71f1e98fcd52dbebe24278e43808d15b6fc2cb80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b463ed51aca8275ce7057890b56774f1555991f3f435750d1b789921ca24e91befe91f7f58f8bd991ef6e87bc794df20f80dbf34b8eefcec7e300a526a9be7e0
|
7
|
+
data.tar.gz: be89a4120da9a7ffe4eea11c6f2b23678b5ccee163065482473949a80fbad7ef20389306031a3671168d22e34d6322d01b3edd49b09842599e75042a6c2be43d
|
data/lib/dot_why.rb
CHANGED
@@ -6,13 +6,8 @@ module Dot_Why
|
|
6
6
|
|
7
7
|
class Template < Erector::Widget
|
8
8
|
|
9
|
-
|
10
|
-
@file = file = File.expand_path(raw_file).sub(".rb", "") + '.rb'
|
11
|
-
@_blocks = {}
|
12
|
-
super(*args)
|
13
|
-
end
|
9
|
+
class << self # ================================================================
|
14
10
|
|
15
|
-
class << self
|
16
11
|
def blocks *args
|
17
12
|
args.each do |word|
|
18
13
|
define_method(word.to_sym) do |pos = :bottom, &b|
|
@@ -20,10 +15,21 @@ module Dot_Why
|
|
20
15
|
end
|
21
16
|
end
|
22
17
|
end
|
23
|
-
|
18
|
+
|
19
|
+
end # ==========================================================================
|
24
20
|
|
25
21
|
blocks :main
|
26
22
|
|
23
|
+
def initialize raw_file, *args
|
24
|
+
@file = file = File.expand_path(raw_file).sub(".rb", "") + '.rb'
|
25
|
+
@_blocks = {}
|
26
|
+
super(*args)
|
27
|
+
end
|
28
|
+
|
29
|
+
def main_file
|
30
|
+
@file
|
31
|
+
end
|
32
|
+
|
27
33
|
def block raw_name, pos = :bottom, *args, &b
|
28
34
|
name = raw_name.to_sym
|
29
35
|
if (b)
|