Class: BPM::InitGenerator

Inherits:
Generator show all
Defined in:
lib/bpm/init_generator.rb

Instance Attribute Summary

Attributes inherited from Generator

#name, #package

Instance Method Summary collapse

Methods inherited from Generator

#dir_name, #initialize, #say, #shell, #source_paths

Constructor Details

This class inherits a constructor from BPM::Generator

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BPM::Generator

Instance Method Details

#bpm_versionObject



8
9
10
# File 'lib/bpm/init_generator.rb', line 8

def bpm_version
  BPM::COMPAT_VERSION
end

#runObject



12
13
14
15
16
17
18
19
20
# File 'lib/bpm/init_generator.rb', line 12

def run
  if File.exist?("package.json")
    convert_package(destination_root)
  else
    template "project.json", "#{name}.json"
  end

  true
end