Sha256: 121c5d1f46101dbf3b341dd8a7df6081a273e1eb4f4e534703b6bc3de88afd2a
Contents?: true
Size: 1.19 KB
Versions: 6
Compression:
Stored size: 1.19 KB
Contents
# frozen_string_literal: true module RailsAppGenerator module Cli # Folder Diff class Profile < Thor desc 'xxx [options]', 'Create a new rails app based on a RAG profile' option :profile_path , type: :string option :fallback_profile_path , type: :string # rubocop:disable Metrics/AbcSize def profile(name) path = options[:profile_path] || options[:fallback_profile_path] profile_name = name.end_with?('.json') ? name : "#{name}.json" profile_file = File.join(path, profile_name) unless File.exist?(profile_file) puts "Profile [#{profile_file}] not found" exit 1 end puts "Using profile #{profile_file}" profile = JSON.parse(File.read(profile_file), symbolize_names: true) args = profile[:args] opts = RailsAppGenerator::RailsOptions.new(profile[:opts]) RailsAppGenerator::Util.write_last_run('rails_options_data.json', opts.to_h) starter = RailsAppGenerator::Starter.new(**args) starter.start(opts) if starter.handle_target_folder_found? end # rubocop:enable Metrics/AbcSize end end end
Version data entries
6 entries across 6 versions & 1 rubygems