This file contains hidden or 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
[09:34][~/rubytesting/rake]$ cat -n GetReady.rake | |
1 task :turn_off_alarm do | |
2 puts "Turned off alarm. Would have liked 5 more minutes, though." | |
3 end | |
4 | |
5 task :groom_myself do | |
6 puts "Brushed teeth." | |
7 puts "Showered." | |
8 puts "Shaved." | |
9 end |
This file contains hidden or 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
task :turn_off_alarm do | |
puts "Turned off alarm. Would have liked 5 more minutes, though." | |
end | |
task :groom_myself do | |
puts "Brushed teeth." | |
puts "Showered." | |
puts "Shaved." | |
end | |
This file contains hidden or 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
LPPbook_git (master)$ rake -T | |
rake clean # Remove any temporary products. | |
rake clobber # Remove any generated file. | |
rake dist # Builds a zip file | |
rake html # Build the HTML from the latex sources | |
rake images # Copy images into perlexamples/ | |
rake perlexamples.pdf # Build perlexamples.pdf with index and biblio | |
rake perlexamples.tex # Builds perlexamples.tt2 (Using Perl Template) to LaTeX | |
rake perlexamples/index.html # Build the HTML from the latex sources | |
rake publichtml # Publish the HTML files into the remote server |
This file contains hidden or 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
# svn+ssh://orion/var/svn/casiano/LPP/rubytesting/simplerecdescent | |
# s -> A s B | |
# | c | |
# c -> C c | |
# | C | |
class Lexer | |
attr_accessor :input, :tokens, :pos | |
def initialize(input) |
This file contains hidden or 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
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use File::Basename; | |
use File::Path qw{remove_tree}; | |
my $url = shift or die "Usage:\n $0 repository\n"; | |
my $basename = basename($url, '.git'); | |
die "Directory $basename already exists. Remove it first" if -d $basename; | |
my $out = `git clone --depth 1 $url 2>&1`; |
This file contains hidden or 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
#!/usr/bin/env ruby | |
spec = Gem::Specification.find_by_name(ARGV.shift) | |
puts spec.gem_dir |
This file contains hidden or 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 Array | |
def iterator! | |
self.each_with_index do |n,i| | |
self[i] = yield n | |
end | |
end | |
end | |
array = [1,2,5,6,7] | |
array.iterator! {|n| n**2} | |
puts array.inspect # [1, 4, 25, 36, 49 ] |
This file contains hidden or 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 Kernel | |
A=B=C=D=E=F="defined in Kernel" | |
end | |
#Top level or global constant defined in Object | |
A=B=C=D=E="defined at top-level" | |
class Super | |
A=B=C=D="defined in superclass" | |
end | |
module Included | |
A=B=C="defined in included module" |
This file contains hidden or 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 'rack' | |
require 'rack/showexceptions' | |
require './lib/rps' | |
builder = Rack::Builder.new do | |
use(Rack::Session::Cookie, {:key => 'rack session', | |
#:domain => 'localhost', | |
#:path => '/', #:expire_after => 2592000, | |
:secret => 'change_me'}) |
This file contains hidden or 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
[section_one] | |
one = 1 | |
two = 2 | |
[section_two] | |
three = 3 | |
multi = multiline \ | |
support | |
; comments should be ignored |
OlderNewer