genius-builder 0.2.0 → 0.3.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/genius +4 -2
  3. data/lib/genius.rh +4 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e779a5692b018a7715aca949c3b96274b8e67661996ec41e9e0cf90e3a81833
4
- data.tar.gz: 2a2b6e31b4f0e64e48d5783e2d95212e020e9d18b7b474535dfe5e72bfef7cfe
3
+ metadata.gz: b31ca5d1442b857a0b7cd2b281ea235e477d872aebdd27412624fa56ce0a06a1
4
+ data.tar.gz: a6d19c80a73117e1e809eba9c3ce43d85fbb4289b1b3d51160bf8eadf56a1869
5
5
  SHA512:
6
- metadata.gz: 710ff1f94d30e2c1de2a4f3eaa7c373cda2804bc6f668e9561c2723bea20b2f66bd577eb64c87db069e4fd62dddf32fad0df02b8a9ff042bf422ff8ecf4fc81e
7
- data.tar.gz: d1a258fc755b900b0b8042ef7e83fe45feb28ff1245ca7626c7158e2c67508b529db4b3f255070a0f6b81655724420ed9a828f069281f858d822f06258d65b62
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[-1]] << file
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
- if tool.files.any? {|f| File.exist?(f) && !File.directory?(f)}
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
@@ -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[-1]] << file
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
- if tool.files.any? {|f| File.exist?(f) && !File.directory?(f)}
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genius-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kellen Watt