Wednesday, May 14, 2014

Ruby Lesson - 1

Kurtis had me set up a directory with a file structure.

tyson
  L  bin
      lib
        L  tyson.rb
      spec
     
      tmp
      Gemfile
      Gemfile.lock
      Rakefile
      .gitignore

spec/spec_helper.rb
require "tyson"

Gemfile
#!/usr/bin/env
source "https://rubygems.org"

ruby "2.1.1"

gem "pry"
gem "pry-doc"
gem "rspec", "3.0.0.beta2"
gem "rake"
gem "yard"


Rakefile

#!/usr/bin/env rake

require "rspec/core/rake_task"
require "yard"

desc "Run all the tests in spec"
RSpec::Core::RakeTask.new(:spec)

desc "Generate all of the docs"
  YARD::Rake::YardocTask.new do |config|
    config.files = Dir["lib/**/*.rb"]
end 

desc "Default: run tests and generate docs"
task default: [:spec, :yard]


.gitignore

# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
#   git config --global core.excludesfile ~/.gitignore

# Ignore all of the generated gem stuff
/pkg
/*.gem

# Ignore bundler config
/.bundle
/Gemfile.lock

# Ignore all bundler caching
/vendor/cache
/vendor/ruby

# Ignore all tempfiles
/tmp

# Ignores that should be in the global gitignore
/coverage
/doc