bgem 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bgem.rb +22 -7
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96d672340c2e0219779613ee0f119d5c568b1aea
4
- data.tar.gz: d9687b5b9e364c51ea83422fd9c44ba95fad9a9a
3
+ metadata.gz: 5e2a60a95234060b3eea04309eed4bc83a91bb6b
4
+ data.tar.gz: 632c1bfa536331bb7ea0151348fea0d036e2986c
5
5
  SHA512:
6
- metadata.gz: b107053c821883afa1c8af1266e9069bff8d8c74d0761af551403f50fbbdaacbcf77587a9afb7c8522ecc153ba3fcdf3a1a18ac86ca4d9b05382b680243b0a44
7
- data.tar.gz: a8aa6cca73e13fa4ff93ba59d6e37711feb14436d3392f8c9655e5d141b08ffdf8e1e66131dd618dfd50e6ca6f1c471cf54e591e78556dbee7c3ea9f6b6e99d9
6
+ metadata.gz: e29cb1b762dca9317ce0386fd78c5a3f1f83cfd98a23df889a48d8ba20fe5134da0027a768ca65022619a54e255cb6d8b10b0e8678165ad2cb07f520c68b5189
7
+ data.tar.gz: 37240c248158fc477e02c70f44dc5c2bd36e98640a91761ed26df5286db36cb3828b29469ee4a276c6d9e54960d02a04bf1a3ecf431d0755060ad9774f00e871
@@ -73,6 +73,7 @@ module Bgem
73
73
 
74
74
  def source
75
75
  source = @source.indent INDENT
76
+ source.prepend "#{pre}\n\n" unless pre.empty?
76
77
  source.prepend "#{before}\n\n" unless before.empty?
77
78
  source.concat "\n#{after}\n" unless after.empty?
78
79
  source
@@ -80,16 +81,30 @@ module Bgem
80
81
 
81
82
  def self.concatenate_source_files *symbols
82
83
  symbols.each do |symbol|
83
- define_method symbol do
84
- pattern = @file.dirname.join "#{__method__}.#{@constant}/*.rb"
85
- Dir[pattern].sort.map do |file|
86
- self.class.new(file, indent: INDENT).to_s
87
- end.join "\n\n"
88
- end
84
+ define_appendix symbol
89
85
  end
90
86
  end
91
87
 
92
- concatenate_source_files :before, :after
88
+ def self.define_appendix name
89
+ define_method name do
90
+ pattern = @file.dirname.join "#{__method__}.#{@constant}/*.rb"
91
+ Dir[pattern].sort.map do |file|
92
+ self.class.new(file, indent: INDENT).to_s
93
+ end.join "\n\n"
94
+ end
95
+ end
96
+
97
+ concatenate_source_files :pre, :before
98
+
99
+ def after
100
+ patterns = ["#{@constant}/*.rb", "after.#{@constant}/*.rb"].map do |pattern|
101
+ @file.dirname.join pattern
102
+ end
103
+
104
+ Dir[*patterns].sort.map do |file|
105
+ self.class.new(file, indent: INDENT).to_s
106
+ end.join "\n\n"
107
+ end
93
108
  end
94
109
 
95
110
  class TargetFile
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.9
4
+ version: 0.0.10
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-04-10 00:00:00.000000000 Z
11
+ date: 2017-08-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  version: '0'
39
39
  requirements: []
40
40
  rubyforge_project:
41
- rubygems_version: 2.6.8
41
+ rubygems_version: 2.6.11
42
42
  signing_key:
43
43
  specification_version: 4
44
44
  summary: Build gems without too much hassle.