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

Generator #3

Merged
merged 6 commits into from
Apr 17, 2017
Merged

Generator #3

merged 6 commits into from
Apr 17, 2017

Conversation

jduss4
Copy link
Contributor

@jduss4 jduss4 commented Mar 27, 2017

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!

Copy link
Member

@techgique techgique left a 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
Copy link
Member

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

Copy link
Contributor Author

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

# 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"
Copy link
Member

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

Copy link
Contributor Author

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 :)
@techgique techgique merged commit 3e7ccb9 into master Apr 17, 2017
@techgique techgique deleted the generator branch April 17, 2017 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants