bgem 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bgem.rb +14 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18dc0d82373711c361b72cd76cfe9a89e6df14b0
|
4
|
+
data.tar.gz: 2c06eddde35fa89034b46c8e9baaee0ba746051e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea8dcdf82dd92ee7969c6325f28defcd50d38cec425277aa22674d08b67b50111515d37d794ca876c84b446a066354b5f727942490ce01f90370372a3b6ee2c8
|
7
|
+
data.tar.gz: 1ed151abc9acf8eecaa2fc616d9a4be519a00a7e8306b477257c13611a2e0a49f5c9e0b3d991ad309eaecac8f61dccf8a1b1a0a8dd99d93a9b3dcfc8bd1b3b48
|
data/lib/bgem.rb
CHANGED
@@ -44,8 +44,8 @@ module Bgem
|
|
44
44
|
@config.output = file
|
45
45
|
end
|
46
46
|
|
47
|
-
def inside *
|
48
|
-
@config.scope =
|
47
|
+
def inside *headers
|
48
|
+
@config.scope = headers
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -79,32 +79,29 @@ module Bgem
|
|
79
79
|
source
|
80
80
|
end
|
81
81
|
|
82
|
-
def self.concatenate_source_files *symbols
|
83
|
-
symbols.each do |symbol|
|
84
|
-
define_appendix symbol
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
82
|
def self.define_appendix name
|
89
83
|
define_method name do
|
90
84
|
pattern = @file.dirname.join "#{__method__}.#{@constant}/*.rb"
|
91
|
-
|
92
|
-
self.class.new(file, indent: INDENT).to_s
|
93
|
-
end.join "\n\n"
|
85
|
+
concatenate pattern
|
94
86
|
end
|
95
87
|
end
|
96
88
|
|
97
|
-
|
89
|
+
[:pre, :before].each { |name| define_appendix name }
|
98
90
|
|
99
91
|
def after
|
100
92
|
patterns = ["#{@constant}/*.rb", "after.#{@constant}/*.rb"].map do |pattern|
|
101
93
|
@file.dirname.join pattern
|
102
94
|
end
|
103
95
|
|
104
|
-
|
105
|
-
self.class.new(file, indent: INDENT).to_s
|
106
|
-
end.join "\n\n"
|
96
|
+
concatenate *patterns
|
107
97
|
end
|
98
|
+
|
99
|
+
private
|
100
|
+
def concatenate *patterns
|
101
|
+
Dir[*patterns].sort.map do |file|
|
102
|
+
self.class.new(file, indent: INDENT).to_s
|
103
|
+
end.join "\n\n"
|
104
|
+
end
|
108
105
|
end
|
109
106
|
|
110
107
|
class TargetFile
|
@@ -117,8 +114,8 @@ module Bgem
|
|
117
114
|
@path.dirname.mkpath
|
118
115
|
|
119
116
|
if @scope
|
120
|
-
@scope.each do |
|
121
|
-
string = "#{
|
117
|
+
@scope.each do |header|
|
118
|
+
string = "#{header}\n#{string.indent INDENT}\nend"
|
122
119
|
end
|
123
120
|
end
|
124
121
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bgem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoly Chernow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|