RubyWeek 6
Mid-Term• Due Now!• Git Access Revoked• Grades by Next Week
Project• Make a Gem!• Source on Github• Gem Released on RubyGems.org• Full Documentation and Tests• Tested on Travis CI
Topics• Whatever you want! (It has to do something!)• Suggestions:  • Calculations (unit conversions,    physics helper, e...
Project• Due the Last Day of Class• Demo the gem in-class
Ruby Gems• Packaged Ruby Code• Available for Everyone!• DRY
Gem Structure- test_gem.gemspec- lib - test_gem.rb                     https://github.com/hakanensari/structure
GemSpec  Gem::Specification.new do |s|  s.name        = test_gem  s.version     = 0.0.0  s.date        = 2012-11-13  s.sum...
Building Your Gem$ gem build test_gem.gemspec       Successfully built RubyGem       Name: test_gem       Version: 0.0.0  ...
Installing Your Gem$ gem install test_gem-0.0.0.gem  Successfully installed test_gem-0.0.0  1 gem installed  Installing ri...
RubyGems.org• Setup an Account:   • https://rubygems.org/users/new• Setup Credentials: • API Access:   • https://rubygems....
Releasing Your Gem$ gem push test_gem-0.0.0.gem  Pushing gem to RubyGems.org...  Successfully registered gem: test_gem (0....
Viewing Remote Gems$ gem list -r test_gem*** REMOTE GEMS ***test_gem (0.0.0)
Installing a Gem$ gem install test_gemFetching: test_gem-0.0.0.gem (100%)Successfully installed test_gem-0.0.01 gem instal...
Adding CLI• Command Line Interface• Structure - bin   - test_gem• SheBang     (Sharp Bang, Shell Bang)   : #!/usr/bin/env ...
Arguments• Constant Array: • ARGV
Testing!- spec - test_gem_spec.rb- RakeFile- .rspec
Rakefile• Testing Task:  require rspec/core/rake_task  RSpec::Core::RakeTask.new(spec)  task :default => :spec
.rspec- --color- --format documentation
Gem FrameWorks• Jeweler• Gem Release• Hoe• Rake• Bundler
Continuous Integration• Git Hook• Manages Different Environments• Testing Cycle
Travis CI• Free CI for Open Source• Easy• Fast• Fun!
Github Hook• Admin• Service Hooks• Travis • Copy and Paste Token
.travis.ymllanguage: rubyrvm: - 1.8.7 - 1.9.2 - 1.9.3 - jruby-18mode - jruby-19mode - ruby-head - jruby-head - ree
ReadMe Graphic• Build Status:  {<img src="https://secure.travis-ci.org/  reneedv/elucidate.png" />}  [http://travis-ci.org...
HomeWork• Release a test gem to RubyGems.org• E-mail me your project idea
Upcoming SlideShare
Loading in …5
×

Week6

388 views

Published on

UWE-Ruby Fall 2012 Week6 slides

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
388
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
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
  • \n
  • \n
  • Week6

    1. 1. RubyWeek 6
    2. 2. Mid-Term• Due Now!• Git Access Revoked• Grades by Next Week
    3. 3. Project• Make a Gem!• Source on Github• Gem Released on RubyGems.org• Full Documentation and Tests• Tested on Travis CI
    4. 4. Topics• Whatever you want! (It has to do something!)• Suggestions: • Calculations (unit conversions, physics helper, etc...) • Games (game of life, battleship, tic- tac-toe, sudoku solver etc..) • DSL, Programing helper, etc...
    5. 5. Project• Due the Last Day of Class• Demo the gem in-class
    6. 6. Ruby Gems• Packaged Ruby Code• Available for Everyone!• DRY
    7. 7. Gem Structure- test_gem.gemspec- lib - test_gem.rb https://github.com/hakanensari/structure
    8. 8. GemSpec Gem::Specification.new do |s| s.name = test_gem s.version = 0.0.0 s.date = 2012-11-13 s.summary = "Making a Test Gem" s.description = "A gem to explain how to make gems" s.authors = ["Renée De Voursney"] s.email = renee@nird.us s.homepage = http://rubygems.org/gems/test_gem s.files = ["lib/test_gem.rb"]end
    9. 9. Building Your Gem$ gem build test_gem.gemspec Successfully built RubyGem Name: test_gem Version: 0.0.0 File: test_gem-0.0.0.gem
    10. 10. Installing Your Gem$ gem install test_gem-0.0.0.gem Successfully installed test_gem-0.0.0 1 gem installed Installing ri documentation fortest_gem-0.0.0... Installing RDoc documentation fortest_gem-0.0.0...
    11. 11. RubyGems.org• Setup an Account: • https://rubygems.org/users/new• Setup Credentials: • API Access: • https://rubygems.org/profile/edit
    12. 12. Releasing Your Gem$ gem push test_gem-0.0.0.gem Pushing gem to RubyGems.org... Successfully registered gem: test_gem (0.0.0)
    13. 13. Viewing Remote Gems$ gem list -r test_gem*** REMOTE GEMS ***test_gem (0.0.0)
    14. 14. Installing a Gem$ gem install test_gemFetching: test_gem-0.0.0.gem (100%)Successfully installed test_gem-0.0.01 gem installedInstalling ri documentation fortest_gem-0.0.0...Installing RDoc documentation fortest_gem-0.1.0...
    15. 15. Adding CLI• Command Line Interface• Structure - bin - test_gem• SheBang (Sharp Bang, Shell Bang) : #!/usr/bin/env ruby• Spec: s.executables << test_gem
    16. 16. Arguments• Constant Array: • ARGV
    17. 17. Testing!- spec - test_gem_spec.rb- RakeFile- .rspec
    18. 18. Rakefile• Testing Task: require rspec/core/rake_task RSpec::Core::RakeTask.new(spec) task :default => :spec
    19. 19. .rspec- --color- --format documentation
    20. 20. Gem FrameWorks• Jeweler• Gem Release• Hoe• Rake• Bundler
    21. 21. Continuous Integration• Git Hook• Manages Different Environments• Testing Cycle
    22. 22. Travis CI• Free CI for Open Source• Easy• Fast• Fun!
    23. 23. Github Hook• Admin• Service Hooks• Travis • Copy and Paste Token
    24. 24. .travis.ymllanguage: rubyrvm: - 1.8.7 - 1.9.2 - 1.9.3 - jruby-18mode - jruby-19mode - ruby-head - jruby-head - ree
    25. 25. ReadMe Graphic• Build Status: {<img src="https://secure.travis-ci.org/ reneedv/elucidate.png" />} [http://travis-ci.org/reneedv/elucidate]
    26. 26. HomeWork• Release a test gem to RubyGems.org• E-mail me your project idea

    ×