Moving things around, combining and splitting ...

This commit is contained in:
Dan Buch 2012-05-18 07:49:25 -04:00
parent b649e10ae8
commit 5dfd9dd7f8
8 changed files with 20 additions and 22 deletions

2
ares/cli Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
exec irb -I./client/lib -rclient --simple-prompt --readline "$@"

12
ares/client/lib/client.rb Normal file
View File

@ -0,0 +1,12 @@
require 'active_resource'
require 'awesome_print'
SITE = 'http://localhost:9282' unless defined?(SITE)
class Person < ActiveResource::Base
self.site = SITE
end
class Family < ActiveResource::Base
self.site = SITE
end

View File

@ -1,16 +0,0 @@
require 'active_resource'
require 'awesome_print'
class Person < ActiveResource::Base
self.site = 'http://localhost:9282'
end
def main
Person.all.each do |person|
ap person
end
end
if $0 == __FILE__
main
end

View File

@ -5,4 +5,5 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
cd $(dirname $(readlink -f $0)) cd $(dirname $(readlink -f $0))
export PYTHONPATH="$PWD:$PYTHONPATH"
exec aspen -w ./www -a '0.0.0.0:9282' exec aspen -w ./www -a '0.0.0.0:9282'

0
ares/server/__init__.py Normal file
View File

View File

@ -1,5 +1,4 @@
class Person(object):
class PersonModel(object):
_people = [ _people = [
{ {
'name': { 'name': {

View File

@ -1,8 +1,8 @@
import json import json
from person_model import PersonModel from server.person import Person
from aspen import Response from aspen import Response
__people__ = PersonModel() __people__ = Person()

View File

@ -1,5 +1,5 @@
from person_model import PersonModel from server.person import Person
__people__ = PersonModel() __people__ = Person()
response.body = {'person': __people__.get(int(path['id']))} response.body = {'person': __people__.get(int(path['id']))}