30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/super/test_support/generate_dummy.rb', line 30
def create_new_plugin
if plugin_name.blank?
warn "Not currently in a plugin directory"
exit
end
opts = {
force: true,
skip_active_storage: true,
skip_action_mailer: true,
skip_action_mailbox: true,
skip_action_text: true,
skip_active_storage: true,
skip_action_cable: true,
skip_puma: true,
skip_coffee: true,
database: "sqlite3",
}
Dir.mktmpdir do |dir|
plugin_path = File.join(dir, plugin_name)
generated_dummy_path = File.join(plugin_path, "test/dummy")
invoke(Rails::Generators::PluginGenerator, [plugin_path], opts)
inside(generated_dummy_path) do
remove_file(".ruby-version")
end
FileUtils.rm_rf(dummy_path)
FileUtils.mv(generated_dummy_path, dummy_path)
end
end
|