infod 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/infod +37 -0
- data/config.ru +3 -0
- data/infod/Es/fs.rb +154 -0
- data/infod/Es/groonga.rb +101 -0
- data/infod/Es/redis.rb +3 -0
- data/infod/Es/sqlite.rb +3 -0
- data/infod/Es.rb +67 -0
- data/infod/H.rb +29 -0
- data/infod/K.rb +197 -0
- data/infod/N.rb +248 -0
- data/infod/Rb.rb +71 -0
- data/infod/Th/404.rb +55 -0
- data/infod/Th/500.rb +10 -0
- data/infod/Th/GET.rb +132 -0
- data/infod/Th/HEAD.rb +5 -0
- data/infod/Th/PATCH.rb +5 -0
- data/infod/Th/POST.rb +19 -0
- data/infod/Th/local.rb +22 -0
- data/infod/Th/uid.rb +24 -0
- data/infod/Th.rb +110 -0
- data/infod/W/audio.rb +56 -0
- data/infod/W/blog.rb +3 -0
- data/infod/W/cal.rb +110 -0
- data/infod/W/chat.rb +81 -0
- data/infod/W/color.rb +28 -0
- data/infod/W/core.rb +77 -0
- data/infod/W/css.rb +24 -0
- data/infod/W/csv.rb +13 -0
- data/infod/W/du.rb +35 -0
- data/infod/W/edit.rb +8 -0
- data/infod/W/examine/examine.rb +59 -0
- data/infod/W/examine/exhibit.rb +34 -0
- data/infod/W/examine/hist.rb +55 -0
- data/infod/W/examine/history.rb +19 -0
- data/infod/W/examine/normal.rb +31 -0
- data/infod/W/examine/protovis.rb +30 -0
- data/infod/W/examine/sw.rb +114 -0
- data/infod/W/examine/time/graph.rb +86 -0
- data/infod/W/examine/time/line.rb +24 -0
- data/infod/W/feed.rb +116 -0
- data/infod/W/find.rb +24 -0
- data/infod/W/forum.rb +3 -0
- data/infod/W/grep.rb +27 -0
- data/infod/W/html.rb +143 -0
- data/infod/W/image.rb +61 -0
- data/infod/W/json.rb +44 -0
- data/infod/W/kv.rb +66 -0
- data/infod/W/ls.rb +50 -0
- data/infod/W/mail.rb +248 -0
- data/infod/W/page.rb +30 -0
- data/infod/W/pdf.rb +16 -0
- data/infod/W/post.rb +9 -0
- data/infod/W/rdf.rb +32 -0
- data/infod/W/schema.rb +172 -0
- data/infod/W/search.rb +33 -0
- data/infod/W/shell.rb +30 -0
- data/infod/W/source.rb +35 -0
- data/infod/W/table.rb +87 -0
- data/infod/W/text.rb +94 -0
- data/infod/W/tree.rb +26 -0
- data/infod/W/vfs.rb +175 -0
- data/infod/W/wiki.rb +18 -0
- data/infod/W.rb +34 -0
- data/infod/Y.rb +17 -0
- data/infod/infod.rb +13 -0
- data/infod.rb +13 -0
- metadata +129 -0
data/infod/W/source.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
class E
|
2
|
+
|
3
|
+
# show available querystring aliases
|
4
|
+
fn '/qs/GET',->e,r{H([H.css('/css/404'),F['?'].html]).hR}
|
5
|
+
|
6
|
+
def triplrSourceCode
|
7
|
+
# MIME strip x-
|
8
|
+
m = mime.split(/\//)[-1].sub(/^x-/,'')
|
9
|
+
|
10
|
+
# show line numbers?
|
11
|
+
n = @r.has_key?('n') && "--line-number-ref=#{uri.sh}"
|
12
|
+
|
13
|
+
yield uri,Content,
|
14
|
+
`source-highlight -f html -o STDOUT -i #{sh} -s #{m} #{n}`
|
15
|
+
end
|
16
|
+
|
17
|
+
fn 'view/code',->d,e{[{_: :style, c: 'body{background-color:white;color:black}'},
|
18
|
+
d.values.map{|r|[r.E.do{|e|[{_: :a,name: e.uri},e.html(e.base,true)]},'<br>',
|
19
|
+
r[Content]]}]}
|
20
|
+
|
21
|
+
# ls /usr/share/source-highlight/*.lang | xargs -i basename {} .lang | tr "\n" " "
|
22
|
+
%w{ada applescript asm awk bat bib bison caml changelog c clipper cobol conf cpp csharp css desktop diff d erlang errors flex fortran function glsl haskell haskell_literate haxe html html_simple java javascript key_string langdef latex ldap lisp log logtalk lsm lua m4 makefile manifest nohilite number outlang oz pascal pc perl php postscript prolog properties proto python ruby scala script_comment sh slang sml spec sql style symbols tcl texinfo todo url vala vbscript xml}
|
23
|
+
.map{|l|
|
24
|
+
ma = 'application/' + l
|
25
|
+
mt = 'text/x-' + l
|
26
|
+
# extension -> MIME
|
27
|
+
MIME[l.to_sym] ||= ma
|
28
|
+
# triplr/view mappings
|
29
|
+
[ma,mt].map{|m|
|
30
|
+
MIMEsource[m] ||= [:triplrSourceCode]
|
31
|
+
|
32
|
+
fn 'view/'+m, F['view/code']
|
33
|
+
}}
|
34
|
+
|
35
|
+
end
|
data/infod/W/table.rb
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
#watch __FILE__
|
2
|
+
class E
|
3
|
+
|
4
|
+
# property selector toolbar
|
5
|
+
fn 'view/p',->d,e{
|
6
|
+
[H.once(e,'property.toolbar',H.once(e,'p',(H.once e,:mu,H.js('/js/mu')),
|
7
|
+
H.js('/js/p'),
|
8
|
+
H.css('/css/table')),
|
9
|
+
{_: :a, href: '#', c: '-', id: :hideP},
|
10
|
+
{_: :a, href: '#', c: '+', id: :showP},
|
11
|
+
{_: :span, id: 'properties',
|
12
|
+
c: E.graphProperties(d).map{|k|
|
13
|
+
{_: :a, class: :n, href: k, c: k.label+' '}}},
|
14
|
+
{_: :style, id: :pS},
|
15
|
+
{_: :style, id: :lS}),
|
16
|
+
(Fn 'view/'+(e.q['pv']||'tab'),d,e)]}
|
17
|
+
|
18
|
+
# table layout, sparse matrix of rows/cols - see table/elements for usage
|
19
|
+
fn 'view/t',->d,e,l=nil,a=nil{
|
20
|
+
[H.once(e,'table',H.css('/css/table')),
|
21
|
+
{_: :table, c:
|
22
|
+
{_: :tbody, c: (Fn 'table/'+(l||e.q['table']),d).do{|t|
|
23
|
+
rx = t.keys.max
|
24
|
+
rm = t.keys.min
|
25
|
+
c = t.values.map(&:keys)
|
26
|
+
cm = c.map(&:min).min
|
27
|
+
cx = c.map(&:max).max
|
28
|
+
(rm..rx).map{|r|
|
29
|
+
{_: :tr, c:
|
30
|
+
t[r].do{|r|
|
31
|
+
(cm..cx).map{|c|
|
32
|
+
r[c].do{|c|
|
33
|
+
{_: :td, class: :cell, c:(Fn 'view/'+(a||e.q['cellview']),c,e)}
|
34
|
+
}||{_: :td}}}}}}}}]}
|
35
|
+
|
36
|
+
# a simple tabular view
|
37
|
+
fn 'view/table',->i,e{
|
38
|
+
[H.css('/css/table'),
|
39
|
+
(Fn 'table',i.values,e)]}
|
40
|
+
|
41
|
+
F['view/tab']=F['view/table']
|
42
|
+
|
43
|
+
fn 'table',->es,q=nil{
|
44
|
+
ks = {} # predicate table
|
45
|
+
es.map{|e|e.respond_to?(:keys) &&
|
46
|
+
e.keys.map{|k|ks[k]=true}}
|
47
|
+
keys = ks.keys
|
48
|
+
keys.empty? ? es.html :
|
49
|
+
H({_: :table,:class => :tab,
|
50
|
+
c: [{_: :tr,
|
51
|
+
c: keys.map{|k|
|
52
|
+
{_: :td, class: :label, property: k,
|
53
|
+
c: q ? {_: :a,
|
54
|
+
href: q['REQUEST_PATH']+q.q.except('reverse').merge({'sort'=>k}).merge(q.q.member?('reverse') ? {} : {'reverse'=>true}).qs,
|
55
|
+
c: (Fn 'abbrURI',k)} : k}}},
|
56
|
+
*es.map{|e|
|
57
|
+
{_: :tr, about: e.uri, c:
|
58
|
+
keys.map{|k|
|
59
|
+
{_: :td, property: k, c: e[k].do{|v|
|
60
|
+
(v.class==Array ? v : [v]).map(&:html).join ' '}}}}}]})}
|
61
|
+
|
62
|
+
fn 'table/elements',->d{ m={}
|
63
|
+
g='http://www.daml.org/2003/01/periodictable/PeriodicTable#group'
|
64
|
+
p='http://www.daml.org/2003/01/periodictable/PeriodicTable#period'
|
65
|
+
d.map{|u,r|
|
66
|
+
r[g].do{|g| g = g[0].uri.match(/[0-9]+$/)
|
67
|
+
r[p].do{|p| p = p[0].uri.match(/[0-9]+$/)
|
68
|
+
g && p &&
|
69
|
+
(g = g[0].to_i
|
70
|
+
p = p[0].to_i
|
71
|
+
m[p] ||= {}
|
72
|
+
m[p][g] ||= {}
|
73
|
+
m[p][g][u] = r
|
74
|
+
)}}}
|
75
|
+
m}
|
76
|
+
|
77
|
+
F["?"]||={}
|
78
|
+
F["?"].update({'elements'=>{'view' => 'p','pv' => 't','table' => 'elements', 'cellview' => 'element'}})
|
79
|
+
|
80
|
+
# element
|
81
|
+
fn 'view/element',->d,e{
|
82
|
+
l = d[d.keys[0]]
|
83
|
+
[H.once(e,'elements.css',H.css('/css/elements')),
|
84
|
+
{class: l['http://www.daml.org/2003/01/periodictable/PeriodicTable#classification'].do{|p|p[0].uri.label},
|
85
|
+
c: [l['http://www.daml.org/2003/01/periodictable/PeriodicTable#symbol'],(Fn 'view',d,e)]}]}
|
86
|
+
|
87
|
+
end
|
data/infod/W/text.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#watch __FILE__
|
3
|
+
|
4
|
+
class String
|
5
|
+
def hrefs i=false
|
6
|
+
(partition /(https?:\/\/(\([^)]*\)|[,.]\S|[^\s),.”\'\"<>\]])+)/).do{|p|
|
7
|
+
p[0].gsub('<','<').gsub('>','>')+
|
8
|
+
(p[1].empty?&&''||'<a rel=untyped href='+p[1]+'>'+p[1].do{|p|
|
9
|
+
i && p.match(/(gif|jpg|png|tiff)$/i) &&
|
10
|
+
"<img src=#{p}>" || p
|
11
|
+
}+'</a>')+
|
12
|
+
(p[2].empty?&&''||p[2].hrefs)
|
13
|
+
}
|
14
|
+
rescue
|
15
|
+
self
|
16
|
+
end
|
17
|
+
def camelToke
|
18
|
+
scan /[A-Z]+(?=\b|[A-Z][a-z])|[A-Z]?[a-z]+/
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class E
|
23
|
+
|
24
|
+
fn 'view/monospace',->d,e{
|
25
|
+
[(H.once e,'text',(H.css '/css/text')),
|
26
|
+
d.values.map{|v|
|
27
|
+
v[Content].do{|c|
|
28
|
+
{class: :text,
|
29
|
+
c: [{_: :a, href: v.url+'?view', c: v.label, style: "background-color:" + E.c},
|
30
|
+
{_: :pre, c: c }]}}}]}
|
31
|
+
|
32
|
+
F['view/'+MIMEtype+'application/word']= F['view/monospace']
|
33
|
+
F['view/'+MIMEtype+'blob'] = F['view/monospace']
|
34
|
+
F['view/'+MIMEtype+'text/plain'] = F['view/monospace']
|
35
|
+
F['view/'+MIMEtype+'text/rtf'] = F['view/monospace']
|
36
|
+
|
37
|
+
fn 'view/'+MIMEtype+'text/nfo',->r,_{r.values.map{|r|{_: :pre,
|
38
|
+
style: 'background-color:#000;padding:2em;color:#fff;float:left;font-family: "Courier New", "DejaVu Sans Mono", monospace; font-size: 13px; line-height: 13px',
|
39
|
+
c: [{_: :a,
|
40
|
+
style: 'color:#0f0;font-size:1.1em;font-weight:bold',
|
41
|
+
c: r.E.bare,
|
42
|
+
href: r.uri+'?view=txt'},
|
43
|
+
'<br>',r[Content]]}}}
|
44
|
+
|
45
|
+
fn 'view/title',->d,e{i=F['view/title/item']
|
46
|
+
d.map{|u,r|[i.(r,e),' ']}}
|
47
|
+
|
48
|
+
fn 'view/title/item',->r,e{{_: :a,href: r.E.url,c:r[e.q['title']||Title],class: :title}}
|
49
|
+
|
50
|
+
# linebreak-delimited list of URIs
|
51
|
+
def triplrUriList
|
52
|
+
open(d).readlines.map{|l|
|
53
|
+
l = l.chomp
|
54
|
+
yield uri, '/link', l
|
55
|
+
yield l, '/link', uri
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# list of uris in a .u doc
|
60
|
+
def uris
|
61
|
+
graph.keys.map &:E
|
62
|
+
end
|
63
|
+
|
64
|
+
def triplrANSI
|
65
|
+
yield uri, Content, `cat #{sh} | aha`
|
66
|
+
end
|
67
|
+
|
68
|
+
def triplrRTF
|
69
|
+
yield uri, Content, `which catdoc && catdoc #{sh}`.hrefs
|
70
|
+
end
|
71
|
+
|
72
|
+
def triplrWord
|
73
|
+
yield uri, Content, `which antiword && antiword #{sh}`.hrefs
|
74
|
+
end
|
75
|
+
|
76
|
+
fn Render+'text/plain',->d,_=nil{
|
77
|
+
d.map{|u,r|# each resource
|
78
|
+
[u,"\n", # subject URI
|
79
|
+
r.map{|k,v| # each predicate
|
80
|
+
p = k.split(/[\/#]/)[-1] # predicate
|
81
|
+
k == 'uri' || # already displayed
|
82
|
+
[" "*(16-p.size).min(1),p," ", # align objects
|
83
|
+
(v.class==Array ? v:[v]).map{|v|# each object
|
84
|
+
v.respond_to?(:uri) ? v.uri : # object-URI
|
85
|
+
v.to_s. # object-content
|
86
|
+
gsub(/<\/*(br|p|div)[^>]*>/,"\n"). # add linebreaks
|
87
|
+
gsub(/<a.*?href="*([^'">\s]+)[^>]*>/,'\1 '). # unwrap links
|
88
|
+
gsub(/<[^>]+>/,''). # remove HTML
|
89
|
+
gsub(/\n+/,"\n")}. # collapse empty space
|
90
|
+
intersperse(' '),"\n"]},"\n"]}.join} # collate
|
91
|
+
|
92
|
+
fn Render+'text/uri',->d,_=nil{d.keys.join "\n"}
|
93
|
+
|
94
|
+
end
|
data/infod/W/tree.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
class E
|
2
|
+
|
3
|
+
fn 'view/tree',->d,e{ t={}; c={}
|
4
|
+
d.map{|u,r| l=t
|
5
|
+
u.split(/[\/#]/).
|
6
|
+
map{|s|
|
7
|
+
l=(l[s] ||= {})}
|
8
|
+
l['#']={u => r}}
|
9
|
+
r=->t,d=0{
|
10
|
+
t.except('#').map{|k,t_|
|
11
|
+
{_: :div, class: :branch,style: 'background-color:'+(c[d]||=E.c),
|
12
|
+
c: [t_['#'].do{|t|Fn 'view/'+e.q['treev'],t,e}||k,r.(t_,d+1)]}}}
|
13
|
+
[(H.once e,'tree',(H.css '/css/tree')),r.(t)]}
|
14
|
+
|
15
|
+
fn 'view/treeR',->d,e{ t={}; c={}
|
16
|
+
d.map{|_,r| r.map{|p,o| l = t
|
17
|
+
p.split(/[\/#]/).map{|s|l=(l[s]||={})}
|
18
|
+
l['#']||=[]
|
19
|
+
l['#'].push o}}
|
20
|
+
r=->t,d=0{
|
21
|
+
t.except('#').map{|k,t_|
|
22
|
+
{_: :div, class: :branch,style: 'background-color:'+(c[d]||=E.c),
|
23
|
+
c: ['<b>',k,'</b>',{class: :treeO,c: t_['#'].html},r.(t_,d+1)]}}}
|
24
|
+
[(H.once e,'tree',(H.css '/css/tree')),r.(t)]}
|
25
|
+
|
26
|
+
end
|
data/infod/W/vfs.rb
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
%w{date digest/sha1 fileutils json open-uri pathname}.each{|r|require(r)}
|
2
|
+
|
3
|
+
class E
|
4
|
+
|
5
|
+
def d
|
6
|
+
node.to_s
|
7
|
+
end
|
8
|
+
|
9
|
+
def node
|
10
|
+
Pathname.new FSbase + path
|
11
|
+
end
|
12
|
+
alias_method :no, :node
|
13
|
+
|
14
|
+
# glob :: pattern -> [E]
|
15
|
+
def glob p=""
|
16
|
+
(Pathname.glob d + p).map &:E
|
17
|
+
end
|
18
|
+
fn 'set/glob',->d,e,m{d.glob}
|
19
|
+
fn 'graph/glob',->d,e,m{d.glob.map{|c|c.fromStream m, :triplrInode, false}}
|
20
|
+
|
21
|
+
def parent
|
22
|
+
E Pathname.new(uri).parent
|
23
|
+
end
|
24
|
+
|
25
|
+
def siblings
|
26
|
+
parent.c
|
27
|
+
end
|
28
|
+
|
29
|
+
def jail
|
30
|
+
no.expand_path.to_s.index(E::FSbase)==0 && @r['PATH_INFO'] !~ /\.\./ && self
|
31
|
+
end
|
32
|
+
|
33
|
+
def children
|
34
|
+
no.c.map &:E
|
35
|
+
end
|
36
|
+
alias_method :c, :children
|
37
|
+
|
38
|
+
|
39
|
+
# node exists?
|
40
|
+
def exist?
|
41
|
+
no.exist?
|
42
|
+
end
|
43
|
+
alias_method :e, :exist?
|
44
|
+
|
45
|
+
# directory?
|
46
|
+
def d?
|
47
|
+
no.directory?
|
48
|
+
end
|
49
|
+
|
50
|
+
# file?
|
51
|
+
def file?
|
52
|
+
no.file?
|
53
|
+
end
|
54
|
+
alias_method :f, :file?
|
55
|
+
|
56
|
+
# modification time
|
57
|
+
def mtime
|
58
|
+
no.stat.mtime if e
|
59
|
+
end
|
60
|
+
alias_method :m, :mtime
|
61
|
+
|
62
|
+
def triplrInode r=true
|
63
|
+
e && (d? && (yield uri, Posix + 'dir#parent', parent
|
64
|
+
r && c.map{|c| yield uri, Posix + 'dir#child', c})
|
65
|
+
node.stat.do{|s|[:size,:ftype,:mtime].map{|p|
|
66
|
+
yield uri,Stat+p.to_s,(s.send p)}})
|
67
|
+
end
|
68
|
+
|
69
|
+
# create node
|
70
|
+
def dir
|
71
|
+
e || FileUtils.mkdir_p(d)
|
72
|
+
self
|
73
|
+
end
|
74
|
+
|
75
|
+
# create link
|
76
|
+
def ln t
|
77
|
+
t = E(t) # cast bare URI/string to resource
|
78
|
+
if !t.e # destination exists?
|
79
|
+
t.no.dirname.dir # ensure containing dir exists
|
80
|
+
# puts [:ln,uri].join ' '
|
81
|
+
FileUtils.symlink no, t.no # create link
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def touch
|
86
|
+
FileUtils.touch no
|
87
|
+
self
|
88
|
+
end
|
89
|
+
|
90
|
+
def deleteNode
|
91
|
+
puts "-node #{d}" if e
|
92
|
+
no.deleteNode if e
|
93
|
+
self
|
94
|
+
end
|
95
|
+
|
96
|
+
def size
|
97
|
+
no.size
|
98
|
+
end
|
99
|
+
|
100
|
+
def read
|
101
|
+
f ? r : get
|
102
|
+
end
|
103
|
+
|
104
|
+
def get
|
105
|
+
(open uri).read
|
106
|
+
end
|
107
|
+
|
108
|
+
# read file - check if it exists & parse JSON if requested
|
109
|
+
def r p=false
|
110
|
+
if f
|
111
|
+
(p ? JSON.parse(readFile)[0] : readFile)
|
112
|
+
else
|
113
|
+
p ? {} : nil
|
114
|
+
end
|
115
|
+
rescue
|
116
|
+
p ? {} : nil
|
117
|
+
end
|
118
|
+
|
119
|
+
# write file - make sure dir exists & serialize JSON if requested
|
120
|
+
def w o,s=false
|
121
|
+
# puts "write #{uri} #{s}"
|
122
|
+
dirname.dir
|
123
|
+
writeFile (s ? [o].to_json : o)
|
124
|
+
self
|
125
|
+
end
|
126
|
+
|
127
|
+
def writeFile c
|
128
|
+
File.open(d,'w'){|f|f << c}
|
129
|
+
end
|
130
|
+
|
131
|
+
def readFile
|
132
|
+
File.open(d).read
|
133
|
+
end
|
134
|
+
|
135
|
+
def readlink
|
136
|
+
no.symlink? ? no.readlink.E : self
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
class Pathname
|
142
|
+
|
143
|
+
def dir
|
144
|
+
mkpath unless exist?
|
145
|
+
end
|
146
|
+
|
147
|
+
# append to path
|
148
|
+
def a s
|
149
|
+
Pathname.new to_s+s
|
150
|
+
end
|
151
|
+
|
152
|
+
# path -> E
|
153
|
+
def E
|
154
|
+
to_s.force_encoding('UTF-8').pathToURI false
|
155
|
+
end
|
156
|
+
|
157
|
+
def c
|
158
|
+
return [] unless directory?
|
159
|
+
children.delete_if{|n| n.basename.to_s.match /^(\.+|#{E::S})$/}
|
160
|
+
rescue
|
161
|
+
[]
|
162
|
+
end
|
163
|
+
|
164
|
+
def deleteNode
|
165
|
+
FileUtils.send file? ? :rm : :rmdir,self
|
166
|
+
parent.deleteNode if parent.c.empty?
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
class File::Stat
|
172
|
+
def utime
|
173
|
+
mtime.to_i
|
174
|
+
end
|
175
|
+
end
|
data/infod/W/wiki.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
class E
|
2
|
+
|
3
|
+
def triplrMarkdown
|
4
|
+
require 'markdown'
|
5
|
+
yield uri,Content,Markdown.new(r).to_html
|
6
|
+
end
|
7
|
+
|
8
|
+
def triplrOrg
|
9
|
+
require 'org-ruby'
|
10
|
+
r.do{|r|
|
11
|
+
yield uri,Content,Orgmode::Parser.new(r).to_html}
|
12
|
+
end
|
13
|
+
|
14
|
+
def triplrTextile; require 'redcloth'
|
15
|
+
yield uri,Content,RedCloth.new(r).to_html
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/infod/W.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
%w{
|
2
|
+
core
|
3
|
+
vfs
|
4
|
+
audio
|
5
|
+
cal
|
6
|
+
chat
|
7
|
+
color
|
8
|
+
css
|
9
|
+
csv
|
10
|
+
du
|
11
|
+
edit
|
12
|
+
examine/examine
|
13
|
+
feed
|
14
|
+
find
|
15
|
+
grep
|
16
|
+
html
|
17
|
+
image
|
18
|
+
json
|
19
|
+
kv
|
20
|
+
ls
|
21
|
+
mail
|
22
|
+
page
|
23
|
+
post
|
24
|
+
pdf
|
25
|
+
rdf
|
26
|
+
schema
|
27
|
+
search
|
28
|
+
shell
|
29
|
+
source
|
30
|
+
table
|
31
|
+
text
|
32
|
+
tree
|
33
|
+
wiki
|
34
|
+
}.each{|r|require_relative 'W/'+r}
|
data/infod/Y.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
def watch f
|
2
|
+
E::Watch[f]=File.mtime f
|
3
|
+
puts 'dev '+f end
|
4
|
+
|
5
|
+
class E
|
6
|
+
F={}
|
7
|
+
Data={}
|
8
|
+
Watch={}
|
9
|
+
def self.dev; Watch.each{|f,ts|if ts < File.mtime(f); load f end} end
|
10
|
+
def y *a; F[uri].(*a) end
|
11
|
+
end
|
12
|
+
|
13
|
+
# URI named functions
|
14
|
+
def Fn a,*g; E::F[a].(*g) end
|
15
|
+
def fn u,y
|
16
|
+
# E::F[u.to_s] && puts("#{u} redefined")
|
17
|
+
E::F[u.to_s] = y end
|
data/infod/infod.rb
ADDED
data/infod.rb
ADDED
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: infod
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- <carmen@whats-your.name>
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-09-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: thin
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: a data/filesystem web-server
|
31
|
+
email: _@whats-your.name
|
32
|
+
executables:
|
33
|
+
- infod
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- bin/infod
|
38
|
+
- infod.rb
|
39
|
+
- config.ru
|
40
|
+
- infod/Y.rb
|
41
|
+
- infod/H.rb
|
42
|
+
- infod/W.rb
|
43
|
+
- infod/K.rb
|
44
|
+
- infod/Th.rb
|
45
|
+
- infod/W/css.rb
|
46
|
+
- infod/W/json.rb
|
47
|
+
- infod/W/cal.rb
|
48
|
+
- infod/W/color.rb
|
49
|
+
- infod/W/rdf.rb
|
50
|
+
- infod/W/source.rb
|
51
|
+
- infod/W/mail.rb
|
52
|
+
- infod/W/table.rb
|
53
|
+
- infod/W/post.rb
|
54
|
+
- infod/W/forum.rb
|
55
|
+
- infod/W/audio.rb
|
56
|
+
- infod/W/examine/time/graph.rb
|
57
|
+
- infod/W/examine/time/line.rb
|
58
|
+
- infod/W/examine/examine.rb
|
59
|
+
- infod/W/examine/sw.rb
|
60
|
+
- infod/W/examine/protovis.rb
|
61
|
+
- infod/W/examine/exhibit.rb
|
62
|
+
- infod/W/examine/hist.rb
|
63
|
+
- infod/W/examine/normal.rb
|
64
|
+
- infod/W/examine/history.rb
|
65
|
+
- infod/W/pdf.rb
|
66
|
+
- infod/W/feed.rb
|
67
|
+
- infod/W/csv.rb
|
68
|
+
- infod/W/du.rb
|
69
|
+
- infod/W/core.rb
|
70
|
+
- infod/W/wiki.rb
|
71
|
+
- infod/W/image.rb
|
72
|
+
- infod/W/ls.rb
|
73
|
+
- infod/W/schema.rb
|
74
|
+
- infod/W/blog.rb
|
75
|
+
- infod/W/tree.rb
|
76
|
+
- infod/W/grep.rb
|
77
|
+
- infod/W/vfs.rb
|
78
|
+
- infod/W/html.rb
|
79
|
+
- infod/W/find.rb
|
80
|
+
- infod/W/kv.rb
|
81
|
+
- infod/W/page.rb
|
82
|
+
- infod/W/search.rb
|
83
|
+
- infod/W/text.rb
|
84
|
+
- infod/W/edit.rb
|
85
|
+
- infod/W/chat.rb
|
86
|
+
- infod/W/shell.rb
|
87
|
+
- infod/Es/sqlite.rb
|
88
|
+
- infod/Es/redis.rb
|
89
|
+
- infod/Es/fs.rb
|
90
|
+
- infod/Es/groonga.rb
|
91
|
+
- infod/Es.rb
|
92
|
+
- infod/Rb.rb
|
93
|
+
- infod/Th/POST.rb
|
94
|
+
- infod/Th/uid.rb
|
95
|
+
- infod/Th/HEAD.rb
|
96
|
+
- infod/Th/500.rb
|
97
|
+
- infod/Th/local.rb
|
98
|
+
- infod/Th/GET.rb
|
99
|
+
- infod/Th/PATCH.rb
|
100
|
+
- infod/Th/404.rb
|
101
|
+
- infod/infod.rb
|
102
|
+
- infod/N.rb
|
103
|
+
homepage: http://whats-your.name/www/
|
104
|
+
licenses:
|
105
|
+
- Unlicense
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- .
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ! '>='
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ! '>='
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 1.8.23
|
125
|
+
signing_key:
|
126
|
+
specification_version: 3
|
127
|
+
summary: a data/filesystem web-server
|
128
|
+
test_files: []
|
129
|
+
has_rdoc:
|