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

Scripts #223

Closed
wants to merge 8 commits into from
Closed

Scripts #223

wants to merge 8 commits into from

Conversation

technoweenie
Copy link
Member

Extract the rakegem rakefile to individual scripts. This removes a dependency (Rake), and gives the project a definitive place for various administrative actions:

  • Running the test suite (script/test)
  • Run continuous integration (script/cibuild)
  • Building a new gem (script/gem)
  • Releasing a gem (script/release)
  • etc...

This approach borrows heavily from mojombo/rakegem, but favors scripts over Rake. I prefer this to using Rake + Bundler, because the tasks are simple and visible. Being visible makes it easy to tweak them later as needs change. Having a full manifest in the gemspec lets us easily diff gemspec changes between versions.

This is also striving to conform to some internal GitHub script conventions. You can run script/test without caring what language or programming environment you're in.

/cc @sferik @jbarnette

FileUtils.mkdir_p File.expand_path("../../pkg", __FILE__)
puts `script/gemspec`
puts `gem build #{MakeScript.gemspec_file}`
puts `mv #{MakeScript.gem_file} pkg`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use system for these?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...it would mean you wouldn't need to use puts or the backticks, and would mean it would print the output as it did the work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. For some reason I thought that was rake only, but I may be thinking of #sh.

@eric
Copy link
Contributor

eric commented Dec 28, 2012

This is pretty sweet. I would love to see a version of rakegem that used this convention. I guess we would need to name it something else, eh?

@technoweenie
Copy link
Member Author

That's why ruby.rb defines MakeScript :) Trying to come up with something like "RakeGem" but more language agnostic. 🤷

@eric
Copy link
Contributor

eric commented Dec 28, 2012

I feel like script/build or script/package would make more sense than calling it script/gem. Is the gem name what github has settled on?

@technoweenie
Copy link
Member Author

I like package. I think faraday is the first library that's tried this convention, so we don't have one for this afaik.

@technoweenie technoweenie mentioned this pull request Dec 28, 2012
@technoweenie
Copy link
Member Author

Closing, cherry picked these into master.

@technoweenie technoweenie deleted the scripts branch December 28, 2012 08:52
@jbarnette
Copy link

👍 I like script/package as well. I've been using script/tests instead of script/test to avoid the conflict with /bin/test or a shell builtin, but since convention is to always prefix with script/ when running I don't think it matters.

A bunch of these could easily be POSIX shell instead of Ruby, but I assume you're Rubying on purpose. :)

@technoweenie
Copy link
Member Author

I did them in ruby just to get a clean transition from rakegem. @mislav
went full shell in #225.

On Fri, Dec 28, 2012 at 10:45 AM, John Barnette notifications@github.comwrote:

[image: 👍] I like script/package as well. I've been using
script/tests instead of script/test to avoid the conflict with /bin/testor a shell builtin, but since convention is to always prefix with
script/ when running I don't think it matters.

A bunch of these could easily be POSIX shell instead of Ruby, but I assume
you're Rubying on purpose. :)


Reply to this email directly or view it on GitHubhttps://github.com/technoweenie/faraday/pull/223#issuecomment-11737068.

Rick Olson
http://github.com/technoweenie

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.

3 participants