Moving things around, combining and splitting ...
This commit is contained in:
parent
b649e10ae8
commit
5dfd9dd7f8
2
ares/cli
Executable file
2
ares/cli
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
exec irb -I./client/lib -rclient --simple-prompt --readline "$@"
|
12
ares/client/lib/client.rb
Normal file
12
ares/client/lib/client.rb
Normal 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
|
@ -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
|
@ -5,4 +5,5 @@ if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
cd $(dirname $(readlink -f $0))
|
||||
export PYTHONPATH="$PWD:$PYTHONPATH"
|
||||
exec aspen -w ./www -a '0.0.0.0:9282'
|
0
ares/server/__init__.py
Normal file
0
ares/server/__init__.py
Normal file
@ -1,5 +1,4 @@
|
||||
|
||||
class PersonModel(object):
|
||||
class Person(object):
|
||||
_people = [
|
||||
{
|
||||
'name': {
|
@ -1,8 +1,8 @@
|
||||
import json
|
||||
from person_model import PersonModel
|
||||
from server.person import Person
|
||||
from aspen import Response
|
||||
|
||||
__people__ = PersonModel()
|
||||
__people__ = Person()
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from person_model import PersonModel
|
||||
__people__ = PersonModel()
|
||||
from server.person import Person
|
||||
__people__ = Person()
|
||||
|
||||
response.body = {'person': __people__.get(int(path['id']))}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user