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
duration,time,difference | |
1,20.367,3.367 | |
2,23.967,3.600 | |
3,27.167,3.200 | |
4,32.833,5.666 | |
5,37.933,5.100 | |
6,40.333,2.400 | |
7,42.600,2.267 | |
8,45.767,3.167 | |
9,47.333,1.566 |
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 'test/unit' | |
require 'rubygems' | |
require 'mocha' | |
class TemperatureSampler | |
def initialize(sensor) | |
@sensor = sensor | |
end | |
def average_temp |
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
Prawn specs: Running on Ruby Version: 1.9.0 | |
..............................................................................................FFF.............................................F.. | |
1) | |
ArgumentError in 'adobe font metrics should calculate string width taking into account accented characters' | |
malformed UTF-8 character (expected 3 bytes, given 1 bytes) | |
/Users/sandal/devel/prawn/spec/metrics_spec.rb:13:in `block (2 levels) in <top (required)>' | |
2) | |
ArgumentError in 'adobe font metrics should calculate string width taking into account kerning pairs' |
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
["rubygems","builder","yaml", "fileutils", "redcloth", "erb"].each { |l| require l } | |
class Blaag | |
TITLE = "Majestic Sea Creature" | |
DOMAIN = "blog.majesticseacreature.com" | |
AUTHOR = "Gregory Brown" | |
DESCRIPTION = "Technical Ramblings from #{AUTHOR}" | |
BASEDIR = File.dirname(File.expand_path(__FILE__)) + "/../" | |
def self.generate |
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
def to_rss | |
xml = Builder::XmlMarkup.new | |
xml.instruct! | |
xml.rss :version => "2.0" do | |
xml.channel do | |
xml.title TITLE | |
xml.link "http://#{DOMAIN}/" | |
xml.description DESCRIPTION | |
xml.language "en-us" | |
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
=title | |
A Sample Post | |
=description | |
This is how I want posts in Blaag to look, | |
making things feel a whole lot like an ordinary text file | |
=entry | |
The main body of the entry begins here, | |
and I am free to use _Textile_ |
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 Entry | |
def self.registry | |
@registry ||= YAML.load_file("#{Blaag::BASEDIR}/data/registry.yml") | |
end | |
def self.update_registry(filename,mtime) | |
registry[filename] ||= mtime | |
File.open("#{Blaag::BASEDIR}/data/registry.yml","w") do |f| | |
f << @registry.to_yaml |
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
def self.generate | |
entries = Dir["#{Blaag::BASEDIR}/entries/**/*"]. | |
reject { |f| File.directory?(f) } | |
entries.map! { |e| Entry.load(e) } | |
@blaag = Blaag.new(entries) | |
File.open("#{Blaag::BASEDIR}/www/index.html","w") { |f| | |
f << layout { @blaag.to_html } |
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
["rubygems","builder","yaml", "fileutils", "redcloth", "erb","uri"].each { |l| require l } | |
class Blaag | |
TITLE = "Majestic Sea Creature" | |
DOMAIN = "blog.majesticseacreature.com" | |
AUTHOR = "Gregory Brown" | |
DESCRIPTION = "Technical Ramblings from #{AUTHOR}" | |
BASEDIR = File.dirname(File.expand_path(__FILE__)) + "/../" | |
def self.generate |
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
describe "A context" do | |
describe "With nesting" do | |
it "won't run in 1.9.0_3" | |
end | |
end | |
##### | |
$ ruby -v | |
ruby 1.9.0 (2008-07-25 revision 18217) [i686-darwin8.11.1] | |
$ spec foo.rb |
OlderNewer