Skip to content

Instantly share code, notes, and snippets.

View paul's full-sized avatar

Paul Sadauskas paul

View GitHub Profile
configurator=# SELECT NOW();
now
-------------------------------
2008-10-08 15:17:06.234692-06
(1 row)
configurator=# SELECT created_at FROM configurations LIMIT 1;
created_at
---------------------
2008-10-07 16:38:28
POSTing this JSON document to /configurations:
{
"name": "lacquered",
"notes": "...",
"parent_configuration_href": "http://config.ssbe.localhost/configurations/90"
}
parent_configuration_href references another configuration in this application.
Our URIs are opaque, so href is the only a client is allowed to reference it.
diff --git a/merb.thor b/merb.thor
index 14877c4..9d3fb7b 100644
--- a/merb.thor
+++ b/merb.thor
@@ -1119,6 +1119,7 @@ module Merb
# regardless of actual application dependency settings.
DM_STACK = %w[
+ extlib
dm-core
# I have a set of questions, each of which have a default (default_answers)
# I also have a set of answers for questions, but not every question (answers)
# I want an array of every answer, priority to the actual answers, but filling
# in the default answer when no actual answer exists.
def all_answers
all_answers = {}
default_answers.each do |answer|
all_answers[answer.question_name] == answer
end
def require(path) # :nodoc:
gem_original_require path
rescue LoadError => load_error
if load_error.message =~ /#{Regexp.escape path}\z/ and
spec = Gem.searcher.find(path) then
Gem.activate(spec.name, "= #{spec.version}")
gem_original_require path
else
raise load_error
end
before do
class Sscj1Test < Application
def index; end
end
Merb::Router.append do
match("/sscj1_test").
to(:controller => 'Sscj1Test', :action => :index).
name(:sscj1_test)
end
Merb::Router.prepare do
# match('/templates/:template_id', :template_id => /.+/) do
# match('/questions/:name').to(:controller => 'questions', :action => 'show').name(:question)
# match('/questions').to(:controller => 'questions', :action => 'index').name(:questions)
# end
# match('/templates').to(:controller => 'templates', :action => 'index').name(:templates)
# match('/templates/:id', :id => /.+/).to(:controller => 'templates', :action => 'show').name(:template)
resources :templates, :id => /.+(?=(/questions)?/ do
require File.join(File.dirname(__FILE__), 'spec_helper.rb')
given 'a given' do
puts 'Given'
end
describe 'a spec' do
before do
puts 'Outer Before'
[~/dev/lunchcalc2][rando@apollo]
% ls bin
total 40
-rwxr-xr-x 1 rando users 850 2008-11-05 12:15 autospec*
-rwxr-xr-x 1 rando users 870 2008-11-05 12:14 edit_json.rb*
-rwxr-xr-x 1 rando users 849 2008-11-05 12:13 erubis*
-rwxr-xr-x 1 rando users 854 2008-11-05 12:15 merb*
-rwxr-xr-x 1 rando users 843 2008-11-05 12:15 rackup*
-rwxr-xr-x 1 rando users 839 2008-11-05 12:14 rake*
-rwxr-xr-x 1 rando users 849 2008-11-05 12:15 rake2thor*
local blue_op="%{$fg[blue]%}[%{$reset_color%}"
local blue_cp="%{$fg[blue]%}]%{$reset_color%}"
local path_p="${blue_op}%~${blue_cp}"
local user_host="${blue_op}%n@%m${blue_cp}"
local ret_status="${blue_op}%?${blue_cp}"
local hist_no="${blue_op}%h${blue_cp}"
PROMPT="${path_p}${user_host}
%# "
local cur_cmd="${blue_op}%_${blue_cp}"
PROMPT2="${cur_cmd}> "