Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
couple of small cleanups for load paths and such
Browse files Browse the repository at this point in the history
  • Loading branch information
atmos committed Nov 12, 2009
1 parent c621e77 commit bc4d092
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -20,7 +20,7 @@ only :test do
gem 'dm-sweatshop', '~>0.9.11'
gem 'randexp'
gem 'ParseTree', :require_as => 'parse_tree'
gem 'bundler', '>=0.6.0'
gem 'bundler', '>=0.7.0'
end

disable_system_gems
16 changes: 6 additions & 10 deletions lib/hancock.rb
Expand Up @@ -13,14 +13,10 @@
require 'json'
require 'rack/contrib/accept_format'

lib_dir = File.expand_path(File.join(File.dirname(__FILE__), 'hancock'))
$:.push File.expand_path(File.join(File.dirname(__FILE__)))

%w(sessions sso).each do |lib|
require File.join(lib_dir, 'sso', 'helpers', lib)
require File.join(lib_dir, 'sso', lib)
end
require File.join(lib_dir, 'api')
require File.join(lib_dir, 'sso')
require File.join(lib_dir, 'models', 'model')
require File.join(lib_dir, 'models', 'user')
require File.join(lib_dir, 'models', 'consumer')
require 'hancock/api'
require 'hancock/sso'
require 'hancock/models/model'
require 'hancock/models/user'
require 'hancock/models/consumer'
2 changes: 1 addition & 1 deletion lib/hancock/api/consumer.rb
@@ -1,7 +1,7 @@
module Hancock
module API
module Consumers
class App < Hancock::API::JSON::App
class App < JSON::App
get '/consumers.json' do
Hancock::Consumer.all.map { |consumer| consumer.attributes_for_api }.to_json
end
Expand Down
2 changes: 1 addition & 1 deletion lib/hancock/api/user.rb
@@ -1,7 +1,7 @@
module Hancock
module API
module Users
class App < Hancock::API::JSON::App
class App < JSON::App
get '/users.json' do
Hancock::User.all.map { |user| user.attributes_for_api }.to_json
end
Expand Down
8 changes: 6 additions & 2 deletions lib/hancock/sso.rb
@@ -1,12 +1,16 @@
require 'hancock/sso/helpers/sessions'
require 'hancock/sso/sessions'

require 'hancock/sso/helpers/sso'
require 'hancock/sso/sso'

module Hancock
module SSO
def self.app
@app ||= Rack::Builder.app do
run ::Hancock::SSO::App
end
end
class ConfigurationError < StandardError; end

class App < Sinatra::Base
disable :show_exceptions

Expand Down
1 change: 0 additions & 1 deletion spec/helpers/app.rb
Expand Up @@ -14,7 +14,6 @@ def landing_page
end
def self.registered(app)
app.helpers Helpers
app.set :sessions, true
app.get '/' do
ensure_authenticated
@consumers = ::Hancock::Consumer.visible
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/fixtures.rb
Expand Up @@ -38,5 +38,5 @@

Hancock::Consumer.fix(:hidden) {{
:url => 'http://localhost:9292/login',
:internal => false
:internal => true
}}

0 comments on commit bc4d092

Please sign in to comment.