public
Description: rubyisms in php
Homepage:
Clone URL: git://github.com/shuber/phuby.git
phuby /
name age message
file .gitignore Wed Mar 11 15:14:25 -0700 2009 Remove trailing line breaks from some files [shuber]
file README.markdown Thu Jun 11 14:47:55 -0700 2009 Huge refactor [shuber]
directory doc/ Tue Jul 07 15:36:23 -0700 2009 Update proc class [shuber]
directory lib/ Tue Jul 07 15:36:23 -0700 2009 Update proc class [shuber]
file phuby.php Fri Jun 19 13:48:25 -0700 2009 Add Phuby class which handles environment logic [shuber]
directory spec/ Thu Jun 11 20:17:53 -0700 2009 Getting all spec running again and merge confli... [speedmax]
directory test/ Tue Jul 07 15:36:23 -0700 2009 Update proc class [shuber]
README.markdown

phuby

rubyisms in php

(pronounced foo-bee)

Installation

git clone git://github.com/shuber/phuby.git

Features

  • A base Object class (all classes should inherit from this)
  • Mixins - Post::extend('Validations');
  • alias_method - Post::alias_method('save_with_validation', 'save');
  • alias_method_chain - Post::alias_method_chain('save', 'validation');
  • Procs - $proc = new Proc('name', 'echo "hello $name";'); $proc->call('Sean');
  • Various classes and modules from the standard ruby library like Enumerable, Arr, Hash, Struct, etc

Usage

require_once 'phuby/phuby.php';

Make sure your classes extend Object

class User extends Object {
    # ...
}

More coming soon...

Testing

Phuby uses SimpleSpec BDD extension to SimpleTest, just download simple test and put it as part of your php include_path or 'phuby/spec/simpletest'

  • SimpleTest
  • SimpleSpec class

please run spec/runner.php

Contact

Problems, comments, and suggestions all welcome: shuber@huberry.com