Sha256: 3065004ba77385e822573bb093ea1aeabac638f4bac25f0fcf0b071f33a7ba28
Contents?: true
Size: 1.03 KB
Versions: 2
Compression:
Stored size: 1.03 KB
Contents
require "dry/web/roda/generate" require "dry/web/roda/generators/inflections" module Dry module Web module Roda module Generators class SubApp attr_reader :generate def initialize @generate = Dry::Web::Roda::Generate.new("sub_app") end def call(target_dir, options = {}) umbrella_name = options.fetch(:umbrella) generate_to = options.fetch(:to) { File.join("apps", target_dir) } generate.(generate_to, prepare_scope(target_dir, umbrella_name)) end private def prepare_scope(target_dir, umbrella_name) { underscored_app_name: Inflections.underscored_name(target_dir), camel_cased_app_name: Inflections.camel_cased_name(target_dir), underscored_umbrella_name: Inflections.underscored_name(umbrella_name), camel_cased_umbrella_name: Inflections.camel_cased_name(umbrella_name), } end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dry-web-roda-0.6.3 | lib/dry/web/roda/generators/sub_app.rb |
dry-web-roda-0.6.2 | lib/dry/web/roda/generators/sub_app.rb |