specrun 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/specrun +5 -2
- data/lib/specrun.rb +12 -10
- metadata +2 -2
data/bin/specrun
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
#$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
3
|
+
require 'rubygems'
|
3
4
|
require 'specrun'
|
4
|
-
|
5
|
+
config_file = YAML.load_file('config.yaml')
|
6
|
+
puts Dir.pwd
|
7
|
+
sr = SpecRun.new(config_file)
|
5
8
|
sr.build
|
6
9
|
|
data/lib/specrun.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
require 'find'
|
2
|
+
require 'yaml'
|
2
3
|
|
3
4
|
class SpecRun
|
4
|
-
|
5
|
-
|
6
|
-
@
|
7
|
-
@
|
5
|
+
|
6
|
+
def initialize(config_file)
|
7
|
+
@spec_dir = config_file['spec_dir']
|
8
|
+
@spec_ext = config_file['spec_ext']
|
9
|
+
@output_dir = config_file['output_dir']
|
8
10
|
@paths = gather_specs
|
9
11
|
end
|
10
12
|
|
11
13
|
def gather_specs
|
12
14
|
files = []
|
13
|
-
Find.find(@
|
15
|
+
Find.find(@spec_dir) do |path|
|
14
16
|
if FileTest.directory?(path)
|
15
17
|
if File.basename(path)[0] == ?.
|
16
18
|
Find.prune
|
@@ -27,11 +29,11 @@ class SpecRun
|
|
27
29
|
end
|
28
30
|
|
29
31
|
def build
|
30
|
-
unless File::exists?(@
|
31
|
-
Dir.mkdir(@
|
32
|
-
puts "Creating new directory '#{@
|
32
|
+
unless File::exists?(@output_dir)
|
33
|
+
Dir.mkdir(@output_dir)
|
34
|
+
puts "Creating new directory '#{@output_dir}'"
|
33
35
|
end
|
34
|
-
Dir.chdir @
|
36
|
+
Dir.chdir @output_dir
|
35
37
|
@paths.each do |path|
|
36
38
|
files = path.split("/")
|
37
39
|
files.size.times do |x|
|
@@ -58,7 +60,7 @@ class SpecRun
|
|
58
60
|
afile.puts `spec -f h "#{path}"`
|
59
61
|
afile.close
|
60
62
|
|
61
|
-
Dir.chdir(@
|
63
|
+
Dir.chdir(@output_dir)
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specrun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christoper Sean Bailey
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
version:
|
57
57
|
requirements: []
|
58
58
|
|
59
|
-
rubyforge_project:
|
59
|
+
rubyforge_project: SpecRun
|
60
60
|
rubygems_version: 1.3.1
|
61
61
|
signing_key:
|
62
62
|
specification_version: 2
|