ops_team 0.2.8 → 0.2.9

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 +4 -4
  2. data/lib/ops.rb +14 -8
  3. data/ops_team.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ed40f82a2c6312381a243ea6ccbfc12ba46f1742af6a8935a2c59d7fcb783f9
4
- data.tar.gz: 65ec586f9adb40be64e31f5d581845efc8cc303548b4eea8b7d4b5f6620ae8f1
3
+ metadata.gz: e5c2fa7f06155a753554402aa2063aec1bf192aa171a6c2e601619ee6f80e148
4
+ data.tar.gz: ca9c1bcde247a55ad469e423f5bde3a1ba3a85ad51694b519622e6a572304afc
5
5
  SHA512:
6
- metadata.gz: 333c1446f7b2d59f33dda51e29f918d8fe2d54d79f60310d952bbf538dad5ae93c0aa8503fe5af1ed4ba964b336514d21a6d7b6e13948539710bccb259fe2a36
7
- data.tar.gz: dac43c177bb4681f3a66a418175c52bd93af2974793400b8db018385fe7abf5743ad89d1ba0398d0ed3cde39b9d68b56dc1919e664621a2366c77e479ef9e100
6
+ metadata.gz: 7baea51515c766fd4409382b91560dd21948b95470d62fad73a6f23c3b58d92a0a0030d55c95dd7de6dfeb0fed73f6b35f7728419da1ca9962598873440cccf3
7
+ data.tar.gz: c544f035850f131ff02882cf88196f4fc62ab91dc4142ce292cf10531f685415ad349aeaabd52e26f988932eba9fc02888a820502e7efff6fde8478cecfc1941
data/lib/ops.rb CHANGED
@@ -16,7 +16,8 @@ class Ops
16
16
 
17
17
  CONFIG_FILE = "ops.yml"
18
18
 
19
- INVALID_SYNTAX_EXIT_CODE = 1
19
+ INVALID_SYNTAX_EXIT_CODE = 64
20
+ UNKNOWN_ACTION_EXIT_CODE = 65
20
21
 
21
22
  def initialize(argv)
22
23
  @action_name = argv[0]
@@ -28,15 +29,10 @@ class Ops
28
29
  def run
29
30
  exit(INVALID_SYNTAX_EXIT_CODE) unless syntax_valid?
30
31
 
31
- environment.set_variables
32
- app_config.load
33
-
34
- return builtin.run if builtin
35
-
36
- Output.warn("Running '#{action}' from #{CONFIG_FILE}...")
37
- action.run
32
+ run_action
38
33
  rescue UnknownActionError => e
39
34
  Output.error("Error: #{e}")
35
+ exit(UNKNOWN_ACTION_EXIT_CODE)
40
36
  end
41
37
 
42
38
  private
@@ -51,6 +47,16 @@ class Ops
51
47
  end
52
48
  end
53
49
 
50
+ def run_action
51
+ environment.set_variables
52
+ app_config.load
53
+
54
+ return builtin.run if builtin
55
+
56
+ Output.warn("Running '#{action}' from #{CONFIG_FILE}...")
57
+ action.run
58
+ end
59
+
54
60
  def builtin
55
61
  @builtin ||= Builtins.const_get(builtin_class_name, false).new(@args, config)
56
62
  rescue NameError
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '0.2.8'
5
+ s.version = '0.2.9'
6
6
  s.authors = [
7
7
  'nickthecook@gmail.com'
8
8
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_team
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com