ro 1.4.6 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +6 -14
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +43 -0
  4. data/LICENSE +1 -0
  5. data/README.md +120 -112
  6. data/README.md.erb +159 -0
  7. data/Rakefile +129 -78
  8. data/bin/ro +241 -68
  9. data/lib/ro/_lib.rb +95 -0
  10. data/lib/ro/asset.rb +45 -0
  11. data/lib/ro/collection/list.rb +23 -0
  12. data/lib/ro/collection.rb +168 -0
  13. data/lib/ro/config.rb +68 -0
  14. data/lib/ro/error.rb +8 -0
  15. data/lib/ro/klass.rb +25 -0
  16. data/lib/ro/methods.rb +238 -0
  17. data/lib/ro/model.rb +83 -114
  18. data/lib/ro/node.rb +177 -360
  19. data/lib/ro/pagination.rb +7 -4
  20. data/lib/ro/path.rb +225 -0
  21. data/lib/ro/root.rb +52 -31
  22. data/lib/ro/script/builder.rb +221 -0
  23. data/lib/ro/script/console.rb +47 -0
  24. data/lib/ro/script/server.rb +76 -0
  25. data/lib/ro/script.rb +189 -0
  26. data/lib/ro/slug.rb +19 -18
  27. data/lib/ro/template/rouge_formatter.rb +42 -0
  28. data/lib/ro/template.rb +104 -50
  29. data/lib/ro.rb +85 -317
  30. data/public/api/ro/index-1.json +147 -0
  31. data/public/api/ro/index.json +137 -0
  32. data/public/api/ro/posts/first_post/index.json +52 -0
  33. data/public/api/ro/posts/index-1.json +145 -0
  34. data/public/api/ro/posts/index.json +135 -0
  35. data/public/api/ro/posts/second_post/index.json +51 -0
  36. data/public/api/ro/posts/third_post/index.json +51 -0
  37. data/public/ro/posts/first_post/assets/foo/bar/baz.jpg +0 -0
  38. data/public/ro/posts/first_post/assets/foo.jpg +0 -0
  39. data/public/ro/posts/first_post/assets/src/foo/bar.rb +3 -0
  40. data/public/ro/posts/first_post/attributes.yml +2 -0
  41. data/public/ro/posts/first_post/blurb.erb.md +7 -0
  42. data/public/ro/posts/first_post/body.md +16 -0
  43. data/public/ro/posts/first_post/testing.txt +3 -0
  44. data/public/ro/posts/second_post/assets/foo/bar/baz.jpg +0 -0
  45. data/public/ro/posts/second_post/assets/foo.jpg +0 -0
  46. data/public/ro/posts/second_post/assets/src/foo/bar.rb +3 -0
  47. data/public/ro/posts/second_post/attributes.yml +2 -0
  48. data/public/ro/posts/second_post/blurb.erb.md +5 -0
  49. data/public/ro/posts/second_post/body.md +16 -0
  50. data/public/ro/posts/third_post/assets/foo/bar/baz.jpg +0 -0
  51. data/public/ro/posts/third_post/assets/foo.jpg +0 -0
  52. data/public/ro/posts/third_post/assets/src/foo/bar.rb +3 -0
  53. data/public/ro/posts/third_post/attributes.yml +2 -0
  54. data/public/ro/posts/third_post/blurb.erb.md +5 -0
  55. data/public/ro/posts/third_post/body.md +16 -0
  56. data/ro.gemspec +89 -29
  57. metadata +106 -90
  58. data/TODO.md +0 -50
  59. data/lib/ro/blankslate.rb +0 -7
  60. data/lib/ro/cache.rb +0 -26
  61. data/lib/ro/git.rb +0 -374
  62. data/lib/ro/initializers/env.rb +0 -5
  63. data/lib/ro/initializers/tilt.rb +0 -104
  64. data/lib/ro/lock.rb +0 -53
  65. data/lib/ro/node/list.rb +0 -142
  66. 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