Created
          April 27, 2012 23:18 
        
      - 
      
- 
        Save jeffmccune/2514237 to your computer and use it in GitHub Desktop. 
    Ruby, I'm surprised by you, OK? You're not bash.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | [jeff@maynard] (feature/master/registry_key_purge_values)(dirty)[█▆▁]1.8.7 /vagrant/modules/registry | |
| $ cat foo.rb | |
| #! /bin/bash | |
| # | |
| echo bar | |
| [jeff@maynard] (feature/master/registry_key_purge_values)(dirty)[█▆▁]1.8.7 /vagrant/modules/registry | |
| $ ruby foo.rb | |
| bar | 
Right, but marking the file as executable and letting the system start the interpreter process is different than using the shell and passing the script directly to ruby:
Notice I do ruby foo.rb and not ./foo.rb
The syntax checking command for a ruby file is something like: ruby -W1 -c foo.rb
Ah. Yes, so I see. How precious.
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
⚡ head ./spec/unit/agent_spec.rb #!/usr/bin/env rspec require 'spec_helper' require 'puppet/agent' class AgentTestClient def run # no-op end def stop # no-op ⚡ ./spec/unit/agent_spec.rb /Users/daniel/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead. 34/34: 100% |==========================================| Time: 00:00:00 Finished in 0.13905 seconds 34 examples, 0 failures