Skip to content

Commit

Permalink
Update application template, finally split toys into gems
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWayfer committed Aug 2, 2020
1 parent 9752e8a commit 042bf1d
Show file tree
Hide file tree
Showing 119 changed files with 2,282 additions and 1,888 deletions.
13 changes: 9 additions & 4 deletions lib/flame/cli/new/app.rb
Expand Up @@ -12,8 +12,9 @@ class App < Clamp::Command
def execute
@app_name = app_name
@module_name = @app_name.camelize
@short_module_name = @module_name
.split(/([[:upper:]][[:lower:]]*)/).map! { |s| s[0] }.join
@short_module_name =
@module_name.split(/([[:upper:]][[:lower:]]*)/).map! { |s| s[0] }.join
@domain_name = @module_name.downcase

make_dir do
copy_template
Expand Down Expand Up @@ -46,7 +47,7 @@ def clean_dirs

def render_templates
puts 'Replace module names in template...'
Dir.glob('**/*.erb', File::FNM_DOTMATCH).each do |file|
Dir.glob('**/*.erb', File::FNM_DOTMATCH).sort.each do |file|
file_pathname = Pathname.new(file)
basename_pathname = file_pathname.sub_ext('')
puts "- #{basename_pathname}"
Expand All @@ -56,9 +57,13 @@ def render_templates
end
end

PERMISSIONS = {}.freeze

def grant_permissions
return unless PERMISSIONS.any?

puts 'Grant permissions to files...'
File.chmod 0o744, 'server'
PERMISSIONS.each { |file, permissions| File.chmod permissions, file }
end
end
end
Expand Down

0 comments on commit 042bf1d

Please sign in to comment.