Class: Liquigen::Scaffold::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/liquigen/scaffold/config.rb

Instance Method Summary collapse

Instance Method Details

#prepare_default_contentObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/liquigen/scaffold/config.rb', line 13

def prepare_default_content
  contents = []
  contents << '# You can remove the # to set your custom value'
  contents << '# package_name=your-package-name, required'
  contents << '# java_codes_root=src/main/java'
  contents << '# migration_path=src/main/resources/db/migrations'
  contents << '# controller_package_name='
  contents << '# entity_package_name='
  contents << '# repository_package_name='
  contents << '# repository_suffix=Repository'
  contents << ''
end

#processObject

write config file



5
6
7
8
9
10
11
# File 'lib/liquigen/scaffold/config.rb', line 5

def process
  # if not exist the .liquigen file create it
  File.write(CONFIG_FILE, prepare_default_content.join("\n")) unless File.exist?(CONFIG_FILE)

  # then open the vim editor
  system('vi ' + CONFIG_FILE)
end