Class: FWToolkit::Bitrise

Inherits:
Thor
  • Object
show all
Includes:
ThorUtils, Thor::Actions
Defined in:
lib/fwtoolkit/cli/bitrise.rb

Instance Method Summary collapse

Methods included from ThorUtils

included

Methods included from Thor::Actions

#run, #run!, #run_base, #template_directory

Instance Method Details

#generate(project_name, class_prefix) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/fwtoolkit/cli/bitrise.rb', line 16

def generate(project_name, class_prefix)
  destination_root = Dir.pwd

  say "Creating bitrise.yml file in: #{File.expand_path destination_root}/bitrise.yml"

  invoke FWToolkit::Bitrise, 'new', [destination_root, project_name, class_prefix.upcase]
end

#new(project_root, project_name, class_prefix) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fwtoolkit/cli/bitrise.rb', line 25

def new(project_root, project_name, class_prefix)
  destination_root = project_root
  bitrise_file = File.join(project_root, 'bitrise.yml')

  Projectfile.load_with_config! :project_name => project_name, :class_prefix => class_prefix.upcase

  template_config = { :target_platform => Config.target_platform,
      :organization_name => Config.organization_name,
      :project_creator => Config.developer_name } 
  template_config.merge! Projectfile.config 

  template_directory "templates/bitrise", destination_root, template_config
end