travis-ci
1706 of 1706 new or added lines in 47 files covered. (100.0%)
1629 of 1708 relevant lines covered (95.37%)
509.91 hits per line
|
require 'gem/release/context'
|
2✔ |
2 |
|
|
|
module Gem |
2✔ |
|
module Release |
2✔ |
|
module Cmds |
2✔ |
|
class Runner < Struct.new(:context, :name, :args, :opts) |
2✔ |
|
def run |
2✔ |
|
run_cmd |
628✔ |
|
success |
628✔ |
10 |
end
|
|
11 |
|
|
|
private |
2✔ |
13 |
|
|
|
def run_cmd |
2✔ |
|
const.new(context.class.new, args, opts).run |
628✔ |
16 |
end
|
|
17 |
|
|
|
def const |
2✔ |
|
Base[name]
|
628✔ |
20 |
end
|
|
21 |
|
|
|
def opts |
2✔ |
|
except(super, :args, :build_args) |
× |
24 |
end
|
|
25 |
|
|
|
def args |
2✔ |
|
super.select { |arg| arg.is_a?(String) && arg[0] != '-' } |
1,008✔ |
28 |
end
|
|
29 |
|
|
|
def success |
2✔ |
|
context.announce "All is good, thanks my friend." unless quiet? |
628✔ |
32 |
end
|
|
33 |
|
|
|
def quiet? |
2✔ |
|
opts[:quiet] || opts[:silent] |
628✔ |
36 |
end
|
|
37 |
|
|
|
def opts |
2✔ |
|
@opts ||= config.merge(super) |
1,810✔ |
40 |
end
|
|
41 |
|
|
|
def config |
2✔ |
|
context.config.for(name.to_sym) |
628✔ |
44 |
end
|
|
45 |
|
|
|
def except(hash, *keys) |
2✔ |
|
hash.reject { |key, _| keys.include?(key) } |
× |
48 |
end
|
|
49 |
end
|
|
50 |
end
|
|
51 |
end
|
|
52 |
end
|