c66-copper 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bin/copper +18 -1
- data/lib/copper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 335454493592ae7ab9c3a2091e34f9fca4b70db49e03a3902c3dfa4a4894d55f
|
4
|
+
data.tar.gz: 78fbbc6ec9ac92a815f544bf1090c30d9ea2486b9bb203d08f18b0ed0b8456fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77824a1832b760f2afc99970b7081a6861bdc768cb3fa2345b31c0a8f8e645374f677ad7b03b544e3397d4d49f04697defada22a5527f187f7764d844c04279c
|
7
|
+
data.tar.gz: 5c366879ee2b7f14ce9530e6e9aa00d8a5c11fa1b4d2a74b55e4940145b8425fda72b6289d00e31a08c06ad51b0c2f827296b43b1154e3afdfbb8e58d05320ad
|
data/bin/copper
CHANGED
@@ -36,23 +36,40 @@ module Copper
|
|
36
36
|
require 'byebug' if $debug
|
37
37
|
|
38
38
|
rule_file = options[:rules]
|
39
|
+
if !rule_file
|
40
|
+
puts "No rule file provided. Use --rule option".red
|
41
|
+
exit(1)
|
42
|
+
end
|
43
|
+
|
39
44
|
unless File.exists?(rule_file)
|
40
45
|
puts "Rule file #{rule_file} not found".red
|
41
46
|
exit(1)
|
42
47
|
end
|
43
48
|
content_file = options[:file]
|
49
|
+
if !content_file
|
50
|
+
puts "No config file provided. Use --file option".red
|
51
|
+
exit(1)
|
52
|
+
end
|
53
|
+
|
44
54
|
unless File.exists?(content_file)
|
45
55
|
puts "Config file #{content_file} not found".red
|
46
56
|
exit(1)
|
47
57
|
end
|
48
58
|
|
49
59
|
rules = File.read(rule_file)
|
50
|
-
|
60
|
+
if rules.empty?
|
61
|
+
puts "Empty rules file".red
|
62
|
+
exit(2)
|
63
|
+
end
|
51
64
|
raise ::NotImplementedError if options[:format] != 'yaml'
|
52
65
|
# load the yaml file and split them into separate yamls
|
53
66
|
|
54
67
|
failed = false
|
55
68
|
content = File.read(content_file)
|
69
|
+
if content.empty?
|
70
|
+
puts "Empty config file".red
|
71
|
+
exit(2)
|
72
|
+
end
|
56
73
|
content.split('---').each_with_index do |part, idx|
|
57
74
|
puts "Validating part #{idx}"
|
58
75
|
file = YAML::load(part)
|
data/lib/copper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c66-copper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Khash Sajadi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
246
|
version: '0'
|
247
247
|
requirements: []
|
248
248
|
rubyforge_project:
|
249
|
-
rubygems_version: 2.
|
249
|
+
rubygems_version: 2.7.7
|
250
250
|
signing_key:
|
251
251
|
specification_version: 4
|
252
252
|
summary: Copper gem and command line
|