class Guard::Interactor
def extract_scopes_and_action(line)
-
(Array)
- the group or guard scope and the action
Parameters:
-
line
(String
) -- the readline input
Other tags:
- Example: `jasmine` will only run all jasmine specs -
Example: `spork reload` will only reload rspec -
def extract_scopes_and_action(line) scopes = { } entries = line.split(' ') case entries.length when 1 unless action = action_from_entry(entries[0]) scopes = scopes_from_entry(entries[0]) end when 2 scopes = scopes_from_entry(entries[0]) action = action_from_entry(entries[1]) end action = :run_all if !action && (!scopes.empty? || entries.empty?) [scopes, action] end