-
Notifications
You must be signed in to change notification settings - Fork 423
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
Remove dummy app from spec folder and instead create rake task which wil... #149
Conversation
…will generate dummy app when needed.
README needs updating... also blah blah something about refinery, amirite @pardnt |
@knewter nice spelling ;) What do we need about Refinery? |
I was mocking me-on-other-ticket getting confused about which project I was talking about :) whoosh |
I found one problem with this pull request. If I create a new rails app and add this to the Gemfile: gem 'forem', :git => 'https://github.com/ugisozols/forem.git', :branch => 'dummy_app' When I run
|
I'm sorry but what's the problem? |
It adds an extra generator, |
I made a pull request to your branch , @ugisozols, with changes to hide |
move dummy app generators from lib to spec/lib so "rails g -h"doesn't show them
👍 @benatkin. I agree with you that dummy_app rake task should be only available when developing forem. Thanks! |
So you guys reckon this is cool to merge then? |
Specs pass - what's cooler than that? :) |
ICE COLD. |
Remove dummy app from spec folder and instead create rake task which wil...
How do I regenerate the dummy app for development purposes? |
|
yeah sorry, just saw the updated readme |
Should spec/dummy/ be added to the .gitignore file? |
Yes. |
Ok, sorry I must not have been looking at the correct branch - my .gitignore didn't have it and git was prompting me to readd the dummy files. I see that it was added in the initial commit. |
I was looking for something like this and came up with a different solution, thought you might be interested to check it: require 'rails/generators'
require 'rails/generators/rails/plugin_new/plugin_new_generator'
module MyEngine
class DummyGenerator < Rails::Generators::PluginNewGenerator
def self.default_source_root
Rails::Generators::PluginNewGenerator.default_source_root
end
def do_nothing
end
alias :create_root :do_nothing
alias :create_root_files :do_nothing
alias :create_app_files :do_nothing
alias :create_config_files :do_nothing
alias :create_lib_files :do_nothing
alias :create_public_stylesheets_files :do_nothing
alias :create_javascript_files :do_nothing
alias :create_script_files :do_nothing
alias :update_gemfile :do_nothing
alias :create_test_files :do_nothing
alias :finish_template :do_nothing
end
end Where in Rakefile I just call the generator: task :setup do
require 'rails'
require 'myengine'
require 'myengine/generators/dummy_generator'
MyEngine::DummyGenerator.start(
%w(. --quiet --force --skip-bundle --old-style-hash --dummy-path=spec/dummy)
)
end Thanks |
I've been looking at using the |
Thanks for |
...l generate dummy app when needed.
Hello gentlemen!
I noticed #141 and decided to do something about it. I basically copy/pasted the code which is in Refinery CMS with some tweaks for the specs to pass.
Please review it and let me know if there's anything else needed.