Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Chapter Introduction

  • Loading branch information...
commit 19a26250580be6c9983367fcd0801e9ff6b361e6 1 parent 23ac71f
@weppos authored
View
37 introduction/01_about.md
@@ -1,10 +1,47 @@
+!SLIDE subsection
+# Ruby
+
+
!SLIDE
# Ruby is a Programming Language
+ @@@ Ruby
+ a = Thread.new {
+ mutex.synchronize {
+ # Thread 'a' now needs the resource
+ resource.wait(mutex)
+ # 'a' can now have the resource
+ }
+ }
+
!SLIDE
# Ruby is expressive
+ @@@ Ruby
+ # Method example
+ def read(path)
+ return nil unless File.exist?(path)
+ File.read(path)
+ end
+
+ # RSpec example
+ Post.last.should have(10).comments
+
!SLIDE
# Ruby is elegant
+
+ @@@ Ruby
+ # Sinatra example
+ get '/' do
+ 'Hello world!'
+ end
+
+ # Block example
+ ChessGame.new do |move|
+ move.black_pawn(forward)
+ move.white_pawn(forward)
+ # ...
+ move.white_queen(pwn_king)
+ end
View
4 introduction/02_thinking.md
@@ -1,8 +1,8 @@
-!SLIDE
+!SLIDE subsection
# Thinking Ruby
-!SLIDE
+!SLIDE center
# Be a Rubyist
Rubyists always give priority to clear and consistent code over complex or cryptic code.
View
2  styles.css
@@ -1,3 +1,3 @@
pre {
font-size: 2em;
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.