clash 1.5.3 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2984372de49be5ee46018005fb47973860b4caa4
4
- data.tar.gz: 7f2f3d83ee0ce323f64499ada19acdb580cfc4cc
3
+ metadata.gz: bbd8c69715a8be680b9f09acf86c39d453e95df2
4
+ data.tar.gz: 7b7a380ce953f8091a2f352a0fecc9a7791e1f33
5
5
  SHA512:
6
- metadata.gz: 1bebb2af30278ed73e90aaa7cce5a8c3c6137f51c53adfc890d4ac7a1c7581d37134b6acada5d66c333a16310e8a00c0aa5c2a1d1285a1814747bc98e944d842
7
- data.tar.gz: 28fc84279d44e1bfcf4edd7fab8e7a1f1f90afd0b60bf027a65037c998a5795fe3532659537f5ce3aeeb58c13c3b5e73d2386641daaa6f37678bcb07b5d50cc1
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("-b", "--build", "Build mode: Runs only 'before' and 'build' actions.") do |b|
57
- options[:build_only] = b
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("-f FILE", "--file FILE", "Use a specific test file (default: [PATH]/.clash.yml)") do |f|
61
- options[:file] = f
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("-d", "--debug", "Display output from system commands") do |d|
73
- options[:debug] = d
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
@@ -1,3 +1,3 @@
1
1
  module Clash
2
- VERSION = "1.5.3"
2
+ VERSION = "1.6.0"
3
3
  end
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.5.3
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-03-31 00:00:00.000000000 Z
11
+ date: 2015-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diffy