chimps 0.1.5 → 0.1.6

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/chimps +1 -1
  3. data/lib/chimps/cli.rb +6 -3
  4. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
data/bin/chimps CHANGED
@@ -2,4 +2,4 @@
2
2
  $:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
3
3
  require "chimps"
4
4
  require 'chimps/cli'
5
- Chimps::CLI.execute!(ARGV.dup) if $0 == __FILE__
5
+ exit Chimps::CLI.execute!(ARGV.dup)
@@ -6,17 +6,20 @@ module Chimps
6
6
 
7
7
  # Execute the Chimps command specified by +argv+.
8
8
  #
9
+ # Will exit the Ruby process with 0 on success or 1 on an error.
10
+ #
9
11
  # @param [Array<String>] argv
10
12
  def self.execute! argv
11
13
  begin
12
- Runner.new(argv).execute!
14
+ Runner.new(argv).execute!
15
+ return 0
13
16
  rescue Chimps::Error => e
14
17
  puts e.message
15
- exit 1
18
+ return 1
16
19
  rescue => e
17
20
  $stderr.puts("#{e.message} (#{e.class})")
18
21
  $stderr.puts(e.backtrace.join("\n"))
19
- exit 1
22
+ return 1
20
23
  end
21
24
  end
22
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chimps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dhruv Bansal