Sha256: 91c240d8bac46765a17785c7042d4ff1b258c7b4bdb3897beba3fee6668a893b

Contents?: true

Size: 1020 Bytes

Versions: 8

Compression:

Stored size: 1020 Bytes

Contents

require "securerandom"
require "dry/web/roda/generators/abstract_project"

module Dry
  module Web
    module Roda
      module Generators
        class FlatProject < AbstractProject
          def populate_templates
            super
            add_views
            add_web
          end

          private

          def add_boot
            add_template("flat_project/boot.rb.tt", "system/boot.rb")
          end

          def add_application
            add_template("flat_project/web.rb.tt", "system/#{underscored_project_name}/web.rb")
          end

          def add_views
            add_template('welcome.rb.tt', "lib/#{underscored_project_name}/views/welcome.rb")
          end

          def add_web
            add_template('example_routes.rb.tt', 'web/routes/example.rb')
            add_template('application.html.slim', 'web/templates/layouts/application.html.slim')
            add_template('welcome.html.slim', 'web/templates/welcome.html.slim')
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dry-web-roda-0.14.0 lib/dry/web/roda/generators/flat_project.rb
dry-web-roda-0.13.1 lib/dry/web/roda/generators/flat_project.rb
dry-web-roda-0.13.0 lib/dry/web/roda/generators/flat_project.rb
dry-web-roda-0.12.0 lib/dry/web/roda/generators/flat_project.rb
dry-web-roda-0.11.0 lib/dry/web/roda/generators/flat_project.rb
dry-web-roda-0.10.0 lib/dry/web/roda/generators/flat_project.rb
dry-web-roda-0.9.1 lib/dry/web/roda/generators/flat_project.rb
dry-web-roda-0.9.0 lib/dry/web/roda/generators/flat_project.rb