class Fronde::CLI
Public Class Methods
new(opts = {})
click to toggle source
# File lib/fronde/cli.rb, line 9 def initialize(opts = {}) @options = { verbose: false }.merge(opts) init_required_files init_rake end
Private Instance Methods
init_gitignore()
click to toggle source
# File lib/fronde/cli.rb, line 49 def init_gitignore gitignore = <<~GITIGNORE .dir-locals.el Rakefile lib public_html var GITIGNORE IO.write '.gitignore', gitignore end
init_rake()
click to toggle source
# File lib/fronde/cli.rb, line 24 def init_rake @rake = Rake.application Rake.verbose(false) unless @options[:verbose] @rake.raw_load_rakefile end
init_rakefile()
click to toggle source
# File lib/fronde/cli.rb, line 30 def init_rakefile rakefile = <<~RAKE # frozen_string_literal: true require 'fronde/config' require 'r18n-core' fronde_spec = Gem::Specification.find_by_name 'fronde' R18n.default_places = "\#{fronde_spec.gem_dir}/locales" R18n.set(Fronde::Config.settings['lang'] || 'en') R18n::Filters.on(:named_variables) Dir.glob("\#{fronde_spec.gem_dir}/lib/tasks/*.rake").each { |r| import r } task default: 'site:build' RAKE IO.write 'Rakefile', rakefile end
init_required_files()
click to toggle source
# File lib/fronde/cli.rb, line 19 def init_required_files init_rakefile unless File.exist?('Rakefile') init_gitignore unless File.exist?('.gitignore') end