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.
@@ -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
- .clear{:style => "clear:both;"}
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
- - @page.attributes.each do |attribute|
12
- %li= "#{attribute.name}: #{attribute.values.join(", ")}"
5
+ - @page.attributes.each do |attribute|
6
+ %li= "#{attribute}: #{attribute.values.join(", ")}"
@@ -1,40 +1,34 @@
1
1
  -# Kinbote Sample Code
2
2
 
3
- .clear{:style => "clear:both;"}
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.title
7
+ %a{:href => "/#{page.url}"}= page
13
8
 
14
- %h3 Here are all the pages that have a '$FIRST_VAL$' attribute:
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
- %h3 Below are those same pages, and the VALUES for their $FIRST_VAL$:
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
- %h3 These are all the attributes used on the site (and the number of times they've been used):
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.name} (#{attribute.pages.size})"
25
+ %li= "#{attribute} (#{attribute.pages.size})"
32
26
 
33
- %h3 Here are all those attributes and their values:
27
+ %h5 All those attributes and their values:
34
28
  %ul
35
29
  - @attributes.each do |attribute|
36
30
  %li
37
- = "#{attribute.name} (#{attribute.pages.size})"
31
+ = "#{attribute} (#{attribute.pages.size})"
38
32
  %ul
39
33
  - attribute.values.each do |value|
40
- %li= "#{value.value} (#{value.pages.size})"
34
+ %li= "#{value} (#{value.pages.size})"
@@ -1,2 +1 @@
1
-
2
1
  -# Kinbote Page Attributes
@@ -1,16 +1,16 @@
1
- %p You can get all the other pages that have the "$LAST_VAL$" attribute:
1
+ %h5 All the other pages that have the '$LAST_VAL$' attribute:
2
2
  %ul
3
- - @page.loosely_related_pages("$ALL_VALS_COMMENTED$").each do |page_match|
3
+ - @page.loosely_related_pages("$ALL_VALS$").each do |page_match|
4
4
  %li
5
- %a{:href => "/#{page_match.page.url}"}= page_match.page.title
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.name
7
+ = page_match.attribute
8
8
 
9
- %p You can also get all the pages that have the same VALUE for "$LAST_VAL$" as this page:
9
+ %h5 All the pages that have the same value for '$LAST_VAL$' as this page:
10
10
  %ul
11
- - @page.strongly_related_pages("$ALL_VALS_COMMENTED$").each do |page_match|
11
+ - @page.strongly_related_pages("$ALL_VALS$").each do |page_match|
12
12
  %li
13
- %a{:href => "/#{page_match.page.url}"}= page_match.page.title
13
+ %a{:href => "/#{page_match.page.url}"}= page_match.page
14
14
  is matched to this page because it contains
15
- = page_match.value.value
16
- = page_match.attribute.name
15
+ = page_match.value
16
+ = page_match.attribute
@@ -1,8 +1,8 @@
1
- %p You can also get all the pages that have the same SPECIFIC value for "$LAST_VAL$" as this page:
1
+ %h5 All the pages with the same specific value for '$LAST_VAL$' as this page:
2
2
  %ul
3
- - @page.strongly_related_pages("$ALL_VALS_COMMENTED$").each do |page_match|
3
+ - @page.strongly_related_pages("$ALL_VALS$").each do |page_match|
4
4
  %li
5
- %a{:href => "/#{page_match.page.url}"}= page_match.page.title
5
+ %a{:href => "/#{page_match.page.url}"}= page_match.page
6
6
  is matched to this page because it contains
7
- = page_match.value.value
8
- = page_match.attribute.name
7
+ = page_match.value
8
+ = page_match.attribute
@@ -1,8 +1,9 @@
1
- %p Or, you can get all the pages that are related to this page via ANY attribute/value:
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.name}: #{page_match.value.value} relates"
6
- %a{:href => "/#{page_match.page.url}"}= page_match.page.title
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")
@@ -1,3 +1,3 @@
1
- %p ... or specific ones:
1
+ %h5 Specific attributes:
2
2
  %ul
3
3
  %li= @page.$ALL_VALS$.join(", ")
@@ -11,4 +11,6 @@
11
11
  %a{:href => "/kinbote/attributes"} attributes
12
12
  %a{:href => "/", :style => "margin-left:400px;"} The real site >>
13
13
 
14
+ = haml :'../.kinbote/views/messages', :layout => false
15
+
14
16
  = yield
@@ -0,0 +1,5 @@
1
+ - if $site.has_messages?
2
+ %h2 Your site contains these errors:
3
+ %ul
4
+ - $site.render_messages.each do |message|
5
+ %li= message
@@ -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
@@ -1,4 +1,4 @@
1
- <h1>Manage my website</h1>
1
+ %h1 Manage my website
2
2
 
3
3
  %form{:action => "/kinbote/publish", :method => "post"}
4
4
  %input{:type => "submit", :value => "Publish"}
@@ -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__))}"
@@ -1 +1,8 @@
1
1
  %h1= @site.title
2
+
3
+ %h2 Pages:
4
+ %ul
5
+ - @pages.each do |page|
6
+ %li
7
+ %a{:href => "/#{page.url}"}= page
8
+
@@ -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.css_files.each do |path|
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"}
@@ -1,4 +1,4 @@
1
1
  %h4 Sample Snippet
2
2
 
3
- %p You can access the current page like this:
3
+ %p You can still access the current page in a snippet:
4
4
  = @page.title
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kinbote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
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-10 00:00:00 -04:00
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
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
34
+ type: :runtime
35
+ version_requirements: *id001
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: haml
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
50
+ type: :runtime
51
+ version_requirements: *id002
35
52
  - !ruby/object:Gem::Dependency
36
53
  name: net-scp
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
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.5
154
+ rubygems_version: 1.3.7
126
155
  signing_key:
127
156
  specification_version: 2
128
157
  summary: Kinbote