Class: InfinumSetup::Base
- Inherits:
-
Object
- Object
- InfinumSetup::Base
show all
- Defined in:
- lib/infinum_setup/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
3
4
5
|
# File 'lib/infinum_setup/base.rb', line 3
def initialize(options = {})
@options = options
end
|
Class Method Details
.install(options) ⇒ Object
7
8
9
|
# File 'lib/infinum_setup/base.rb', line 7
def self.install(options)
new(options).call
end
|
Instance Method Details
#call ⇒ Object
11
12
13
14
|
# File 'lib/infinum_setup/base.rb', line 11
def call
return unless team_programs.is_a?(Hash)
programs.map(&:install)
end
|
#programs ⇒ Object
16
17
18
19
20
|
# File 'lib/infinum_setup/base.rb', line 16
def programs
@programs ||= team_programs.map do |name, settings|
program_type(settings['type'], name).new(name, settings, options)
end
end
|
#team_programs(team = 'general') ⇒ Object
22
23
24
25
26
27
28
29
30
|
# File 'lib/infinum_setup/base.rb', line 22
def team_programs(team = 'general')
if InfinumSetup.dev?
YAML.load_file("programs/#{team}.yml")
else
YAML.load(
open("https://raw.github.com/infinum/infinum_setup/master/programs/#{team}.yml")
)
end
end
|