ZOMG: CLI and  no puts     Jesse Wolgamott @jwo | houston.rb Meeting
Part 1  DavidCopelandawesomecommandline apps
Command Line Apps• What makes a Command Line App?• Follow the unix way
It’s nota script
Kind toOthers
BeHelpful
Two Kinds ofCommand Lines
• Simple utility (think ls, or grep)• Command suite (think github’s, with multiple  commands)
Helpful Appsdo not destroy
my_cmd -> nothing destructivemy_cmd -h -> full help statementmy_cmd help command -> full help for thatcommand
List of Gems
Gem                   why For?         GLI              Command Suite OptionsChoices or OptionParser       Utility Options...
Note: Choice is probably only good for1.8 appsBut I kinda like itAnd didn’t have an OptionParserExample
FREAL, look at    GLI
Sample LoremIpsum created  using GLIhttps://github.com/jwo/         Ipster/
Part 2jim weirichdebuggingthe safari
Debugging, no    puts
Does anyonehere debug?
PRY ruby -rpry convert.rb 98.6def index  @articles = Article.all  binding.pryend
Also, there’s a  railscast!
PRY is good for• Can use ls to list variables• Can inspect variables• Can cd into an @variable• Inspects State.
How To Start items.each do |item|  debugger #bam
What you can dol #where am I#   to go to next:      n #next method#   to go into the next method      s #step into#   to e...
Da Gems Ruby 1.9gem “ruby-debug19”Ruby 1.8gem “ruby-debug”
Upcoming SlideShare
Loading in...5
×

Zomg: Ruby Command Line and Ruby Debugging

1,578

Published on

Use GLI to create command line apps. Use Pry and ruby-debug to debug without puts.

Published in: Technology
4 Comments
1 Like
Statistics
Notes
No Downloads
Views
Total Views
1,578
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
4
Likes
1
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Zomg: Ruby Command Line and Ruby Debugging

    1. 1. ZOMG: CLI and no puts Jesse Wolgamott @jwo | houston.rb Meeting
    2. 2. Part 1 DavidCopelandawesomecommandline apps
    3. 3. Command Line Apps• What makes a Command Line App?• Follow the unix way
    4. 4. It’s nota script
    5. 5. Kind toOthers
    6. 6. BeHelpful
    7. 7. Two Kinds ofCommand Lines
    8. 8. • Simple utility (think ls, or grep)• Command suite (think github’s, with multiple commands)
    9. 9. Helpful Appsdo not destroy
    10. 10. my_cmd -> nothing destructivemy_cmd -h -> full help statementmy_cmd help command -> full help for thatcommand
    11. 11. List of Gems
    12. 12. Gem why For? GLI Command Suite OptionsChoices or OptionParser Utility Options Aruba Cuke Tests Terminal-Table Format output in tables Rainbow Color output
    13. 13. Note: Choice is probably only good for1.8 appsBut I kinda like itAnd didn’t have an OptionParserExample
    14. 14. FREAL, look at GLI
    15. 15. Sample LoremIpsum created using GLIhttps://github.com/jwo/ Ipster/
    16. 16. Part 2jim weirichdebuggingthe safari
    17. 17. Debugging, no puts
    18. 18. Does anyonehere debug?
    19. 19. PRY ruby -rpry convert.rb 98.6def index @articles = Article.all binding.pryend
    20. 20. Also, there’s a railscast!
    21. 21. PRY is good for• Can use ls to list variables• Can inspect variables• Can cd into an @variable• Inspects State.
    22. 22. How To Start items.each do |item|  debugger #bam
    23. 23. What you can dol #where am I# to go to next:    n #next method# to go into the next method    s #step into# to evaluate ruby :    e item #evaluate item, so itll inspect it# display ruby expression with each step    displ # displ Item.count•
    24. 24. Da Gems Ruby 1.9gem “ruby-debug19”Ruby 1.8gem “ruby-debug”

    ×