class FoxPage::Generator

Public Class Methods

source_root() click to toggle source
# File lib/fox_page/generator.rb, line 11
def self.source_root
  File.join(__dir__, "app_template")
end

Public Instance Methods

create_application() click to toggle source
# File lib/fox_page/generator.rb, line 15
def create_application
  Dir[File.join(self.class.source_root, "**/*.tt")]
    .map { |path| path.sub(self.class.source_root + "/", "") }
    .each do |path|
    template(path,
             File.join(name,
                       path.sub(/\.tt$/, "")
                           .gsub(/__dot__/, ".")))
  end
end
init_git_repo() click to toggle source
# File lib/fox_page/generator.rb, line 33
def init_git_repo
  Dir.chdir(name) do
    system("git init")
    system("git add .")
  end
end
run_bundle() click to toggle source
# File lib/fox_page/generator.rb, line 26
def run_bundle
  Dir.chdir(name) do
    system("bundle install")
    system("bundle binstubs foxpage")
  end
end