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
require 'rubygems' | |
Gem.bin_path('rspec-core', 'rspec') |
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
# Obs.: I'm running with ruby 1.8.7 | |
ruby_1_9_1 = "/Users/tomas/.rvm/rubies/ruby-1.9.1-p378/bin/ruby" | |
file = File.expand_path('rspec_bin.rb') | |
system("rvm 1.9.1 && #{ruby_1_9_1} -rrubygems #{file}") | |
## RESULT ## |
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
HOME_DIR = "/home/nelson" | |
versions = Dir[File.join('#{HOME_DIR}/.rvm/rubies', "ruby*")] | |
versions.each do |version| | |
version.match(/-([\d\.]\+)-/) | |
ruby_version_string = version.split('/').last | |
ruby_version = $1 |
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
# Imagina que eu tenho uma gem chama infinity_test | |
# Eu quero criar a Dsl para o Morpheus em uma syntax Rack-Like: | |
# O que queremos: | |
tasks :require => %w(infinity_test) # will require infinity_test.tasks | |
class Tasks < Morpheus::Base | |
infinity_test :test, :test_framework => :rspec, :cucumber => true, :test_pattern => 'spec/spec_*.rb' |
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
Ruby 1.8.7 | |
rvm '1.8.7' 'ruby' '/Users/tomas/.rvm/gems/ruby-1.8.7-p302/gems/rspec-core-2.0.0.beta.20/bin/rspec spec/factories/buzz/spec/buzz_spec.rb spec/factories/slinky/spec/slinky/slinky_spec.rb spec/factories/wood/spec/wood_spec.rb spec/infinity_test/application_spec.rb spec/infinity_test/command_spec.rb spec/infinity_test/configuration_spec.rb spec/infinity_test/continuous_testing_spec.rb spec/infinity_test/cucumber_spec.rb spec/infinity_test/notifications/growl_spec.rb spec/infinity_test/options_spec.rb spec/infinity_test/rspec_spec.rb spec/infinity_test/runner_spec.rb spec/infinity_test/test_unit_spec.rb spec/infinity_test_spec.rb' | |
Ruby 1.9.2 | |
rvm '1.9.2' 'ruby' '/Users/tomas/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.0.0.beta.20/bin/rspec spec/factories/buzz/spec/buzz_spec.rb spec/factories/slinky/spec/slinky/slinky_spec.rb spec/factories/wood/spec/wood_spec.rb spec/infinity_test/application_spec.rb spec/infinity_test/command_spec.rb spec/infinity_test/configuration_spec.rb spec/infinity_test/conti |
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
ruby /Users/tomas/.rvm/gems/ree-1.8.7-2010.02@infinity_test/bin/rspec spec/factories/buzz/spec/buzz_spec.rb spec/factories/slinky/spec/slinky/slinky_spec.rb spec/factories/wood/spec/wood_spec.rb spec/infinity_test/application_spec.rb spec/infinity_test/command_spec.rb | |
OUTPUT: | |
...................... | |
Finished in 0.01747 seconds | |
22 examples, 0 failures | |
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
Vim #ftw but manage vim plugins is not a task that I like. | |
Let's change that: | |
A Fake bash commands: | |
$ vim-apt list | |
$ vim-apt update # Update and see new versions of that package (like apt-get update) |
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
module BeforeChanges | |
def before_changes | |
before_change_object = self.clone | |
changes.each do |changed_field, change| | |
before_change_object.send("#{changed_field}=", change[0]) | |
end | |
before_change_object | |
end | |
end |
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
class Color | |
def self.green | |
ansi_color(31) | |
end | |
def self.red | |
ansi_color(32) | |
end | |
def yellow |