brite 0.6.0 → 0.7.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.
- data/.ruby +56 -0
- data/COPYING.rdoc +30 -0
- data/HISTORY.rdoc +16 -2
- data/README.rdoc +35 -27
- data/bin/brite-server +1 -1
- data/lib/brite.rb +2 -1
- data/lib/brite.yml +56 -0
- data/lib/brite/command.rb +100 -55
- data/lib/brite/config.rb +122 -40
- data/lib/brite/controller.rb +46 -104
- data/lib/brite/layout.rb +27 -13
- data/lib/brite/model.rb +107 -0
- data/lib/brite/page.rb +229 -0
- data/lib/brite/part.rb +88 -0
- data/lib/brite/post.rb +41 -0
- data/lib/brite/server.rb +88 -93
- data/lib/brite/site.rb +150 -0
- data/lib/brite/version.rb +21 -0
- data/test/fixture/brite.yml +3 -0
- data/test/fixture/example-page.page +8 -0
- data/test/fixture/example-post.post +9 -0
- data/test/helper.rb +5 -0
- data/test/test_config.rb +23 -0
- data/test/test_page.rb +28 -0
- data/test/test_site.rb +37 -0
- metadata +104 -109
- data/LICENSE +0 -205
- data/Syckfile +0 -76
- data/lib/brite/meta/data.rb +0 -26
- data/lib/brite/meta/package +0 -8
- data/lib/brite/meta/profile +0 -19
- data/lib/brite/models/model.rb +0 -97
- data/lib/brite/models/page.rb +0 -142
- data/lib/brite/models/post.rb +0 -9
- data/lib/brite/models/site.rb +0 -46
- data/lib/brite/rackup.rb +0 -6
- data/lib/plugins/sow/brite/awesome/Sowfile +0 -11
- data/lib/plugins/sow/brite/awesome/about.page +0 -28
- data/lib/plugins/sow/brite/awesome/assets/custom.less +0 -96
- data/lib/plugins/sow/brite/awesome/assets/fade.png +0 -0
- data/lib/plugins/sow/brite/awesome/assets/highlight.css +0 -96
- data/lib/plugins/sow/brite/awesome/assets/highlight.js +0 -1
- data/lib/plugins/sow/brite/awesome/assets/jquery.js +0 -19
- data/lib/plugins/sow/brite/awesome/assets/jquery.tabs.js +0 -1
- data/lib/plugins/sow/brite/awesome/assets/reset.css +0 -57
- data/lib/plugins/sow/brite/awesome/assets/ruby.png +0 -0
- data/lib/plugins/sow/brite/awesome/brite.yaml +0 -3
- data/lib/plugins/sow/brite/awesome/history.page +0 -15
- data/lib/plugins/sow/brite/awesome/index.page +0 -18
- data/lib/plugins/sow/brite/awesome/legal.page +0 -28
- data/lib/plugins/sow/brite/awesome/logs.page +0 -14
- data/lib/plugins/sow/brite/awesome/page.layout +0 -75
- data/lib/plugins/sow/brite/blog1/.rsync-filter +0 -12
- data/lib/plugins/sow/brite/blog1/2011/01/sample.html +0 -293
- data/lib/plugins/sow/brite/blog1/2011/01/sample.post +0 -44
- data/lib/plugins/sow/brite/blog1/Sowfile +0 -10
- data/lib/plugins/sow/brite/blog1/assets/images/bg.jpg +0 -0
- data/lib/plugins/sow/brite/blog1/assets/images/icon.jpg +0 -0
- data/lib/plugins/sow/brite/blog1/assets/styles/class.css +0 -15
- data/lib/plugins/sow/brite/blog1/assets/styles/id.css +0 -85
- data/lib/plugins/sow/brite/blog1/assets/styles/misc.css +0 -0
- data/lib/plugins/sow/brite/blog1/assets/styles/print.css +0 -76
- data/lib/plugins/sow/brite/blog1/assets/styles/reset.css +0 -77
- data/lib/plugins/sow/brite/blog1/assets/styles/tag.css +0 -68
- data/lib/plugins/sow/brite/blog1/brite.yml +0 -3
- data/lib/plugins/sow/brite/blog1/index.page +0 -23
- data/lib/plugins/sow/brite/blog1/page.layout +0 -88
- data/lib/plugins/sow/brite/blog1/post.layout +0 -25
- data/meta/data.rb +0 -26
- data/meta/package +0 -8
- data/meta/profile +0 -19
data/.ruby
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
source:
|
3
|
+
- var
|
4
|
+
authors:
|
5
|
+
- name: trans
|
6
|
+
email: transfire@gmail.com
|
7
|
+
copyrights:
|
8
|
+
- holder: Rubyworks
|
9
|
+
year: '2006'
|
10
|
+
replacements: []
|
11
|
+
alternatives: []
|
12
|
+
requirements:
|
13
|
+
- name: neapolitan
|
14
|
+
version: 0.4.0+
|
15
|
+
- name: detroit
|
16
|
+
groups:
|
17
|
+
- build
|
18
|
+
development: true
|
19
|
+
- name: reap
|
20
|
+
groups:
|
21
|
+
- build
|
22
|
+
development: true
|
23
|
+
- name: lemon
|
24
|
+
groups:
|
25
|
+
- test
|
26
|
+
development: true
|
27
|
+
- name: ae
|
28
|
+
groups:
|
29
|
+
- test
|
30
|
+
development: true
|
31
|
+
dependencies: []
|
32
|
+
conflicts: []
|
33
|
+
repositories:
|
34
|
+
- uri: git://github.com/rubyworks/brite.git
|
35
|
+
scm: git
|
36
|
+
name: upstream
|
37
|
+
resources:
|
38
|
+
home: http://rubyworks.github.com/brite
|
39
|
+
code: http://github.com/rubyworks/brite
|
40
|
+
bugs: http://github.com/rubyworks/brite/issues
|
41
|
+
mail: http://groups.google.com/groups/rubyworks-mailinglist
|
42
|
+
extra: {}
|
43
|
+
load_path:
|
44
|
+
- lib
|
45
|
+
revision: 0
|
46
|
+
summary: Super Simple Static Site Generation
|
47
|
+
title: Brite
|
48
|
+
version: 0.7.0
|
49
|
+
name: brite
|
50
|
+
description: ! 'Brite is an easy to use, light-weight website generator. It supports
|
51
|
+
|
52
|
+
a variety of backend rendering engines including erb, liquid, rdoc,
|
53
|
+
|
54
|
+
markdown, textile and so on.'
|
55
|
+
organization: RubyWorks
|
56
|
+
date: '2011-12-17'
|
data/COPYING.rdoc
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
= COPYRIGHT NOTICES
|
2
|
+
|
3
|
+
== Brite - Copyright (c) 2009 Rubyworks
|
4
|
+
|
5
|
+
PROJECT:: Brite
|
6
|
+
WEBSITE:: http://rubyworks.github.com/brite
|
7
|
+
LICENSE:: BSD-2-Clause License
|
8
|
+
|
9
|
+
Copyright (c) 2009 Rubyworks
|
10
|
+
|
11
|
+
Redistribution and use in source and binary forms, with or without modification, are
|
12
|
+
permitted provided that the following conditions are met:
|
13
|
+
|
14
|
+
1. Redistributions of source code must retain the above copyright notice, this list of
|
15
|
+
conditions and the following disclaimer.
|
16
|
+
|
17
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
18
|
+
of conditions and the following disclaimer in the documentation and/or other materials
|
19
|
+
provided with the distribution.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
22
|
+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
|
24
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
25
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
27
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
28
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
29
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
|
data/HISTORY.rdoc
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
= RELEASE HISTORY
|
2
2
|
|
3
|
-
|
3
|
+
|
4
|
+
== 0.7.0 / 2011-12-15
|
5
|
+
|
6
|
+
New release of Brite cleans up the code a great deal, adds templated route
|
7
|
+
support via `route` field, and actually adds a few unit tests (wowzeres,
|
8
|
+
that's a good thing, right?).
|
9
|
+
|
10
|
+
Changes:
|
11
|
+
|
12
|
+
* Add route field for templated routes.
|
13
|
+
* Fix use of config field defaults.
|
14
|
+
* Add some initial unit tests.
|
15
|
+
|
16
|
+
|
17
|
+
== 0.6.0 / 2010-11-12
|
4
18
|
|
5
19
|
Version 0.6 is a full rewrite of Brite's underlying site generation system.
|
6
20
|
Where as before the Site and Page classes handled their own rendering, now
|
@@ -14,7 +28,7 @@ Changes:
|
|
14
28
|
* Sow templates modified to work with latest release.
|
15
29
|
|
16
30
|
|
17
|
-
== 0.5.0 /
|
31
|
+
== 0.5.0 / 2010-10-25
|
18
32
|
|
19
33
|
Brite (formerly Webrite) has been completely rewritten from the ground-up,
|
20
34
|
applying a number of ideas gathered from other systems and adding further
|
data/README.rdoc
CHANGED
@@ -2,60 +2,68 @@
|
|
2
2
|
|
3
3
|
A Shiny Static Website Generator
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
{Homepage}[http://rubyworks.github.com/brite] /
|
6
|
+
{Documentation}[http://rubydoc.info/gems/brite/frames] /
|
7
|
+
{Report Issue}[http://github.com/rubyworks/brite/issues] /
|
8
|
+
{Development}[http://github.com/rubyworks/brite] /
|
9
|
+
{Mailing List}[http://groups.google.com/group/rubyworks-mailinglist]
|
10
|
+
|
11
|
+
{<img src="http://travis-ci.org/rubyworks/brite.png" />}[http://travis-ci.org/rubyworks/brite]
|
7
12
|
|
8
13
|
|
9
14
|
== DESCRIPTION
|
10
15
|
|
11
16
|
Brite is an inovative static website/blog generation utility
|
12
|
-
which is as easy to use as it is
|
17
|
+
which is as easy to use as it is versatile.
|
13
18
|
|
14
19
|
|
15
20
|
== FEATURES
|
16
21
|
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
22
|
+
* Site layout is 100% user-defined.
|
23
|
+
* Can generate files in place, so no "special directories" are required.
|
24
|
+
* Alternatively templated routes can customize the site organization.
|
25
|
+
* Supports multi-format templates via Neapolitan template engine.
|
26
|
+
* Supports many markup and templating formats via Malt or Tilt.
|
20
27
|
|
21
28
|
|
22
29
|
== SYNOPSIS
|
23
30
|
|
24
|
-
|
25
|
-
|
31
|
+
Very briefly, one creates `.page`, `.post`, .part and `.layout` files and
|
32
|
+
then runs:
|
26
33
|
|
27
34
|
$ brite
|
28
35
|
|
29
|
-
|
30
|
-
|
31
|
-
|
36
|
+
Voila, website made!
|
37
|
+
|
38
|
+
Of course, the question really is how does one go about creating `.page`,
|
39
|
+
`.post`, `.part` and `.layout` files and such. For information about that see the
|
40
|
+
{Brite website}[https://rubyworks.github.com/brite] and see the
|
41
|
+
{Getting Started Tutorial}[https://github.com/rubyworks/brite/wiki/Getting-Started].
|
42
|
+
|
43
|
+
For a quick start, have a look at the {brite-site repository}[https://github.com/rubyworks/brite-site]
|
44
|
+
which contains a generic Brite project anyone can use to start their own Brite Site.
|
45
|
+
|
46
|
+
To get further under the hood see Brite source code in the
|
47
|
+
{GitHub hosted repository}[http://github.com/rubyworks/brite]
|
48
|
+
and read the {API documentation}[http://rubydoc.info/gems/brite/frames].
|
32
49
|
|
33
50
|
|
34
51
|
== HOW TO INSTALL
|
35
52
|
|
36
53
|
=== RubyGems
|
37
54
|
|
38
|
-
$
|
55
|
+
$ gem install brite
|
39
56
|
|
40
57
|
=== Setup.rb
|
41
58
|
|
42
|
-
If you're old fashion and want to install to a site
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
== COPYRIGHT/LICENSE
|
59
|
+
If you're old fashion and want to install to a site location,
|
60
|
+
see Setup.rb[http://rubyworks.github.com/setup].
|
47
61
|
|
48
|
-
Copyright (c) 2009 Thomas Sawyer
|
49
62
|
|
50
|
-
|
51
|
-
you may not use this file except in compliance with the License.
|
52
|
-
You may obtain a copy of the License at
|
63
|
+
== COPYRIGHTS
|
53
64
|
|
54
|
-
|
65
|
+
Copyright (c) 2009 Rubyworks
|
55
66
|
|
56
|
-
|
57
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
58
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
59
|
-
See the License for the specific language governing permissions and
|
60
|
-
limitations under the License.
|
67
|
+
Brite is distributable in accordance to the *BSD-2-Clause* license.
|
61
68
|
|
69
|
+
See COPYING.rdoc file for details.
|
data/bin/brite-server
CHANGED
data/lib/brite.rb
CHANGED
data/lib/brite.yml
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
source:
|
3
|
+
- var
|
4
|
+
authors:
|
5
|
+
- name: trans
|
6
|
+
email: transfire@gmail.com
|
7
|
+
copyrights:
|
8
|
+
- holder: Rubyworks
|
9
|
+
year: '2006'
|
10
|
+
replacements: []
|
11
|
+
alternatives: []
|
12
|
+
requirements:
|
13
|
+
- name: neapolitan
|
14
|
+
version: 0.4.0+
|
15
|
+
- name: detroit
|
16
|
+
groups:
|
17
|
+
- build
|
18
|
+
development: true
|
19
|
+
- name: reap
|
20
|
+
groups:
|
21
|
+
- build
|
22
|
+
development: true
|
23
|
+
- name: lemon
|
24
|
+
groups:
|
25
|
+
- test
|
26
|
+
development: true
|
27
|
+
- name: ae
|
28
|
+
groups:
|
29
|
+
- test
|
30
|
+
development: true
|
31
|
+
dependencies: []
|
32
|
+
conflicts: []
|
33
|
+
repositories:
|
34
|
+
- uri: git://github.com/rubyworks/brite.git
|
35
|
+
scm: git
|
36
|
+
name: upstream
|
37
|
+
resources:
|
38
|
+
home: http://rubyworks.github.com/brite
|
39
|
+
code: http://github.com/rubyworks/brite
|
40
|
+
bugs: http://github.com/rubyworks/brite/issues
|
41
|
+
mail: http://groups.google.com/groups/rubyworks-mailinglist
|
42
|
+
extra: {}
|
43
|
+
load_path:
|
44
|
+
- lib
|
45
|
+
revision: 0
|
46
|
+
summary: Super Simple Static Site Generation
|
47
|
+
title: Brite
|
48
|
+
version: 0.7.0
|
49
|
+
name: brite
|
50
|
+
description: ! 'Brite is an easy to use, light-weight website generator. It supports
|
51
|
+
|
52
|
+
a variety of backend rendering engines including erb, liquid, rdoc,
|
53
|
+
|
54
|
+
markdown, textile and so on.'
|
55
|
+
organization: RubyWorks
|
56
|
+
date: '2011-12-17'
|
data/lib/brite/command.rb
CHANGED
@@ -5,78 +5,123 @@ module Brite
|
|
5
5
|
|
6
6
|
# Initialize and run Command.
|
7
7
|
def self.cli(*argv)
|
8
|
-
Command.
|
8
|
+
Command.call(*argv)
|
9
9
|
end
|
10
10
|
|
11
|
-
#
|
12
|
-
|
11
|
+
# Brite command module.
|
12
|
+
module Command
|
13
|
+
extend self
|
13
14
|
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
# Execute command.
|
16
|
+
#
|
17
|
+
# @public
|
18
|
+
def call(*argv)
|
19
|
+
options = parse(argv)
|
20
|
+
|
21
|
+
begin
|
22
|
+
controller(options).build
|
23
|
+
rescue => e
|
24
|
+
$DEBUG ? raise(e) : puts(e.message)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# Create an instance of Brite::Controller given controller options.
|
29
|
+
#
|
30
|
+
# @private
|
31
|
+
#
|
32
|
+
# @return [Controller] New controller instance.
|
33
|
+
def controller(options)
|
34
|
+
Controller.new(options)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Parse controller options from command line arguments.
|
38
|
+
#
|
39
|
+
# @private
|
40
|
+
#
|
41
|
+
# @return [Hash] controller options
|
42
|
+
def parse(argv)
|
43
|
+
parser = OptionParser.new
|
44
|
+
|
45
|
+
options = {
|
46
|
+
:output => nil,
|
47
|
+
:url => nil
|
48
|
+
}
|
49
|
+
|
50
|
+
options_url parser, options
|
51
|
+
options_general parser, options
|
52
|
+
options_help parser, options
|
20
53
|
|
21
54
|
parser.parse!(argv)
|
22
55
|
|
23
|
-
|
56
|
+
options[:location] = argv.shift || '.'
|
57
|
+
|
58
|
+
options
|
24
59
|
end
|
25
60
|
|
26
|
-
#
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
@dryrun = true
|
39
|
-
end
|
40
|
-
|
41
|
-
opt.on("--force", "force overwrites") do
|
42
|
-
$FORCE = true
|
43
|
-
end
|
44
|
-
|
45
|
-
opt.on("--debug", "run in debug mode") do
|
46
|
-
$DEBUG = true
|
47
|
-
end
|
48
|
-
|
49
|
-
opt.on("--warn", "show Ruby warnings") do
|
50
|
-
$VERBOSE = true
|
51
|
-
end
|
52
|
-
|
53
|
-
opt.on_tail("--help", "display this help message") do
|
54
|
-
puts opt
|
55
|
-
exit
|
56
|
-
end
|
61
|
+
# Add `--url` option to command line parser.
|
62
|
+
#
|
63
|
+
# @param [OptionParser] parser
|
64
|
+
# An instance of option parser.
|
65
|
+
#
|
66
|
+
# @param [Hash] options
|
67
|
+
# An options hash to be passed to Controller.
|
68
|
+
#
|
69
|
+
# @private
|
70
|
+
def options_url(parser, options)
|
71
|
+
parser.on("--url URL", "website fully qualified URL") do |url|
|
72
|
+
options[:url] = url
|
57
73
|
end
|
58
74
|
end
|
59
75
|
|
76
|
+
# Add `--trace`, `--dryrun`, `--force`, `--debug` and `--warn` options
|
77
|
+
# to command line interface. These are all "global" options which means
|
78
|
+
# they set global variables if used.
|
60
79
|
#
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
80
|
+
# @param [OptionParser] parser
|
81
|
+
# An instance of option parser.
|
82
|
+
#
|
83
|
+
# @param [Hash] options
|
84
|
+
# An options hash to be passed to Controller.
|
85
|
+
#
|
86
|
+
# @private
|
87
|
+
def options_general(parser, options)
|
88
|
+
parser.on("--trace", "show extra operational information") do
|
89
|
+
$TRACE = true
|
90
|
+
end
|
91
|
+
|
92
|
+
parser.on("--dryrun", "-n", "don't actually write to disk") do
|
93
|
+
$DRYRUN = true
|
94
|
+
end
|
95
|
+
|
96
|
+
parser.on("--force", "force overwrites") do
|
97
|
+
$FORCE = true
|
98
|
+
end
|
99
|
+
|
100
|
+
parser.on("--debug", "run in debug mode") do
|
101
|
+
$DEBUG = true
|
102
|
+
end
|
103
|
+
|
104
|
+
parser.on("--warn", "show Ruby warnings") do
|
105
|
+
$VERBOSE = true
|
66
106
|
end
|
67
107
|
end
|
68
108
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
109
|
+
# Add `--help` option to command line parser.
|
110
|
+
#
|
111
|
+
# @param [OptionParser] parser
|
112
|
+
# An instance of option parser.
|
113
|
+
#
|
114
|
+
# @param [Hash] options
|
115
|
+
# An options hash to be passed to Controller.
|
116
|
+
#
|
117
|
+
# @private
|
118
|
+
def options_help(parser, options)
|
119
|
+
parser.on_tail("--help", "display this help message") do
|
120
|
+
puts opt
|
121
|
+
exit
|
122
|
+
end
|
77
123
|
end
|
78
124
|
|
79
125
|
end
|
80
126
|
|
81
127
|
end
|
82
|
-
|