kinbote 0.0.1 → 0.0.2
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.
- data/bin/kinbote +2 -1
- data/kinbote.gemspec +4 -2
- data/lib/kinbote/attribute.rb +19 -47
- data/lib/kinbote/base.rb +2 -1
- data/lib/kinbote/kinfile.rb +71 -0
- data/lib/kinbote/page.rb +85 -71
- data/lib/kinbote/page_match.rb +2 -2
- data/lib/kinbote/site.rb +79 -112
- data/lib/kinbote/util.rb +17 -5
- data/lib/kinbote/value.rb +10 -28
- data/lib/sinatra/kinbote.rb +12 -14
- data/lib/sinatra/kinbote_helpers.rb +2 -12
- data/site/.kinbote/views/attributes.haml +2 -2
- data/site/.kinbote/views/examples/header.haml +3 -9
- data/site/.kinbote/views/examples/home.haml +10 -16
- data/site/.kinbote/views/examples/page_attributes_title.haml +0 -1
- data/site/.kinbote/views/examples/related.haml +9 -9
- data/site/.kinbote/views/examples/related2.haml +5 -5
- data/site/.kinbote/views/examples/related_any.haml +4 -3
- data/site/.kinbote/views/examples/specific.haml +1 -1
- data/site/.kinbote/views/layout.haml +2 -0
- data/site/.kinbote/views/messages.haml +5 -0
- data/site/.kinbote/views/pages.haml +1 -1
- data/site/.kinbote/views/site.haml +1 -1
- data/site/kinbote-server +1 -6
- data/site/views/index.haml +7 -0
- data/site/views/layout.haml +1 -2
- data/site/views/snippets/sample.haml +1 -1
- metadata +46 -17
@@ -5,14 +5,14 @@
|
|
5
5
|
- next if attribute.name.downcase == "date"
|
6
6
|
%li
|
7
7
|
= "#{attribute.name} (#{attribute.pages.size})"
|
8
|
-
- if !attribute.css
|
8
|
+
- if !attribute.has_file?(:css)
|
9
9
|
%form{:action => "/kinbote/attributes/css", :method => "post"}
|
10
10
|
%input{:type => "hidden", :name => "attribute", :value => attribute.name}
|
11
11
|
%input{:type => "submit", :value => "Create SASS"}
|
12
12
|
%ul
|
13
13
|
- attribute.values.each do |value|
|
14
14
|
%li= "#{value.value} (#{value.pages.size})"
|
15
|
-
- if !value.css
|
15
|
+
- if !value.has_file?(:css)
|
16
16
|
%form{:action => "/kinbote/values/css", :method => "post"}
|
17
17
|
%input{:type => "hidden", :name => "attribute", :value => attribute.name}
|
18
18
|
%input{:type => "hidden", :name => "value", :value => value.value}
|
@@ -1,12 +1,6 @@
|
|
1
1
|
-# Kinbote Sample Code
|
2
2
|
|
3
|
-
|
4
|
-
%a{:href => "#samples", :onclick => "$('.examples').toggle();"} Show info >
|
5
|
-
%a{:name => "samples"}
|
6
|
-
|
7
|
-
.examples{:style => "border: 1px solid #000; display:none;"}
|
8
|
-
|
9
|
-
%p You can print all the attributes of this page ...
|
3
|
+
%h5 This page's attributes:
|
10
4
|
%ul
|
11
|
-
|
12
|
-
|
5
|
+
- @page.attributes.each do |attribute|
|
6
|
+
%li= "#{attribute}: #{attribute.values.join(", ")}"
|
@@ -1,40 +1,34 @@
|
|
1
1
|
-# Kinbote Sample Code
|
2
2
|
|
3
|
-
|
4
|
-
%a{:href => "#samples", :onclick => "$('.examples').toggle();"} Show info >
|
5
|
-
%a{:name => "samples"}
|
6
|
-
|
7
|
-
.examples{:style => "border: 1px solid #000; display:none;"}
|
8
|
-
%h3 All of the pages on this'ere website:
|
3
|
+
%h5 All pages:
|
9
4
|
%ul
|
10
5
|
- @pages.each do |page|
|
11
6
|
%li
|
12
|
-
%a{:href => "/#{page.url}"}= page
|
7
|
+
%a{:href => "/#{page.url}"}= page
|
13
8
|
|
14
|
-
%
|
9
|
+
%h5 Pages that contain the '$FIRST_VAL$' attribute:
|
15
10
|
%ul
|
16
11
|
- @$FIRST_VAL$.pages.each do |page|
|
17
12
|
%li
|
18
13
|
%a{:href => "/#{page.url}"}= page.title
|
19
14
|
|
20
|
-
%
|
15
|
+
%h5 Those same pages, and the values for their '$FIRST_VAL$':
|
21
16
|
%ul
|
22
17
|
- @$FIRST_VAL$.values.each do |$FIRST_VAL$_value|
|
23
18
|
- $FIRST_VAL$_value.pages.each do |page|
|
24
19
|
%li
|
25
|
-
%a{:href => "/#{page.url}"}= page.title
|
26
|
-
= "(#{$FIRST_VAL$_value.value})"
|
20
|
+
%a{:href => "/#{page.url}"}= "#{page.title} (#{$FIRST_VAL$_value})"
|
27
21
|
|
28
|
-
%
|
22
|
+
%h5 All attributes used on the site (and the number of times they've been used):
|
29
23
|
%ul
|
30
24
|
- @attributes.each do |attribute|
|
31
|
-
%li= "#{attribute
|
25
|
+
%li= "#{attribute} (#{attribute.pages.size})"
|
32
26
|
|
33
|
-
%
|
27
|
+
%h5 All those attributes and their values:
|
34
28
|
%ul
|
35
29
|
- @attributes.each do |attribute|
|
36
30
|
%li
|
37
|
-
= "#{attribute
|
31
|
+
= "#{attribute} (#{attribute.pages.size})"
|
38
32
|
%ul
|
39
33
|
- attribute.values.each do |value|
|
40
|
-
%li= "#{value
|
34
|
+
%li= "#{value} (#{value.pages.size})"
|
@@ -1,16 +1,16 @@
|
|
1
|
-
%
|
1
|
+
%h5 All the other pages that have the '$LAST_VAL$' attribute:
|
2
2
|
%ul
|
3
|
-
- @page.loosely_related_pages("$
|
3
|
+
- @page.loosely_related_pages("$ALL_VALS$").each do |page_match|
|
4
4
|
%li
|
5
|
-
%a{:href => "/#{page_match.page.url}"}= page_match.page
|
5
|
+
%a{:href => "/#{page_match.page.url}"}= page_match.page
|
6
6
|
is matched to this page because it contains the attribute
|
7
|
-
= page_match.attribute
|
7
|
+
= page_match.attribute
|
8
8
|
|
9
|
-
%
|
9
|
+
%h5 All the pages that have the same value for '$LAST_VAL$' as this page:
|
10
10
|
%ul
|
11
|
-
- @page.strongly_related_pages("$
|
11
|
+
- @page.strongly_related_pages("$ALL_VALS$").each do |page_match|
|
12
12
|
%li
|
13
|
-
%a{:href => "/#{page_match.page.url}"}= page_match.page
|
13
|
+
%a{:href => "/#{page_match.page.url}"}= page_match.page
|
14
14
|
is matched to this page because it contains
|
15
|
-
= page_match.value
|
16
|
-
= page_match.attribute
|
15
|
+
= page_match.value
|
16
|
+
= page_match.attribute
|
@@ -1,8 +1,8 @@
|
|
1
|
-
%
|
1
|
+
%h5 All the pages with the same specific value for '$LAST_VAL$' as this page:
|
2
2
|
%ul
|
3
|
-
- @page.strongly_related_pages("$
|
3
|
+
- @page.strongly_related_pages("$ALL_VALS$").each do |page_match|
|
4
4
|
%li
|
5
|
-
%a{:href => "/#{page_match.page.url}"}= page_match.page
|
5
|
+
%a{:href => "/#{page_match.page.url}"}= page_match.page
|
6
6
|
is matched to this page because it contains
|
7
|
-
= page_match.value
|
8
|
-
= page_match.attribute
|
7
|
+
= page_match.value
|
8
|
+
= page_match.attribute
|
@@ -1,8 +1,9 @@
|
|
1
|
-
%
|
1
|
+
%h5 All pages that are related to this page via any attribute/value:
|
2
2
|
%ul
|
3
3
|
- @page.strongly_related_pages.each do |page_match|
|
4
4
|
%li
|
5
|
-
= "#{page_match.attribute
|
6
|
-
%a{:href => "/#{page_match.page
|
5
|
+
= "#{page_match.attribute}: #{page_match.value} relates"
|
6
|
+
%a{:href => "/#{page_match.page}"}= page_match.page
|
7
7
|
|
8
|
+
%h5 How to include a snippet:
|
8
9
|
= snippet("sample")
|
@@ -13,7 +13,7 @@
|
|
13
13
|
%a{:href => "/kinbote/pages/#{page.slug}"}= page.title
|
14
14
|
%td= "[#{page.attributes.map{|a| "#{a}: #{a.values.map{|v| v.to_s}.join(', ')}"}.join('] [')}]"
|
15
15
|
%td
|
16
|
-
- if !page.css
|
16
|
+
- if !page.has_file?(:css)
|
17
17
|
%form{:action => "/kinbote/pages/#{page.slug}/css", :method => "post"}
|
18
18
|
%input{:type => "submit", :value => "Create SASS"}
|
19
19
|
%td
|
data/site/kinbote-server
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
|
5
|
-
if `hostname` == "femur\n"
|
6
|
-
require "#{File.dirname(__FILE__)}/../lib/kinbote"
|
7
|
-
else
|
8
|
-
require 'kinbote'
|
9
|
-
end
|
4
|
+
require (`hostname` == "femur\n" ? "#{File.dirname(__FILE__)}/../lib/kinbote" : 'kinbote')
|
10
5
|
|
11
6
|
s = Kinbote::Server
|
12
7
|
s.set :kinbote_path, "#{File.expand_path(File.dirname(__FILE__))}"
|
data/site/views/index.haml
CHANGED
data/site/views/layout.haml
CHANGED
@@ -5,9 +5,8 @@
|
|
5
5
|
%meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}
|
6
6
|
|
7
7
|
%link{:href => "/css/core.css", :rel => "stylesheet", :type => "text/css"}
|
8
|
-
%link{:href => "/css/blueprint/screen.css", :rel => "stylesheet", :type => "text/css"}
|
9
8
|
- if @page
|
10
|
-
- @page.
|
9
|
+
- @page.files(:css).each do |path|
|
11
10
|
%link{:href => "#{path}.css", :rel => "stylesheet", :type => "text/css"}
|
12
11
|
|
13
12
|
%script{:src => "/js/jquery.js", :type => "text/javascript"}
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kinbote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Jay Boice
|
@@ -9,39 +15,54 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-11 00:00:00 -04:00
|
13
19
|
default_executable: kinbote
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: sinatra
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 15
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
23
33
|
version: "1.0"
|
24
|
-
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: haml
|
27
|
-
|
28
|
-
|
29
|
-
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
30
41
|
requirements:
|
31
42
|
- - ">="
|
32
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 29
|
45
|
+
segments:
|
46
|
+
- 3
|
47
|
+
- 0
|
48
|
+
- 13
|
33
49
|
version: 3.0.13
|
34
|
-
|
50
|
+
type: :runtime
|
51
|
+
version_requirements: *id002
|
35
52
|
- !ruby/object:Gem::Dependency
|
36
53
|
name: net-scp
|
37
|
-
|
38
|
-
|
39
|
-
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
40
57
|
requirements:
|
41
58
|
- - ">="
|
42
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
43
63
|
version: "0"
|
44
|
-
|
64
|
+
type: :runtime
|
65
|
+
version_requirements: *id003
|
45
66
|
description: Kinbote
|
46
67
|
email: jboice@gmail.com
|
47
68
|
executables:
|
@@ -61,6 +82,7 @@ files:
|
|
61
82
|
- lib/kinbote.rb
|
62
83
|
- lib/kinbote/attribute.rb
|
63
84
|
- lib/kinbote/base.rb
|
85
|
+
- lib/kinbote/kinfile.rb
|
64
86
|
- lib/kinbote/page.rb
|
65
87
|
- lib/kinbote/page_match.rb
|
66
88
|
- lib/kinbote/site.rb
|
@@ -78,6 +100,7 @@ files:
|
|
78
100
|
- site/.kinbote/views/examples/related_any.haml
|
79
101
|
- site/.kinbote/views/examples/specific.haml
|
80
102
|
- site/.kinbote/views/layout.haml
|
103
|
+
- site/.kinbote/views/messages.haml
|
81
104
|
- site/.kinbote/views/page.haml
|
82
105
|
- site/.kinbote/views/pages.haml
|
83
106
|
- site/.kinbote/views/site.haml
|
@@ -108,21 +131,27 @@ rdoc_options:
|
|
108
131
|
require_paths:
|
109
132
|
- lib
|
110
133
|
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
111
135
|
requirements:
|
112
136
|
- - ">="
|
113
137
|
- !ruby/object:Gem::Version
|
138
|
+
hash: 3
|
139
|
+
segments:
|
140
|
+
- 0
|
114
141
|
version: "0"
|
115
|
-
version:
|
116
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
117
144
|
requirements:
|
118
145
|
- - ">="
|
119
146
|
- !ruby/object:Gem::Version
|
147
|
+
hash: 3
|
148
|
+
segments:
|
149
|
+
- 0
|
120
150
|
version: "0"
|
121
|
-
version:
|
122
151
|
requirements: []
|
123
152
|
|
124
153
|
rubyforge_project:
|
125
|
-
rubygems_version: 1.3.
|
154
|
+
rubygems_version: 1.3.7
|
126
155
|
signing_key:
|
127
156
|
specification_version: 2
|
128
157
|
summary: Kinbote
|