bashcov 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ # gem 'simplecov', path: '../simplecov'
4
+
3
5
  gemspec
data/bin/bashcov CHANGED
@@ -7,7 +7,7 @@ require 'bashcov'
7
7
 
8
8
  Bashcov.parse_options! ARGV
9
9
 
10
- runner = Bashcov::Runner.new Bashcov.options.filename
10
+ runner = Bashcov::Runner.new Bashcov.options.command
11
11
  runner.run
12
12
  coverage = runner.result
13
13
 
@@ -9,9 +9,9 @@ module Bashcov
9
9
  # @return [Array] +stderr+ from the last run
10
10
  attr_reader :stderr
11
11
 
12
- # @param [String] filename Command to run
13
- def initialize filename
14
- @filename = File.expand_path(filename)
12
+ # @param [String] command Command to run
13
+ def initialize command
14
+ @command = File.expand_path(command)
15
15
  end
16
16
 
17
17
  # Runs the command capturing +stdout+ and +stderr+.
@@ -104,7 +104,7 @@ module Bashcov
104
104
  @stdout = []
105
105
  @stderr = []
106
106
 
107
- @command = "PS4='#{Xtrace.ps4}' #{@filename}"
107
+ @command = "PS4='#{Xtrace.ps4}' #{@command}"
108
108
  end
109
109
 
110
110
  def inject_xtrace_flag
@@ -1,4 +1,4 @@
1
1
  module Bashcov
2
2
  # Bashcov version
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
data/lib/bashcov.rb CHANGED
@@ -27,8 +27,16 @@ module Bashcov
27
27
  # @return [void]
28
28
  def parse_options! args
29
29
  OptionParser.new do |opts|
30
- opts.banner = "Usage: #{opts.program_name} [options] <filename>"
30
+ opts.program_name = 'bashcov'
31
31
  opts.version = Bashcov::VERSION
32
+ opts.banner = <<-HELP.gsub!(/^ +/, '').gsub!("\t", ' ' * 4)
33
+ Usage: #{opts.program_name} [options] -- <command> [options]
34
+ Examples:
35
+ \t#{opts.program_name} script.sh
36
+ \t#{opts.program_name} --skip-uncovered script.sh
37
+ \t#{opts.program_name} -- script.sh --some --flags
38
+ \t#{opts.program_name} --skip-uncovered -- script.sh --some --flags
39
+ HELP
32
40
 
33
41
  opts.separator "\nSpecific options:"
34
42
 
@@ -53,10 +61,10 @@ module Bashcov
53
61
 
54
62
  end.parse!(args)
55
63
 
56
- if args.one?
57
- @options.filename = args.shift
64
+ if args.empty?
65
+ abort("You must give exactly one command to execute.")
58
66
  else
59
- abort("You must give exactly one file to execute.")
67
+ @options.command = args.join(' ')
60
68
  end
61
69
  end
62
70
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-08 00:00:00.000000000 Z
12
+ date: 2013-01-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simplecov