Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "path" argument to Sequel::Generators::Base.source_root #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add a "path" argument to Sequel::Generators::Base.source_root #131

wants to merge 1 commit into from

Conversation

akxcv
Copy link

@akxcv akxcv commented Mar 3, 2017

Sequel::Generators::Base.source_root method does not take a path argument, which diverges from Rails::Generators::Base API. The path argument is very useful for creating custom generators with templates, for example:

# lib/generators/foo/install/install_generator.rb
class Foo::Generators::InstallGenerator < ::Sequel::Generators::Base
  include Sequel::Generators::Migration
  source_root File.expand_path('../templates', __FILE__) # will not work, but would work with Rails
  # ...
end

# templates are stored in lib/generators/foo/install/templates

This behaviour can be observed since Rails 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant