push
travis-ci
67 of 67 new or added lines in 7 files covered. (100.0%)
6385 of 7395 relevant lines covered (86.34%)
9.1 hits per line
1 |
require "pry"
|
5✔ |
2 |
require "guard/interactor"
|
5✔ |
3 |
require "guard"
|
5✔ |
4 |
|
|
5 |
module Guard |
5✔ |
6 |
module Commands |
5✔ |
7 |
class Scope |
5✔ |
8 |
def self.import |
5✔ |
9 |
Pry::Commands.create_command "scope" do |
4 only 1.9.3 ✔ |
10 |
group "Guard"
|
4 only 1.9.3 ✔ |
11 |
description "Scope Guard actions to groups and plugins."
|
4 only 1.9.3 ✔ |
12 |
|
|
13 |
banner <<-BANNER |
× |
14 |
Usage: scope <scope> |
|
15 |
|
|
16 |
Set the global Guard scope.
|
|
17 |
BANNER |
4 only 1.9.3 ✔ |
18 |
|
|
19 |
def process(*entries) |
4 only 1.9.3 ✔ |
20 |
scope, unknown = Guard.state.session.convert_scope(entries)
|
4 only 1.9.3 ✔ |
21 |
|
|
22 |
unless unknown.empty?
|
4 only 1.9.3 ✔ |
23 |
output.puts "Unknown scopes: #{unknown.join(",") }"
|
1 only 1.9.3 ✔ |
24 |
return
|
1 only 1.9.3 ✔ |
25 |
end
|
|
26 |
|
|
27 |
if scope[:plugins].empty? && scope[:groups].empty? |
3 only 1.9.3 ✔ |
28 |
output.puts "Usage: scope <scope>"
|
1 only 1.9.3 ✔ |
29 |
return
|
1 only 1.9.3 ✔ |
30 |
end
|
|
31 |
|
|
32 |
Guard.state.scope.from_interactor(scope)
|
2 only 1.9.3 ✔ |
33 |
end
|
|
34 |
end
|
|
35 |
end
|
|
36 |
end
|
|
37 |
end
|
|
38 |
end
|