Permalink
Browse files

Switch to Composer for dependencies.

  • Loading branch information...
1 parent 1c05db5 commit 01e196164711af15ce2982924ffdbcb988a344d6 @bobthecow committed May 17, 2012
Showing with 33 additions and 20 deletions.
  1. +2 −0 .gitignore
  2. +0 −3 .gitmodules
  3. +6 −0 .travis.yml
  4. +20 −0 composer.json
  5. +5 −16 tests/bootstrap.php
  6. +0 −1 vendor/pimple
View
@@ -0,0 +1,2 @@
+vendor
+composer.lock
View
@@ -1,3 +0,0 @@
-[submodule "vendor/pimple"]
- path = vendor/pimple
- url = https://github.com/fabpot/Pimple.git
View
@@ -1,4 +1,10 @@
language: php
+
php:
+ - 5.3.0
- 5.3
- 5.4
+
+before_script:
+ - wget http://getcomposer.org/composer.phar
+ - php composer.phar install
View
@@ -0,0 +1,20 @@
+{
+ "name": "bobthecow/ruler",
+ "description": "A simple stateless production rules engine for PHP 5.3.",
+ "keywords": ["rules", "engine"],
+ "homepage": "https://github.com/bobthecow/Ruler",
+ "license": "MIT",
+ "require": {
+ "php": ">=5.3.0",
+ "pimple/pimple": "1.0.*"
+ },
+ "autoload": {
+ "psr-0": { "Ruler": "src/" }
+ },
+ "authors": [
+ {
+ "name": "Justin Hileman",
+ "email": "justin@justinhileman.info"
+ }
+ ]
+}
View
@@ -1,20 +1,9 @@
<?php
-require_once __DIR__ . '/../vendor/pimple/lib/Pimple.php';
+require_once dirname(__DIR__) . '/vendor/autoload.php';
-spl_autoload_register(function($class)
-{
- if (0 === strpos($class, 'Ruler\\Test\\')) {
- $file = __DIR__ . '/../tests/' . str_replace('\\', '/', $class) . '.php';
- if (file_exists($file)) {
- require_once $file;
- return true;
- }
- } elseif (0 === strpos($class, 'Ruler\\')) {
- $file = __DIR__ . '/../src/' . str_replace('\\', '/', $class) . '.php';
- if (file_exists($file)) {
- require_once $file;
- return true;
- }
- }
+call_user_func(function() {
+ $loader = new \Composer\Autoload\ClassLoader();
+ $loader->add('Ruler\Test', __DIR__);
+ $loader->register();
});
Submodule pimple deleted from 7133d9

0 comments on commit 01e1961

Please sign in to comment.