Created
April 12, 2012 15:15
-
-
Save aaronbbrown/2368044 to your computer and use it in GitHub Desktop.
How to test an erb
This file contains 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
1 [11:13:09] aaron@gaeta-wifi:~$ cat /tmp/foo.erb | |
my name is <%= name %> | |
0 [11:13:14] aaron@gaeta-wifi:~$ erb -x -T '-' /tmp/foo.erb > /tmp/foo.rb | |
0 [11:13:37] aaron@gaeta-wifi:~$ vim !$ | |
#!/usr/bin/env ruby | |
name = "Aaron" # ADD THIS | |
_erbout = ''; _erbout.concat "my name is "; _erbout.concat(( name ).to_s); _erbout.concat "\ | |
n" | |
; _erbout.concat "\n" | |
; _erbout | |
puts _erbout # ADD THIS | |
0 [11:14:43] aaron@gaeta-wifi:~$ ruby !$ | |
ruby /tmp/foo.rb | |
my name is Aaron |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment