genius-builder 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/genius +4 -2
- data/lib/genius.rh +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b31ca5d1442b857a0b7cd2b281ea235e477d872aebdd27412624fa56ce0a06a1
|
4
|
+
data.tar.gz: a6d19c80a73117e1e809eba9c3ce43d85fbb4289b1b3d51160bf8eadf56a1869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec000e0f21c9e72a61e1569c4dcbdd45f22545c8d39f880252346bd0959b49e03b424d00b4e4d40b0c2deff1198dc204d27ea0731b6d72aaa73828c4786700f
|
7
|
+
data.tar.gz: a885680c400278f9503758bd59cd7e3ec13d7df9a6638933e03c7d59ad7c7d2a5ebf1a506ae1981250bb5b1eb1b9c02bda606f6151929ef4a3f5780079fc2316
|
data/bin/genius
CHANGED
@@ -63,6 +63,7 @@ module Genius
|
|
63
63
|
attr_accessor :name, :files, :commands
|
64
64
|
def initialize(name, *files, &command)
|
65
65
|
@name = name
|
66
|
+
# @files = files.flatten.map{|f| /^#{f.gsub("*", ".*")}$/}
|
66
67
|
@files = files.flatten.map(&:to_s)
|
67
68
|
@commands = [command]
|
68
69
|
end
|
@@ -116,7 +117,7 @@ file_set = Hash.new {|h,k| h[k] = []}
|
|
116
117
|
Dir["**/*"].each do |file|
|
117
118
|
split_name = file.split(".")
|
118
119
|
if split_name.size > 1
|
119
|
-
file_set[split_name
|
120
|
+
file_set[split_name.last] << file
|
120
121
|
end
|
121
122
|
end
|
122
123
|
|
@@ -132,7 +133,8 @@ end
|
|
132
133
|
|
133
134
|
# Check for build tool patterns, terminating after build completion if one is matched
|
134
135
|
Genius.build_tools.each do |name, tool|
|
135
|
-
|
136
|
+
files = tool.files.flat_map {|f| Dir[f]}
|
137
|
+
if files.any? {|f| File.exist?(f) && !File.directory?(f)}
|
136
138
|
puts "Matched build tool pattern: #{tool.name}"
|
137
139
|
tool.build(file_set) # Does not contain all files, so may not be useful.
|
138
140
|
exit
|
data/lib/genius.rh
CHANGED
@@ -63,6 +63,7 @@ module Genius
|
|
63
63
|
attr_accessor :name, :files, :commands
|
64
64
|
def initialize(name, *files, &command)
|
65
65
|
@name = name
|
66
|
+
# @files = files.flatten.map{|f| /^#{f.gsub("*", ".*")}$/}
|
66
67
|
@files = files.flatten.map(&:to_s)
|
67
68
|
@commands = [command]
|
68
69
|
end
|
@@ -116,7 +117,7 @@ file_set = Hash.new {|h,k| h[k] = []}
|
|
116
117
|
Dir["**/*"].each do |file|
|
117
118
|
split_name = file.split(".")
|
118
119
|
if split_name.size > 1
|
119
|
-
file_set[split_name
|
120
|
+
file_set[split_name.last] << file
|
120
121
|
end
|
121
122
|
end
|
122
123
|
|
@@ -132,7 +133,8 @@ end
|
|
132
133
|
|
133
134
|
# Check for build tool patterns, terminating after build completion if one is matched
|
134
135
|
Genius.build_tools.each do |name, tool|
|
135
|
-
|
136
|
+
files = tool.files.flat_map {|f| Dir[f]}
|
137
|
+
if files.any? {|f| File.exist?(f) && !File.directory?(f)}
|
136
138
|
puts "Matched build tool pattern: #{tool.name}"
|
137
139
|
tool.build(file_set) # Does not contain all files, so may not be useful.
|
138
140
|
exit
|