clash 1.5.3 → 1.6.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.
- checksums.yaml +4 -4
- data/bin/clash +13 -6
- data/lib/clash/test.rb +16 -0
- data/lib/clash/tests.rb +11 -0
- data/lib/clash/version.rb +1 -1
- 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: bbd8c69715a8be680b9f09acf86c39d453e95df2
|
4
|
+
data.tar.gz: 7b7a380ce953f8091a2f352a0fecc9a7791e1f33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ef84eb9c67e119da577c70f018890bbc8c3054cd280d69959a5321cb49b7983c299eb56e54429742f806e4d3241424f6fe61071e26a95c98b689420b032837f
|
7
|
+
data.tar.gz: 26ee2c56dc6a694b877f8759f8bac5a3140038df43aa53f5e215dc128abedc898829d66c2fe5699d71dc6a930c9727f05e6015a53cadf1ea4c1109563c2e8899
|
data/bin/clash
CHANGED
@@ -53,25 +53,30 @@ OptionParser.new do |opts|
|
|
53
53
|
options[:force] = f
|
54
54
|
end
|
55
55
|
else
|
56
|
-
opts.on("-
|
57
|
-
options[:
|
56
|
+
opts.on("-a", "--accept", "Accept failure: Copy test(s) build to expected path.") do |a|
|
57
|
+
options[:accept] = a
|
58
58
|
end
|
59
59
|
|
60
|
-
opts.on("-
|
61
|
-
options[:
|
60
|
+
opts.on("-b", "--build", "Build mode: Runs only 'before' and 'build' actions.") do |b|
|
61
|
+
options[:build_only] = b
|
62
62
|
end
|
63
63
|
|
64
64
|
opts.on("-c", "--context NUMBER", Integer, "On diff errors, show NUMBER of lines of surrounding context (default: 2)") do |context|
|
65
65
|
options[:context] = context
|
66
66
|
end
|
67
67
|
|
68
|
+
opts.on("-d", "--debug", "Display output from system commands") do |d|
|
69
|
+
options[:debug] = d
|
70
|
+
end
|
71
|
+
|
68
72
|
opts.on("-l", "--list", "Print a list of tests' numbers and titles") do |l|
|
69
73
|
options[:list] = l
|
70
74
|
end
|
71
75
|
|
72
|
-
opts.on("-
|
73
|
-
options[:
|
76
|
+
opts.on("-f FILE", "--file FILE", "Use a specific test file (default: [PATH]/.clash.yml)") do |f|
|
77
|
+
options[:file] = f
|
74
78
|
end
|
79
|
+
|
75
80
|
end
|
76
81
|
|
77
82
|
opts.on("-h", "--help", "Show this message") do |h|
|
@@ -97,6 +102,8 @@ elsif !options[:help]
|
|
97
102
|
|
98
103
|
if options[:list]
|
99
104
|
tests.list
|
105
|
+
elsif options[:accept]
|
106
|
+
tests.accept
|
100
107
|
else
|
101
108
|
tests.run
|
102
109
|
end
|
data/lib/clash/test.rb
CHANGED
@@ -112,6 +112,22 @@ module Clash
|
|
112
112
|
}
|
113
113
|
end
|
114
114
|
|
115
|
+
def accept
|
116
|
+
Dir.chdir(@options['dir']) do
|
117
|
+
Array(@options['compare']).each do |files|
|
118
|
+
f = files.gsub(',',' ').split
|
119
|
+
|
120
|
+
if File.directory?(f.first)
|
121
|
+
FileUtils.cp_r(File.join(f.first, '.'), f.last)
|
122
|
+
else
|
123
|
+
FileUtils.cp f.first, f.last
|
124
|
+
end
|
125
|
+
|
126
|
+
puts "Copied #{f.first} to #{f.last}"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
115
131
|
def compare
|
116
132
|
Array(@options['compare']).each do |files|
|
117
133
|
f = files.gsub(',',' ').split
|
data/lib/clash/tests.rb
CHANGED
@@ -55,6 +55,17 @@ module Clash
|
|
55
55
|
print_results
|
56
56
|
end
|
57
57
|
|
58
|
+
def accept
|
59
|
+
Dir.chdir(@options[:path]) do
|
60
|
+
@tests.each_with_index do |options, index|
|
61
|
+
# If tests are limited, only run specified tests
|
62
|
+
#
|
63
|
+
next if options.nil?
|
64
|
+
Test.new(options).accept
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
58
69
|
def run_test(options, index)
|
59
70
|
|
60
71
|
options['index'] = index + 1
|
data/lib/clash/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diffy
|