Class: DiceBag::CommonTemplatesBag

Inherits:
AvailableTemplates show all
Defined in:
lib/dice_bag/templates/gems_checker.rb

Instance Method Summary collapse

Methods inherited from AvailableTemplates

all, checker_within_given_gems?, gem_specs, inherited, template_checkers, template_filename_for, #templates_location

Instance Method Details

#add_template(file) ⇒ Object



33
34
35
36
# File 'lib/dice_bag/templates/gems_checker.rb', line 33

def add_template(file)
  pwd = File.dirname(__FILE__)
  @needed_templates.push(File.join(pwd, file))
end

#templatesObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/dice_bag/templates/gems_checker.rb', line 10

def templates
  @needed_templates = []
  configured = Configuration.new

  if defined?(Dalli)
    add_template('dalli.yml.dice')
  end

  if defined?(Mysql2)
    add_template('database.yml.dice')
  end

  if defined?(AWS)
    add_template('aws.yml.dice')
  end

  if configured.google_analytics_id
    add_template('google_analytics.yml.dice')
  end

  @needed_templates
end