Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. irb(main):037:0> eval <<-EOS
  2. irb(main):038:0" #{attribute} = "host"
  3. irb(main):039:0" puts machine
  4. irb(main):040:0" EOS
  5. host
  6. => nil
  7. irb(main):041:0> puts machine
  8. host
  9. => nil
  10. irb(main):042:0> puts attribute
  11. machine
  12. => nil
  13. irb(main):043:0>
  14.  
  15. ../autosys/convert_jil_to_zapp.rb:40: undefined local variable or method `machine' for main:Object (NameError)
  16. from ../autosys/convert_jil_to_zapp.rb:29:in `each_line'
  17. from ../autosys/convert_jil_to_zapp.rb:29
  18. from ../autosys/convert_jil_to_zapp.rb:27:in `each'
  19. from ../autosys/convert_jil_to_zapp.rb:27
  20. pi929c1n10 /ms/user/h/hirscst/ruby/autosys 77$ gvim try.rb
  21. pi929c1n10 /ms/user/h/hirscst/ruby/autosys 78$ chmod +x try.rb
  22. pi929c1n10 /ms/user/h/hirscst/ruby/autosys 79$ ./try.rb
  23. host
  24. ./try.rb:8: undefined local variable or method `machine' for main:Object (NameError)
  25.  
  26. eval 'x = 3'
  27. puts x # throws an exception when run as a script
  28. => 3
  29.  
  30. x = 1
  31. eval 'x = 3'
  32. puts x
  33. => 3
  34.  
  35. eval 'x = 3'
  36. eval 'puts x'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement