clash 1.5.0 → 1.5.1
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/lib/clash/helpers.rb +0 -6
- data/lib/clash/test.rb +21 -9
- data/lib/clash/tests.rb +4 -2
- 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: 5ad6ce60bb860188e99c74a0ee961fd7d878b44a
|
4
|
+
data.tar.gz: b865f8229a54faf93bf24c269c998ca54f1638d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f751c8e84d26366758b3c481b8519b736dd794ed5ebca0bb1a31c8177dac1122fc50591ece110a10ec142bd2b78514f6d387207588833bb26fb9a2bbf726e093
|
7
|
+
data.tar.gz: a5e2c48a11643a84a3f08ec0fd3b9223928c184a2f512f90a5eab51b68b603783de59eec343167d3b46b7507d47ca4d10d2e6c486316e683b4b4debd3e3c0550
|
data/lib/clash/helpers.rb
CHANGED
data/lib/clash/test.rb
CHANGED
@@ -46,12 +46,24 @@ module Clash
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
50
|
-
copy_config(file,
|
49
|
+
def config_plugin(name, file)
|
50
|
+
copy_config(file, "#{plugins_path}/#{name}/config.yml")
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
|
53
|
+
def plugins_path
|
54
|
+
jekyll_site.plugin_manager.plugins_path.first
|
55
|
+
end
|
56
|
+
|
57
|
+
def jekyll_site
|
58
|
+
require 'jekyll'
|
59
|
+
config = {}
|
60
|
+
Array(@options['config']['jekyll'] || '_config.yml').each do |c|
|
61
|
+
config.merge!SafeYAML.load_file(c)
|
62
|
+
end
|
63
|
+
Jekyll.logger.log_level = :error
|
64
|
+
site = Jekyll::Site.new(Jekyll.configuration(config))
|
65
|
+
Jekyll.logger.log_level = :info
|
66
|
+
site
|
55
67
|
end
|
56
68
|
|
57
69
|
def copy_config(file, target)
|
@@ -75,15 +87,15 @@ module Clash
|
|
75
87
|
def build
|
76
88
|
options = "--trace"
|
77
89
|
|
78
|
-
if
|
79
|
-
options << " --config #{
|
90
|
+
if config = @options['config']['jekyll']
|
91
|
+
options << " --config #{Array(config).join(',')}"
|
80
92
|
end
|
81
93
|
|
82
94
|
system "jekyll build #{options}"
|
83
95
|
end
|
84
96
|
|
85
97
|
def system_cmd(cmds)
|
86
|
-
cmds =
|
98
|
+
cmds = Array(cmds)
|
87
99
|
cmds.each {|cmd|
|
88
100
|
if @options['tasks'].include?(cmd)
|
89
101
|
system_cmd(@options['tasks'][cmd])
|
@@ -94,7 +106,7 @@ module Clash
|
|
94
106
|
end
|
95
107
|
|
96
108
|
def compare
|
97
|
-
|
109
|
+
Array(@options['compare']).each do |files|
|
98
110
|
f = files.gsub(',',' ').split
|
99
111
|
|
100
112
|
differ = Diff.new(f.first, f.last, context: @options['context'])
|
@@ -109,7 +121,7 @@ module Clash
|
|
109
121
|
end
|
110
122
|
|
111
123
|
def enforce_missing
|
112
|
-
|
124
|
+
Array(@options['enforce_missing']).each do |file|
|
113
125
|
if File.exists?(file)
|
114
126
|
message = yellowit("\nFile #{file} shouldn't exist.") + "\n But it does!"
|
115
127
|
@test_failures << message
|
data/lib/clash/tests.rb
CHANGED
@@ -77,7 +77,7 @@ module Clash
|
|
77
77
|
delete_tests = []
|
78
78
|
@options[:only] = expand_list_of_numbers(@options[:only])
|
79
79
|
|
80
|
-
tests =
|
80
|
+
tests = @clashfile.map do |test|
|
81
81
|
if !test['tasks'].nil?
|
82
82
|
@tasks.merge! test['tasks']
|
83
83
|
delete_tests << test
|
@@ -104,7 +104,9 @@ module Clash
|
|
104
104
|
# Find the config file (fall back to legacy filename)
|
105
105
|
if path = config_path || config_path('.clash.yml')
|
106
106
|
read_test_line_numbers(path)
|
107
|
-
SafeYAML.load_file(path)
|
107
|
+
config = SafeYAML.load_file(path)
|
108
|
+
config = [config] unless config.is_a?(Array)
|
109
|
+
config
|
108
110
|
else
|
109
111
|
# If config file still not found, complain
|
110
112
|
raise "Config file #{@options[:file]} not found."
|
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.5.
|
4
|
+
version: 1.5.1
|
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-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diffy
|