Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
use activesupport for autoloading
  • Loading branch information
iwamot committed Aug 3, 2008
1 parent cde42f9 commit ced35b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 67 deletions.
78 changes: 12 additions & 66 deletions lib/pinto.rb
Expand Up @@ -5,9 +5,21 @@
require 'pinto/string'
require 'rubygems'

module Pinto
VERSION = [0, 0, 1]

def self.version
return VERSION.join('.')
end
end

autoload :DBI, 'dbi'
autoload :YAML, 'yaml'

gem 'activesupport'
require 'active_support'
Dependencies.load_paths << 'lib'

gem 'addressable'
module Addressable
autoload :URI, 'addressable/uri'
Expand All @@ -27,71 +39,5 @@ module Store
end
end

module Pinto
autoload :Config, 'pinto/config'
autoload :Dispatcher, 'pinto/dispatcher'
autoload :Language, 'pinto/language'
autoload :OpenID, 'pinto/open_id'
autoload :Request, 'pinto/request'
autoload :Translate, 'pinto/translate'
autoload :View, 'pinto/view'

module Controller
=begin
autoload :Index, 'pinto/controller/index'
autoload :SignupAccount, 'pinto/controller/signup_account'
autoload :SignupAuth, 'pinto/controller/signup_auth'
autoload :SignupOpenid, 'pinto/controller/signup_openid'
=end

module Private
autoload :Base, 'pinto/controller/private/base'
autoload :Error, 'pinto/controller/private/error'
autoload :Multiple, 'pinto/controller/private/multiple'
end
end

module Encoding
autoload :UTF8, 'pinto/encoding/utf8'
end

module Helper
autoload :HTML, 'pinto/helper/html'
autoload :Translate, 'pinto/helper/translate'
autoload :URI, 'pinto/helper/uri'
end

module Model
autoload :SignupReservation, 'pinto/model/signup_reservation'
autoload :User, 'pinto/model/user'
end

module Type
autoload :ClaimedID, 'pinto/type/claimed_id'
autoload :ConfigKey, 'pinto/type/config_key'
autoload :ControllerName, 'pinto/type/controller_name'
autoload :EscapeChars, 'pinto/type/escape_chars'
autoload :ErrorMessage, 'pinto/type/error_message'
autoload :HttpStatusCode, 'pinto/type/http_status_code'
autoload :Language, 'pinto/type/language'
autoload :QueryStrings, 'pinto/type/query_strings'
autoload :URI, 'pinto/type/uri'
autoload :UriMap, 'pinto/type/uri_map'
autoload :UserName, 'pinto/type/user_name'
autoload :UserSuppliedID, 'pinto/type/user_supplied_id'
autoload :ViewName, 'pinto/type/view_name'
autoload :ViewParam, 'pinto/type/view_param'
end

module URI
autoload :ExpandProcessor, 'pinto/uri/expand_processor'
autoload :ExtractProcessor, 'pinto/uri/extract_processor'
end

class View
autoload :XHTML, 'pinto/view/xhtml'
end
end

gem 'rack'
autoload :Rack, 'rack'
1 change: 0 additions & 1 deletion lib/pinto/dispatcher.rb
Expand Up @@ -30,7 +30,6 @@ def call(env)

controller_name = request.get_controller_name.to_s
path = Pathname.new("pinto/controller/#{controller_name}")
require path
return path.get_class.new.run(request)

=begin
Expand Down

0 comments on commit ced35b6

Please sign in to comment.