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

Improve dependency management and gemspec file for plugins #2295

Merged
merged 3 commits into from Jul 28, 2011
Merged

Improve dependency management and gemspec file for plugins #2295

merged 3 commits into from Jul 28, 2011

Conversation

dgeb
Copy link
Contributor

@dgeb dgeb commented Jul 27, 2011

The current gemspec files generated by "rails plugin new" are not optimal for creating gems. They do not include full meta-information, nor do they include dependencies.

Bundler can now manage dependencies declared in the .gemspec file through the addition of a simple "gemspec" directive in your Gemfile. This allows dependencies to be declared once, and applies to both base and development dependencies. For more information, check out:
http://gembundler.com/rubygems.html
http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/

This pull request includes a refactoring of the Gemfile and .gemspec files generated by "rails plugin new". Dependencies are now managed in the .gemspec file where possible. Comments have been added to both files explaining dependency management choices.

In addition, the .gemspec file has been updated to include more meta-information, such as author and email. Defaults have been added that include "TODO", which prevents gems from being built without review. The version has been extracted into a separate file, to be consistent with bundler and svenfuchs/gem-release.

Hopefully, all of these changes will eliminate the need to run a separate tool such as Bundler or Jeweler to create a gem template which then needs to be merged with the output of "rails plugin new". Merging is a messy, error-prone process that leaves you wishing for a cleaner alternative.


These changes were originally proposed in #2282. I'm following the recommendation to submit these changes to master in the form of several atomic commits.

@spastorino
Copy link
Contributor

so @dgeb can you change the commits and make a push -f to your repo?

@dgeb
Copy link
Contributor Author

dgeb commented Jul 27, 2011

Will do @spastorino - thanks for the code review.

dgeb added 3 commits July 28, 2011 09:46
…s include "TODO" to prevent gems from being built without review.
… consistent with the approach taken by "bundle gem", and is expected by gems such as svenfuchs/gem-release which can be used to bump / tag versions of gems.
@dgeb
Copy link
Contributor Author

dgeb commented Jul 28, 2011

@spastorino - I've updated the commits with all the changes we've discussed.

spastorino added a commit that referenced this pull request Jul 28, 2011
Improve dependency management and gemspec file for plugins
@spastorino spastorino merged commit 5ab9132 into rails:master Jul 28, 2011
spastorino added a commit that referenced this pull request Jul 28, 2011
Improve dependency management and gemspec file for plugins
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.

None yet

2 participants