- Complete the ruby koans
- Use RSpec to test-drive a solution to either:
- Write a 10 minute presentation about the topic card you pick
- BONUS: clone Corey Haines' [practice repo] [1], and use it to help you complete a Game of Life solution.
- You will need to research [cucumber] [2] and [bundler] [3]
- Use cucumber and rspec to help guide your code
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
# Fill in the values after # => | |
# | |
$title = "Ruby Variables" | |
@subtitle = "Where do they come from?" | |
presenter = "@tooky" | |
class Presentation | |
@@length = "10 min" | |
@style = "Code" |
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 'minitest' | |
module Cucumber | |
module MiniTestAssertions | |
def self.extended(base) | |
base.extend(MiniTest::Assertions) | |
base.assertions = 0 | |
end | |
attr_accessor :assertions | |
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
module MiniTestAssertions | |
def self.extended(base) | |
base.extend(MiniTest::Assertions) | |
end | |
attr_accessor :assertions | |
end | |
World(MiniTestAssertions) # this will work | |
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
% VIEW_OTHER_WARNINGS=true rake ~cucumber/cucumber-ruby-core (master) | |
/opt/rubies/ruby-1.9.3-p392/bin/ruby -w -r./capture_warnings -S rspec ./spec/cucumber/core/ast/background_spec.rb ./spec/cucumber/core/ast/doc_string_spec.rb ./spec/cucumber/core/ast/examples_table_spec.rb ./spec/cucumber/core/ast/outline_step_spec.rb ./spec/cucumber/core/ast/step_spec.rb ./spec/cucumber/core/ast/table_spec.rb ./spec/cucumber/core/compiler_spec.rb ./spec/cucumber/core/gherkin/parser_spec.rb ./spec/cucumber/core/gherkin/writer_spec.rb ./spec/cucumber/core/test/case_spec.rb ./spec/cucumber/core/test/result_spec.rb ./spec/cucumber/core/test/step_spec.rb ./spec/cucumber/core/test/suite_runner_spec.rb ./spec/cucumber/core_spec.rb ./spec/cucumber/initializer_spec.rb --color | |
...................................................................................................................... | |
------------------------------ other warnings: ------------------------------ | |
/U |
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 AccountSignup | |
def self.new(warden, acccount_params) | |
account = Subscribem::Account.create(account_params) | |
account.create_schema | |
UserSignup.new(warden, account, account.owner) | |
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
module Context | |
def the(key, value) | |
context[key] = value | |
end | |
def method_missing(method, *args, &block) | |
key = extract_key(method) | |
if key | |
context.fetch(key.to_sym) | |
else |
The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.
You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.
- Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
James Ladd proposes a compass that we can use to navigate our object-oriented designs. We move North as we travel up a layer, South as we travel down a layer. West will take us away from the object, and East moves us towards another object.
James suggests that we orient our code so that we are always travelling East. In practice this means that code should follow these rules:
- All public methods return nil, boolean or return a reference to the current object (self).
- Objects that implement the Factory or Builder pattern or similar are an exception.
- East is better suited to composite objects, not primitive objects (James doesn’t make this distinction).
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
;solution presented | |
(def a | |
(fn [type & args] | |
(apply type args))) | |
;my original solution | |
(def a | |
(fn [type & args] | |
(eval (cons type args)))) |