View Gemfile
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
gem 'json' | |
only :app do | |
gem 'sinatra' | |
source 'http://gems.github.com' | |
gem 'famoseagle-carrot', :require_as => 'carrot' | |
end | |
only :daemon do | |
gem 'eventmachine' |
View app.rb
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 File.expand_path(File.dirname(__FILE__) + '/vendor/gems/environment') | |
#require 'sinatra' | |
Bundler.require_env(:app) | |
get '/' do | |
'Hello world!' | |
end |
View Bundler Problem
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
----- Gemfile ----- | |
gem 'sinatra' | |
----- app.rb ------ | |
require 'vendor/gems/environment' | |
Bundler.require_env | |
get '/' do | |
"hello world" | |
end |
View Bundler Problem
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
----- Gemfile ----- | |
gem 'sinatra' | |
----- app.rb ------ | |
require 'vendor/gems/environment' | |
Bundler.require_env | |
get '/' do | |
"hello world" | |
end |
View set_routes.thor
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 Vhost < Thor | |
include Thor::Actions | |
no_tasks do | |
def initialize(*args) | |
@vhost_dir = File.expand_path "~/.vhost" | |
@app_dir = File.expand_path "~/lcl/nconf" | |
@adblock_file = File.expand_path "~/util/bin/templates/adblock.txt" | |
super args | |
end |
View gist:818611
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 'spec_helper' | |
=begin | |
Example One - this works | |
In this example, the constant (ZZZ) is set in the | |
Spec, and detected in the target code. | |
=end | |
module TestModule | |
class TestClass |
View gist:818821
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 'spec_helper' | |
=begin | |
Example One - this is working | |
In this example, the constant (ZZZ) is set in the | |
Spec, and detected in the target code. | |
=end | |
module TestModule | |
class TestClass |
View parslet.rb
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'parslet' | |
class LineParser < Parslet::Parser | |
rule(:eol) { match['\n\r'] } | |
rule(:eol?) { eol.maybe } | |
rule(:line) { (any.repeat).as(:line) } | |
rule(:line_eol) { line >> eol? } |
View simple_parse.rb
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
#!/usr/bin/env ruby | |
require 'rubygems'; require 'parslet' | |
class Xp < Parslet::Parser | |
rule(:b) { str("\n").absnt? } | |
root(:b) | |
end | |
# this generates an error - I think it should just return "a"... |
OlderNewer