-
Notifications
You must be signed in to change notification settings - Fork 0
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
Generator #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments for discussion : )
# config file | ||
# does not overwrite existing config file | ||
if File.exist?("#{@app_dir}/config/config.yml") | ||
return "Verify that your config/config.yml file matches the options in config/config.example.yml".cyan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use compare_file
to check if the files are identical for users to avoid prompting them unnecessarily?
Also, just curious if there is a reason some of these test for file existence and others test for non-existence. If not, I suppose we might want to be consistent which way we test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that they won't be identical, because they should be customizing the config file to have their server, so it won't match the config file being copied in from here. It will only copy if there isn't a file there. I'll go through and make sure that exist vs non-exist is standardized
lib/generators/setup_generator.rb
Outdated
# remove the previous gem from Gemfile | ||
gsub_file "#{@app_dir}/Gemfile", /^(?!#\s)gem\s["']api_bridge["'].*$/, "" | ||
# install the correct version of the gem | ||
gem "api_bridge", git: "https://github.com/CDRH/api_bridge", version: "0.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we can move the version number here to a config file for what the generator outputs? If not, we'll want to document the version numbers etc like this we'll be updating regularly as things evolve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to, yes. I'm guessing that it could be somewhat similar to the config.rb
style setup of a normal rails app? Maybe I'll work on that over lunch. This is how Blacklight does it, though I don't know how much I care for it:
https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight/version.rb
not sure this is where we will actually want it to live? also tweaks some of the logic so it is the same for each method moves the messages outputting to AFTER bundle install :)
Quickly prepares a new rails app for use with orchid!
There's more that we can do here, like copying in directory structures, helper file templates, etc, but I think this is all we need to get started!