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
HISTFILE=$HOME/.zsh_history | |
HISTSIZE=5000 | |
SAVEHIST=10000 # useful for setopt append_history | |
export EDITOR='vim' | |
export PAGER='most' | |
export SHELL='/bin/zsh' | |
PATH=./bin:$HOME/bin:$PATH:/usr/sbin:/opt/kde/bin:/opt/openoffice/program | |
BC_ENV_ARGS="-q -l /home/rando/.bc/extensions.bc" |
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
! |
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 service_descriptor | |
resp = http.resource(@service_descriptor_uri, default_headers).get | |
unless resp.is_not_modified? || (resp.is_success? && !resp.authoritative?) | |
@service_descriptor = JSON.parse(resp.body) | |
end | |
return @service_descriptor | |
end | |
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
diff --git a/merb-auth/merb-auth-core/lib/merb-auth-core/authenticated_helper.rb b/merb-auth/merb-auth-core/lib/merb-auth-core/authenticated_helper.rb | |
index 24a39d4..b649d94 100644 | |
--- a/merb-auth/merb-auth-core/lib/merb-auth-core/authenticated_helper.rb | |
+++ b/merb-auth/merb-auth-core/lib/merb-auth-core/authenticated_helper.rb | |
@@ -31,8 +31,8 @@ module Merb | |
def ensure_authenticated(*strategies) | |
session.authenticate!(request, params, *strategies) unless session.authenticated? | |
auth = session.authentication | |
+ self.headers.merge!(auth.headers) | |
if auth.halted? |
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.all(query = {}) | |
if query.has_key?(:visible_to?) | |
account = query.delete(:visible_to?) | |
end | |
set = super | |
set.select { |o| o.visible_to?(account) } | |
end |
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
match('/templates'). | |
to(:controller => 'templates', :action => 'index'). | |
name(:templates) | |
match('/templates/:id', :id => /.+/). | |
to(:controller => 'templates', :action => 'show'). | |
name(:template) | |
# TODO Use this instead once carllerche fixes the route generation order | |
# resources :templates, :id => /.+/ do | |
# resources :questions, :keys => :name, :name => /.+/ |
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
# Request specs in rails | |
def perform(method, path, params, headers) | |
#why the hell is Integration::Session#process a private method? | |
self.send(method, path, params, headers) | |
end | |
# Use it like: | |
perform(:get, '/', {}, {}) |
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 'POST SSKJ1 to /privileges', :type => 'service' do | |
extend ServiceHelpers::Group | |
include ServiceHelpers::Example | |
def post_privilege(pairs = {}) | |
post_sskj1(privileges_url, privilege_sskj1_json(pairs)) | |
end | |
request do |attributes| |
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 'POST SSKJ1 to /privileges', :type => 'service' do | |
request { |attributes| | |
post_sskj1(privileges_url, privilege_sskj1_json(attributes)) | |
} | |
should_be_created | |
should_require_pairs :name | |
should_ignore_pairs :href, :id, :_type |
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.join(File.dirname(__FILE__), 'privilege_shared_specs') | |
describe 'POST SSKJ1 to /privileges', :type => 'service' do | |
request { |attributes| | |
post_sskj1(privileges_url, privilege_sskj1_json(attributes)) | |
} | |
should_be_created | |