# Code Review: dash\_s

**URL:** <https://www.ruby-forum.com/t/code-review-dash-s/181734>\
**Category:** IronRuby\
**Created:** [January 17, 2010, 11:58am UTC](https://www.ruby-forum.com/t/code-review-dash-s/181734 "2010-01-17T11:58:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsoho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Post date:** [January 17, 2010, 11:58am UTC](https://www.ruby-forum.com/t/code-review-dash-s/181734/1 "2010-01-17T11:58:26Z")

</div>

-S finds the file being run on the environment’s PATH, rather than  
requiring the full path to be provided.

Adds the -S command-line option (for example: ir -S irb)  
[http://github.com/jschementi/ironruby/commit/135d5e5715409a194191c51c0566863603f49e16](http://github.com/jschementi/ironruby/commit/135d5e5715409a194191c51c0566863603f49e16)

Add spec for -S  
[http://github.com/jschementi/ironruby/commit/62f211de25d1e7c7793b4f9af36cfde3670247f8](http://github.com/jschementi/ironruby/commit/62f211de25d1e7c7793b4f9af36cfde3670247f8)

---

<div class="post-metadata">

**Author:** ![jsoho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Post date:** [January 18, 2010, 8:26am UTC](https://www.ruby-forum.com/t/code-review-dash-s/181734/2 "2010-01-18T08:26:22Z")

</div>

I noticed that -S should use the first file it finds on the path, can  
you do a spec for that?

The rest looks good.

JD

---

<div class="post-metadata">

**Author:** ![jsoho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Post date:** [January 19, 2010, 8:24pm UTC](https://www.ruby-forum.com/t/code-review-dash-s/181734/3 "2010-01-19T20:24:01Z")

</div>

Looks good. Could you factor the file search out into a private method?

Tomas

---

<div class="post-metadata">

**Author:** ![jsoho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Post date:** [January 25, 2010, 7:37am UTC](https://www.ruby-forum.com/t/code-review-dash-s/181734/4 "2010-01-25T07:37:40Z")

</div>

> Could you factor the file search out into a private method?

Done …

> I noticed that -S should use the first file it finds on the path, can  
> you do a spec for that?

… and done (though, isn’t that the definition of the path? =P)

Attached diff, or  
tfpt review “/shelveset:dash\_upper\_s;REDMOND\jimmysch”

~Jimmy
