Class: MultiRepo::RepoSelection

Inherits:
Object
  • Object
show all
Defined in:
lib/multirepo/logic/repo-selection.rb

Constant Summary collapse

ALL =
0
MAIN =
1
DEPS =
2

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ RepoSelection

Returns a new instance of RepoSelection.



9
10
11
12
13
# File 'lib/multirepo/logic/repo-selection.rb', line 9

def initialize(argv)
  @main = argv.flag?("main")
  @deps = argv.flag?("deps")
  @all = argv.flag?("all")
end

Instance Method Details

#valid?Boolean

Returns:



15
16
17
# File 'lib/multirepo/logic/repo-selection.rb', line 15

def valid?
  Utils.only_one_true?(@main, @deps, @all)
end

#valueObject



19
20
21
22
23
# File 'lib/multirepo/logic/repo-selection.rb', line 19

def value
  return MAIN if @main
  return DEPS if @deps
  return ALL # Default if unspecified
end