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

Default bin scripts from bundle gem command: bin/console and bin/setup #315

Merged
merged 1 commit into from Oct 23, 2015

Conversation

pboling
Copy link
Contributor

@pboling pboling commented Oct 18, 2015

  • bin/console
  • bin/setup

A comparison between the current irb use case, and the new bin/console use case:
Old and janky:

∴ irb
>> require "bundler/setup"
=> true
>> require "hashie"
=> true
>> Hashie::Mash.new(hi: "@dblock")
=> #<Hashie::Mash hi="@dblock">

New hotness:

∴ bin/console
>> Hashie::Mash.new(hi: "@dblock")
=> #<Hashie::Mash hi="@dblock">

@dblock
Copy link
Member

dblock commented Oct 19, 2015

I am sure I am missing something ... why do we need this?

@pboling
Copy link
Contributor Author

pboling commented Oct 19, 2015

@dblock It is a new "gem" standard. Modern Gems built with the bundle gem template (most gems) come with a bin/ directory that has two scripts. console is an enhanced irb that preloads the gem, so you can get straight to hacking:

 bin/console
>> Hashie::Mash.new(hi: "@dblock")
=> #<Hashie::Mash hi="@dblock">

setup by default just bundle installs. On my gems I enhance the setup script to:

  • create artifacts needed for testing (rails apps, databases, install all the various supported ruby versions, etc)
    The one here is still vanilla, but the point is that it could be useful. You do support a lot of rubies. You could have the setup script iterate over them and install them.

They are intended for developers that will be hacking on your project. You can use them to reduce the number of things people have to do when contributing. For example, you could add a bin/preflight.

pboling added a commit to pboling/hashie that referenced this pull request Oct 19, 2015
@pboling
Copy link
Contributor Author

pboling commented Oct 19, 2015

@dblock this is ready (if you think it is worthwhile)

@dblock
Copy link
Member

dblock commented Oct 19, 2015

Ok I'll take these. Make sure they (are) run through RuboCop and squash the commits. Thx.

@pboling
Copy link
Contributor Author

pboling commented Oct 23, 2015

@dblock Rebased on intridea/master, Squashed to 1 commit and Rubocop'd. This is ready.

dblock added a commit that referenced this pull request Oct 23, 2015
Default bin scripts from bundle gem command: bin/console and bin/setup
@dblock dblock merged commit f0e5eac into hashie:master Oct 23, 2015
@dblock
Copy link
Member

dblock commented Oct 23, 2015

Merged, thanks.

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Dec 12, 2015
## 3.4.3 (10/25/2015)

* [#314](hashie/hashie#314): Added a
  `StrictKeyAccess` extension that will raise an error whenever a key is
  accessed that does not exist in the hash -
  [@pboling](https://github.com/pboling).

* [#304](hashie/hashie#304): Ensured compatibility
  of `Hash` extensions with singleton objects -
  [@regexident](https://github.com/regexident).

* [#306](hashie/hashie#306): Added
  `Hashie::Extensions::Dash::Coercion` -
  [@marshall-lee](https://github.com/marshall-lee).

* [#310](hashie/hashie#310): Fixed
  `Hashie::Extensions::SafeAssignment` bug with private methods -
  [@marshall-lee](https://github.com/marshall-lee).

* [#313](hashie/hashie#313): Restrict pending spec
  to only Ruby versions 2.2.0-2.2.2 - [@pboling](https://github.com/pboling).

* [#315](hashie/hashie#315): Default `bin/` scripts:
  `console` and `setup` - [@pboling](https://github.com/pboling).
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