- nodes have fields - fields know from whence them came - how to paginate collections Source.all.page(2).per(10) - find by name/slug Source.find(name) source.save(message) editing... todo: - nodes can be edited - assume git - know from whence all data came - @loaded[path] => key - maybe just node.save!(message) loop do # commit git add --all . git commit -m message -- . git reset --hard OR git checkout -f retry end loop git push git pull # publish git checkout --ours -- . git add --all . git commit -F .git/MERGE_MSG git push end - ./assets - @attributes, @sources, @urls - ro::model class Post < Ro::Model root 'ro' directory 'posts' attributes( ) files( 'bio.md.erb' ) assets( 'logo.jpg' ) sources( 'a.rb' ) schema { attribute :first_name attribute :last_name template 'bio.html.erb' } :attributes => { :first_name => nil, }, 'templates' => { 'bio.html.erb' }, assets ) def Post.find(*args) end def Post.where(*args) end def save saved = ( save_attributes && save_files && save_assets && save_sources commit ) end end - helper/model extension ? Ro.helper(:posts) do end Ro.model(:posts) do end Post = Ro.model(:posts) Post.class_eval do end - a real live test suite done: - load all asset urls - asset loading and url generation - ./bin/ro shell - binding of all nodes? - need source file loading - attribute templates - need relationships - ro.posts.related - ro.posts.related.tags - ro.posts.related[:tags] - ro.posts.first.related.tags - ro.posts.first.related[:tags] - to_ary should not cause loading to fire - node_sets - ro -> node_set - ro.posts -> node_set - ro.posts - should rollection be 'directory.ls' - basic lib structure - awesome tilt methods - an extremely clever cache - instrument logging/debugging ro # all nodes ro.posts #=> set of all post nodes ro.posts.tags #=> set of all tags related to any post ro.tags.posts #=> set of all posts related to any tag ro.posts{ name == 'foobar' } ro.posts.first.tags ro.posts.page(10, :per => 10) ro.posts.first.url_for(:foobar) ro/people/foo-bar/attributes.yaml ro/people/foo-bar/attributes.yml ro/people/foo-bar/bio.md ro/people/foo-bar/source/a.rb ro/people/foo-bar/assets/mugshot.png require 'ro/model' ---- class People < Ro::Model root :people end Ro.root Ro.nodes def ro(*args, &block) Ro.nodes(*args, &block) end