Skip to content
Browse files

now we run on rubinius, yay

  • Loading branch information...
1 parent e01c135 commit 5fef854c53970f1872bd36bdfee7150efe0f4964 @rkh committed
Showing with 49 additions and 43 deletions.
  1. +4 −0 Rakefile
  2. +3 −1 config.rb
  3. +2 −2 config.ru
  4. +1 −0 lib/bithug.rb
  5. +1 −1 lib/bithug/git.rb
  6. +2 −2 lib/bithug/hpi.rb
  7. +1 −1 lib/bithug/kerberos.rb
  8. +1 −1 lib/bithug/ldap.rb
  9. +1 −1 lib/bithug/local.rb
  10. +31 −32 lib/bithug/service_helper.rb
  11. +1 −1 lib/bithug/svn.rb
  12. +1 −1 lib/bithug/user.rb
View
4 Rakefile
@@ -1,5 +1,9 @@
$LOAD_PATH.unshift("lib", *Dir.glob("vendor/*/lib"))
+require "rake/clean"
+CLEAN.include "**/*.rbc"
+CLOBBER.include "*.gem"
+
task :default do
sh "git submodule init -q && git submodule update"
Rake::Task["spec"].invoke
View
4 config.rb
@@ -1,5 +1,7 @@
Bithug.configure do
# use Twitter, :except => Repository
# use Ldap, :host => "ldap.com", :port => 10
- use :Hpi
+ use :Local
+ use :Svn
+ use :Git
end
View
4 config.ru
@@ -1,3 +1,3 @@
require "init"
-Bithug.set :environment, :production
-run Bithug
+Bithug::Webserver.set :environment, :production
+run Bithug::Webserver
View
1 lib/bithug.rb
@@ -1,6 +1,7 @@
require "ohm"
require "monkey"
require "backports"
+require "bithug/service_helper"
Monkey.backend = :backports
View
2 lib/bithug/git.rb
@@ -1,6 +1,6 @@
module Bithug::Git
module Repository
- include ServiceHelper
+ include Bithug::ServiceHelper
def create_repository
super if vcs.to_s != "git"
View
4 lib/bithug/hpi.rb
@@ -2,12 +2,12 @@
module Bithug::Hpi
module Repository
- include ServiceHelper
+ include Bithug::ServiceHelper
stack Git::Repository, Svn::Repository
end
module User
- include ServiceHelper
+ include Bithug::ServiceHelper
attribute :real_name
attribute :email
View
2 lib/bithug/kerberos.rb
@@ -2,7 +2,7 @@
module Bithug::Kerberos
module User
- include ServiceHelper
+ include Bithug::ServiceHelper
class_methods do
def authenticate(username, password)
View
2 lib/bithug/ldap.rb
@@ -12,7 +12,7 @@ def self.setup(options = {})
end
module User
- include ServiceHelper
+ include Bithug::ServiceHelper
class_methods do
def authenticate(username, password)
Bithug::Ldap.connection.auth username, password
View
2 lib/bithug/local.rb
@@ -53,7 +53,7 @@ def self.store_local_users
end
module User
- include ServiceHelper
+ include Bithug::ServiceHelper
# This agent authenticates against the
# local database
View
63 lib/bithug/service_helper.rb
@@ -1,38 +1,37 @@
-require "bithug"
+module Bithug
+ module ServiceHelper
+ module ClassMethods
+
+ def postpone(*names)
+ names.each { |name| eval "def #{name}(*a,&b); postponed << [__method__, a, b]; end" }
+ end
+
+ def postponed
+ @postponed ||= []
+ end
+
+ def stack(*modules)
+ modules.reverse_each { |m| include m }
+ end
+
+ def included(klass)
+ super
+ klass.extend class_methods
+ postponed.each { |m,a,b| klass.send(m, *a, &b) }
+ end
+
+ def class_methods(&block)
+ const_set(:ClassMethods, Module.new) unless const_defined? :ClassMethods
+ @class_methods ||= const_get(:ClassMethods)
+ block ? @class_methods.class_eval(&block) : @class_methods
+ end
-module Bithug::ServiceHelper
- module ClassMethods
-
- def postpone(*names)
- names.each { |name| eval "def #{name}(*a,&b); postponed << [__method__, a, b]; end" }
- end
-
- def postponed
- @postponed ||= []
- end
-
- def stack(*modules)
- modules.reverse_each { |m| include m }
end
-
- def included(klass)
+
+ def self.included(klass)
super
- klass.extend class_methods
- postponed.each { |m,a,b| klass.send(m, *a, &b) }
+ klass.extend Bithug::ServiceHelper::ClassMethods
+ klass.postpone :attribute, :set, :index
end
-
- def class_methods(&block)
- const_set(:ClassMethods, Module.new) unless const_defined? :ClassMethods
- @class_methods ||= const_get(:ClassMethods)
- block ? @class_methods.class_eval(&block) : @class_methods
- end
-
- end
-
- def self.included(klass)
- super
- klass.extend Bithug::ServiceHelper::ClassMethods
- klass.postpone :attribute, :set, :index
end
-
end
View
2 lib/bithug/svn.rb
@@ -5,7 +5,7 @@
# and this repo type can add an attribute to the model
module Bithug::Svn
module Repository
- include ServiceHelper
+ include Bithug::ServiceHelper
attribute :remote
View
2 lib/bithug/user.rb
@@ -7,7 +7,7 @@ class User < Ohm::Model
# A user of Bithug - nice and pretty
module AbstractUser
- include ServiceHelper
+ include Bithug::ServiceHelper
attribute :name
set :following, Bithug::User

0 comments on commit 5fef854

Please sign in to comment.
Something went wrong with that request. Please try again.