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 'imgkit' | |
class InvalidInputFileError < Exception; end | |
class Converter | |
def initialize(input, output = nil) | |
raise InvalidInputFileError unless html_file?(input) | |
@input = input | |
if @output | |
@ouput = output |
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
# Switch to Ruby 1.8.7 | |
rvm use 1.8.7 | |
# Print out the ruby version | |
ruby -v | |
# But the output of this is: | |
# | |
# $ ./tryrvm | |
# <i> Now using ruby 1.8.7 p249 </i> |
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 'mongomapper' | |
class Media | |
include MongoMapper::EmbeddedDocument | |
key :file, String | |
end | |
class Video < Media | |
key :length, Integer | |
end |