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.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/bin/copper +18 -1
  3. data/lib/copper/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 65f506e3fc4f1c522e8080ae8c7a6f43384df051
4
- data.tar.gz: fff0d3cd331cafe65d047d49f41c2e07f7916039
2
+ SHA256:
3
+ metadata.gz: 335454493592ae7ab9c3a2091e34f9fca4b70db49e03a3902c3dfa4a4894d55f
4
+ data.tar.gz: 78fbbc6ec9ac92a815f544bf1090c30d9ea2486b9bb203d08f18b0ed0b8456fa
5
5
  SHA512:
6
- metadata.gz: 26ea8d3b0f10cbc98bb2f95ed5c2d657f1c57c14aa048d86785809d9636f5b3ced25dd10279f63fdf6212ea1447b4fa2d2e3550a066cc11f00a48d8479703cbf
7
- data.tar.gz: 50f62f4e5f943481ededcd3bac12d63ffd5a1c9780645f0bb191512407d01af80a2832053daa60a495cb40b561a186a1fce059637a28db098991d7e6e64e6db9
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
- file = ""
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)
@@ -1,5 +1,5 @@
1
1
  module Copper
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  COPYRIGHT_MESSAGE = "(c) 2018 Cloud66 Inc."
4
4
  APP_NAME = 'Copper'
5
5
  end
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
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-04-05 00:00:00.000000000 Z
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.6.13
249
+ rubygems_version: 2.7.7
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: Copper gem and command line