ro 1.4.6 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +6 -14
- data/Gemfile +2 -0
- data/Gemfile.lock +43 -0
- data/LICENSE +1 -0
- data/README.md +120 -112
- data/README.md.erb +159 -0
- data/Rakefile +129 -78
- data/bin/ro +241 -68
- data/lib/ro/_lib.rb +95 -0
- data/lib/ro/asset.rb +45 -0
- data/lib/ro/collection/list.rb +23 -0
- data/lib/ro/collection.rb +168 -0
- data/lib/ro/config.rb +68 -0
- data/lib/ro/error.rb +8 -0
- data/lib/ro/klass.rb +25 -0
- data/lib/ro/methods.rb +238 -0
- data/lib/ro/model.rb +83 -114
- data/lib/ro/node.rb +177 -360
- data/lib/ro/pagination.rb +7 -4
- data/lib/ro/path.rb +225 -0
- data/lib/ro/root.rb +52 -31
- data/lib/ro/script/builder.rb +221 -0
- data/lib/ro/script/console.rb +47 -0
- data/lib/ro/script/server.rb +76 -0
- data/lib/ro/script.rb +189 -0
- data/lib/ro/slug.rb +19 -18
- data/lib/ro/template/rouge_formatter.rb +42 -0
- data/lib/ro/template.rb +104 -50
- data/lib/ro.rb +85 -317
- data/public/api/ro/index-1.json +147 -0
- data/public/api/ro/index.json +137 -0
- data/public/api/ro/posts/first_post/index.json +52 -0
- data/public/api/ro/posts/index-1.json +145 -0
- data/public/api/ro/posts/index.json +135 -0
- data/public/api/ro/posts/second_post/index.json +51 -0
- data/public/api/ro/posts/third_post/index.json +51 -0
- data/public/ro/posts/first_post/assets/foo/bar/baz.jpg +0 -0
- data/public/ro/posts/first_post/assets/foo.jpg +0 -0
- data/public/ro/posts/first_post/assets/src/foo/bar.rb +3 -0
- data/public/ro/posts/first_post/attributes.yml +2 -0
- data/public/ro/posts/first_post/blurb.erb.md +7 -0
- data/public/ro/posts/first_post/body.md +16 -0
- data/public/ro/posts/first_post/testing.txt +3 -0
- data/public/ro/posts/second_post/assets/foo/bar/baz.jpg +0 -0
- data/public/ro/posts/second_post/assets/foo.jpg +0 -0
- data/public/ro/posts/second_post/assets/src/foo/bar.rb +3 -0
- data/public/ro/posts/second_post/attributes.yml +2 -0
- data/public/ro/posts/second_post/blurb.erb.md +5 -0
- data/public/ro/posts/second_post/body.md +16 -0
- data/public/ro/posts/third_post/assets/foo/bar/baz.jpg +0 -0
- data/public/ro/posts/third_post/assets/foo.jpg +0 -0
- data/public/ro/posts/third_post/assets/src/foo/bar.rb +3 -0
- data/public/ro/posts/third_post/attributes.yml +2 -0
- data/public/ro/posts/third_post/blurb.erb.md +5 -0
- data/public/ro/posts/third_post/body.md +16 -0
- data/ro.gemspec +89 -29
- metadata +106 -90
- data/TODO.md +0 -50
- data/lib/ro/blankslate.rb +0 -7
- data/lib/ro/cache.rb +0 -26
- data/lib/ro/git.rb +0 -374
- data/lib/ro/initializers/env.rb +0 -5
- data/lib/ro/initializers/tilt.rb +0 -104
- data/lib/ro/lock.rb +0 -53
- data/lib/ro/node/list.rb +0 -142
- data/notes/ara.txt +0 -215
data/notes/ara.txt
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
-
|
|
3
|
-
node.asset_for(:name)
|
|
4
|
-
|
|
5
|
-
- nodes have fields
|
|
6
|
-
- fields know from whence them came
|
|
7
|
-
|
|
8
|
-
- how to paginate collections
|
|
9
|
-
|
|
10
|
-
Source.all.page(2).per(10)
|
|
11
|
-
|
|
12
|
-
- find by name/slug
|
|
13
|
-
|
|
14
|
-
Source.find(name)
|
|
15
|
-
|
|
16
|
-
source.save(message)
|
|
17
|
-
|
|
18
|
-
editing...
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
todo:
|
|
23
|
-
|
|
24
|
-
- nodes can be edited
|
|
25
|
-
- assume git
|
|
26
|
-
- know from whence all data came
|
|
27
|
-
- @loaded[path] => key
|
|
28
|
-
-
|
|
29
|
-
maybe just node.save!(message)
|
|
30
|
-
|
|
31
|
-
loop do
|
|
32
|
-
|
|
33
|
-
# commit
|
|
34
|
-
git add --all .
|
|
35
|
-
git commit -m message -- .
|
|
36
|
-
|
|
37
|
-
git reset --hard OR git checkout -f
|
|
38
|
-
retry
|
|
39
|
-
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
loop
|
|
45
|
-
|
|
46
|
-
git push
|
|
47
|
-
|
|
48
|
-
git pull
|
|
49
|
-
|
|
50
|
-
# publish
|
|
51
|
-
git checkout --ours -- .
|
|
52
|
-
git add --all .
|
|
53
|
-
git commit -F .git/MERGE_MSG
|
|
54
|
-
git push
|
|
55
|
-
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- ./assets
|
|
60
|
-
|
|
61
|
-
- @attributes, @sources, @urls
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- ro::model
|
|
65
|
-
|
|
66
|
-
class Post < Ro::Model
|
|
67
|
-
root 'ro'
|
|
68
|
-
|
|
69
|
-
directory 'posts'
|
|
70
|
-
|
|
71
|
-
attributes(
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
files(
|
|
75
|
-
'bio.md.erb'
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
assets(
|
|
79
|
-
'logo.jpg'
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
sources(
|
|
83
|
-
'a.rb'
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
schema {
|
|
87
|
-
|
|
88
|
-
attribute :first_name
|
|
89
|
-
attribute :last_name
|
|
90
|
-
|
|
91
|
-
template 'bio.html.erb'
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
:attributes => {
|
|
96
|
-
:first_name => nil,
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
'templates' => {
|
|
100
|
-
'bio.html.erb'
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
assets
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
def Post.find(*args)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
def Post.where(*args)
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def save
|
|
113
|
-
saved = (
|
|
114
|
-
save_attributes &&
|
|
115
|
-
save_files &&
|
|
116
|
-
save_assets &&
|
|
117
|
-
save_sources
|
|
118
|
-
commit
|
|
119
|
-
)
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
- helper/model extension ?
|
|
124
|
-
|
|
125
|
-
Ro.helper(:posts) do
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
Ro.model(:posts) do
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
Post = Ro.model(:posts)
|
|
132
|
-
|
|
133
|
-
Post.class_eval do
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
- a real live test suite
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
done:
|
|
140
|
-
- load all asset urls
|
|
141
|
-
- asset loading and url generation
|
|
142
|
-
- ./bin/ro shell
|
|
143
|
-
- binding of all nodes?
|
|
144
|
-
- need source file loading
|
|
145
|
-
- attribute templates
|
|
146
|
-
- need relationships
|
|
147
|
-
- ro.posts.related
|
|
148
|
-
- ro.posts.related.tags
|
|
149
|
-
- ro.posts.related[:tags]
|
|
150
|
-
- ro.posts.first.related.tags
|
|
151
|
-
- ro.posts.first.related[:tags]
|
|
152
|
-
- to_ary should not cause loading to fire
|
|
153
|
-
- node_sets
|
|
154
|
-
- ro -> node_set
|
|
155
|
-
- ro.posts -> node_set
|
|
156
|
-
- ro.posts
|
|
157
|
-
- should rollection be 'directory.ls'
|
|
158
|
-
- basic lib structure
|
|
159
|
-
- awesome tilt methods
|
|
160
|
-
- an extremely clever cache
|
|
161
|
-
- instrument logging/debugging
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
ro # all nodes
|
|
173
|
-
|
|
174
|
-
ro.posts #=> set of all post nodes
|
|
175
|
-
|
|
176
|
-
ro.posts.tags #=> set of all tags related to any post
|
|
177
|
-
|
|
178
|
-
ro.tags.posts #=> set of all posts related to any tag
|
|
179
|
-
|
|
180
|
-
ro.posts{ name == 'foobar' }
|
|
181
|
-
|
|
182
|
-
ro.posts.first.tags
|
|
183
|
-
|
|
184
|
-
ro.posts.page(10, :per => 10)
|
|
185
|
-
|
|
186
|
-
ro.posts.first.url_for(:foobar)
|
|
187
|
-
|
|
188
|
-
ro/people/foo-bar/attributes.yaml
|
|
189
|
-
ro/people/foo-bar/attributes.yml
|
|
190
|
-
ro/people/foo-bar/bio.md
|
|
191
|
-
ro/people/foo-bar/source/a.rb
|
|
192
|
-
ro/people/foo-bar/assets/mugshot.png
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
require 'ro/model'
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
----
|
|
204
|
-
|
|
205
|
-
class People < Ro::Model
|
|
206
|
-
root :people
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
Ro.root
|
|
210
|
-
|
|
211
|
-
Ro.nodes
|
|
212
|
-
|
|
213
|
-
def ro(*args, &block)
|
|
214
|
-
Ro.nodes(*args, &block)
|
|
215
|
-
end
|