smeagol 0.5.9 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/.ruby +80 -0
  2. data/.yardopts +9 -0
  3. data/HISTORY.md +147 -0
  4. data/LICENSE.txt +30 -0
  5. data/README.md +132 -26
  6. data/bin/smeagol +9 -39
  7. data/bin/smeagol-init +3 -0
  8. data/bin/smeagol-preview +4 -0
  9. data/bin/smeagol-serve +4 -0
  10. data/bin/smeagol-update +4 -0
  11. data/bin/smeagold +1 -4
  12. data/lib/smeagol.rb +77 -6
  13. data/lib/smeagol/app.rb +121 -75
  14. data/lib/smeagol/cache.rb +43 -24
  15. data/lib/smeagol/cli.rb +166 -0
  16. data/lib/smeagol/config.rb +154 -0
  17. data/lib/smeagol/console.rb +369 -0
  18. data/lib/smeagol/controller.rb +275 -0
  19. data/lib/smeagol/core_ext.rb +12 -0
  20. data/lib/smeagol/gollum/blob_entry.rb +17 -0
  21. data/lib/smeagol/gollum/file.rb +44 -0
  22. data/lib/smeagol/gollum/page.rb +47 -0
  23. data/lib/smeagol/gollum/wiki.rb +31 -0
  24. data/lib/smeagol/helpers/rss.rb +96 -0
  25. data/lib/smeagol/helpers/toc.rb +69 -0
  26. data/lib/smeagol/public/assets/smeagol/gollum.css +716 -0
  27. data/lib/smeagol/public/{smeagol → assets/smeagol}/html5.js +0 -0
  28. data/lib/smeagol/public/{smeagol → assets/smeagol}/pygment.css +0 -0
  29. data/lib/smeagol/public/assets/smeagol/template.css +631 -0
  30. data/lib/smeagol/repository.rb +85 -0
  31. data/lib/smeagol/settings.rb +302 -0
  32. data/lib/smeagol/templates/layouts/page.mustache +19 -0
  33. data/lib/smeagol/templates/layouts/versions.mustache +16 -0
  34. data/lib/smeagol/templates/partials/footer.mustache +17 -0
  35. data/lib/smeagol/templates/partials/header.mustache +47 -0
  36. data/lib/smeagol/templates/settings.yml +64 -0
  37. data/lib/smeagol/version.rb +1 -1
  38. data/lib/smeagol/views/base.rb +188 -27
  39. data/lib/smeagol/views/form.rb +56 -0
  40. data/lib/smeagol/views/page.rb +126 -25
  41. data/lib/smeagol/views/post.rb +51 -0
  42. data/lib/smeagol/views/versions.rb +20 -6
  43. data/lib/smeagol/wiki.rb +25 -45
  44. data/test/helper.rb +72 -8
  45. data/test/test_app.rb +57 -0
  46. data/test/test_cache.rb +10 -11
  47. data/test/test_init.rb +27 -0
  48. data/test/test_update.rb +20 -0
  49. data/test/test_wiki.rb +13 -10
  50. metadata +142 -216
  51. data/bin/smeagol-static +0 -115
  52. data/lib/file.rb +0 -10
  53. data/lib/smeagol/hash.rb +0 -13
  54. data/lib/smeagol/option_parser.rb +0 -138
  55. data/lib/smeagol/public/smeagol/main.css +0 -234
  56. data/lib/smeagol/templates/page.mustache +0 -58
  57. data/lib/smeagol/templates/versions.mustache +0 -50
  58. data/test/test_file.rb +0 -12
  59. data/test/test_hash.rb +0 -18
data/.ruby ADDED
@@ -0,0 +1,80 @@
1
+ ---
2
+ source:
3
+ - meta
4
+ authors:
5
+ - name: Ben Johnson
6
+ email: benbjohnson@yahoo.com
7
+ - name: Thomas Sawyer
8
+ email: transfire@gmail.com
9
+ copyrights:
10
+ - holder: Ben Johnson
11
+ year: '2010'
12
+ - holder: Rubyworks
13
+ year: '2011'
14
+ license: BSD-2-Clause
15
+ requirements:
16
+ - name: rack
17
+ version: 1.2~
18
+ - name: gollum
19
+ version: 1.3+
20
+ - name: sinatra
21
+ version: 1.0~
22
+ - name: rubypython
23
+ version: 0.5+
24
+ - name: citron
25
+ groups:
26
+ - development
27
+ - test
28
+ development: true
29
+ - name: ae
30
+ groups:
31
+ - develpoment
32
+ - test
33
+ development: true
34
+ - name: rack-test
35
+ groups:
36
+ - development
37
+ - test
38
+ development: true
39
+ - name: rdiscount
40
+ groups:
41
+ - development
42
+ - doc
43
+ development: true
44
+ dependencies: []
45
+ alternatives: []
46
+ conflicts: []
47
+ repositories:
48
+ - uri: git://github.com/rubyworks/smeagol.git
49
+ scm: git
50
+ name: upstream
51
+ resources:
52
+ - uri: http://rubyworks.github.com/smeagol
53
+ label: Website
54
+ type: home
55
+ - uri: http://github.com/rubyworks/smeagol
56
+ label: Source Code
57
+ type: code
58
+ - uri: http://rubydoc.info/gems/smeagol/frames
59
+ label: Documentation
60
+ type: docs
61
+ - uri: http://groups.google.com/groups/rubyworks-mailinglist
62
+ label: Mailing List
63
+ type: mail
64
+ categories: []
65
+ extra: {}
66
+ load_path:
67
+ - lib
68
+ revision: 0
69
+ created: '2010-08-16'
70
+ summary: Wiki Cum Website
71
+ title: Semagol
72
+ version: 0.6.0
73
+ name: smeagol
74
+ description: ! 'Smeagol is a customizable read-only Gollum wiki server.
75
+
76
+ Smeagol makes it possible to maintain a standalone website,
77
+
78
+ but update it through the Gollum wiki interface, e.g. via GitHub.'
79
+ organization: rubyworks
80
+ date: '2012-07-30'
@@ -0,0 +1,9 @@
1
+ --title "Smeagol"
2
+ --readme README.md
3
+ --protected
4
+ --private
5
+ --plugin tomdoc
6
+ lib
7
+ -
8
+ [A-Z]*.*
9
+
@@ -0,0 +1,147 @@
1
+ # RELEASE HISTORY
2
+
3
+ ## v0.6.0 / 2012-07-30
4
+
5
+ Version 0.6 is a major refactoring of the code base. While most previous
6
+ functionality remains, new features have been added and certain configuration
7
+ settings have been adjusted. One of the more note-worthy changes is that
8
+ the static generation feature has been spun-off to a new gem called Shelob.
9
+ Another important change is the use of an initial underscore to denote special
10
+ files. Users of the previous version should consult the updated documentation
11
+ and adjust their sites accordingly.
12
+
13
+ This release is dedicated to Ben Johnson, the original author of Smeagol.
14
+ Thanks for all your hard work and putting the project in the care of the
15
+ Rubyworks Foundation.
16
+
17
+ Changes:
18
+
19
+ * Use _layouts directory to store templates.
20
+ * Use _settings.yml instead of settings.yml.
21
+ * Spin-off static builds to Shelob project.
22
+ * Add init command for setting up wiki for Smeagol.
23
+
24
+
25
+ ## v0.5.9 / 2011-09-26
26
+
27
+ Bug fix release for static site generation.
28
+
29
+ Changes:
30
+
31
+ * Static site generator bug fixes. (kylef)
32
+
33
+
34
+ ## v0.5.8 / 2011-09-23
35
+
36
+ This release adds ability to generate a static site.
37
+
38
+ Changes:
39
+
40
+ * Added static site generator. (kylef)
41
+
42
+
43
+ ## v0.5.7 / 2011-04-13
44
+
45
+ Simple CSS style fix release.
46
+
47
+ Changes:
48
+
49
+ * Fix frame in CSS.
50
+
51
+
52
+ ## v0.5.3 / 2011-02-04
53
+
54
+ This release simple updates the version of Gollum dependency.
55
+
56
+ Changes:
57
+
58
+ * Upgrade to Gollum 1.1.1
59
+
60
+
61
+ ## v0.5.2 / 2010-11-21
62
+
63
+ New release adds Google Analytics support. Just
64
+ add a `tracking_id` to setting.yml.
65
+
66
+ Changes:
67
+
68
+ * Added Google Analytics support
69
+
70
+
71
+ ## v0.5.1 / 2010-10-13
72
+
73
+ Release fixes bug in menu generation.
74
+
75
+ Changes:
76
+
77
+ * Fixed menu bug.
78
+
79
+
80
+ ## v0.5.0 / 2010-10-12
81
+
82
+ This release adds support for site versions. The old
83
+ versions of pages can be viewed by providing the commit
84
+ id or tag name in the URL.
85
+
86
+ Changes:
87
+
88
+ * Added versioning using git tags.
89
+
90
+
91
+ ## v0.4.2 / 2010-10-11
92
+
93
+ This release improves CSS styling, including the addition
94
+ of a CSS reset.
95
+
96
+ Changes:
97
+
98
+ * Added CSS styles.
99
+ * Added CSS reset.
100
+
101
+
102
+ ## v0.4.1 / 2010-10-04
103
+
104
+ Bug release fixes missing require issue.
105
+
106
+ Changes:
107
+
108
+ * Missing require bug fixed.
109
+
110
+
111
+ ## v0.4.0 / 2010-10-03
112
+
113
+ This release adds a number of new features, such as
114
+ GitHub "fork me" ribbon support. It also makes a few
115
+ API adjustments.
116
+
117
+ Changes:
118
+
119
+ * Added secret update key.
120
+ * Added GitHub ribbon support.
121
+ * Added footer to home page.
122
+ * Changed `is_not_home?` to `not_home?` on Mustache page view.
123
+ * Renamed `--autoupdate` CLI option to `--auto-update`.
124
+ * Moved update functionality into Smeagol::Wiki.
125
+ * CSS Fixes: code & H3
126
+
127
+
128
+ ## v0.3.0 / 2010-10-01
129
+
130
+ First public release of Smeagol!
131
+
132
+ Changes:
133
+
134
+ * Added multiple repository support.
135
+ * Added `smeagold` process daemon.
136
+ * Removed Bundler dependency.
137
+ * Added HTML5 shiv for IE support.
138
+
139
+
140
+ ## v0.1.0 / 2010-09-20
141
+
142
+ First private release of Smeagol.
143
+
144
+ Changes:
145
+
146
+ * Smeagol was born!
147
+
@@ -0,0 +1,30 @@
1
+ Smeagol - Read-only Gollum Server
2
+ (http://rubyworks.github.com/smeagol)
3
+
4
+ Copyright (c) 2012 Rubyworks
5
+ Copyright (c) 2009 Ben Johnson
6
+
7
+ Redistribution and use in source and binary forms, with or without
8
+ modification, are permitted provided that the following conditions are met:
9
+
10
+ * Redistributions of source code must retain the above copyright notice,
11
+ this list of conditions and the following disclaimer.
12
+
13
+ * Redistributions in binary form must reproduce the above copyright notice,
14
+ this list of conditions and the following disclaimer in the documentation
15
+ and/or other materials provided with the distribution.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY Thomas Sawyer ``AS IS'' AND ANY EXPRESS
18
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20
+ NO EVENT SHALL Thomas Sawyer OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ (SPDX) BSD-2-Clause License
29
+
30
+
data/README.md CHANGED
@@ -1,56 +1,151 @@
1
- smeagol -- A Read-Only Gollum Server
2
- =============================================
1
+ Smeagol - A Read-Only Gollum Server
2
+ ===================================
3
+
4
+ [Website](http://rubyworks.github.com/smeagol) /
5
+ [Documentation](http://rubydoc.info/rubyworks/smeagol) /
6
+ [Source Code](http://github.com/rubyworks/smeagol) /
7
+ [Report Issue](http://github.com/rubyworks/smeagol/issues)
8
+
3
9
 
4
10
  ## DESCRIPTION
5
11
 
6
12
  Smeagol is a server that can run a read-only version of a
7
- [Gollum](http://github.com/github/gollum) wiki. This can be useful when you want
8
- to maintain a standalone copy of a Github wiki but you want to update it through
9
- the Github interface.
13
+ [Gollum](http://github.com/github/gollum) wiki.
14
+ This can be useful when you want to maintain a standalone website,
15
+ but you want to update it through the Gollum wiki interface,
16
+ e.g. via GitHub.
17
+
18
+ Smeagol also includes a static site generator that can convert
19
+ a Gollum wiki into a static website to be served by any hosting
20
+ service.
10
21
 
11
22
  Smeagol follows the rules of [Semantic Versioning](http://semver.org/) and uses
12
23
  [TomDoc](http://tomdoc.org/) for inline documentation.
13
24
 
14
25
 
26
+ ## STATUS
27
+
28
+ [![Build Status](https://secure.travis-ci.org/rubyworks/smeagol.png)](http://travis-ci.org/rubyworks/smeagol)
29
+
30
+ As of v0.6.0 Smeagol is in fairly good shape. It has a number of tests and they
31
+ are all green. However the tests are far from comprehensive. So there is a some
32
+ QA waterfalling going on here too. Probably it is best to consider the v0.6.x
33
+ series an advanced beta set. So if you run into any issues, or see any clear ways
34
+ to improve the project, let us know via the issues tracker to help us move
35
+ toward a rock-solid 0.7.
36
+
37
+
15
38
  ## INSTALLATION
16
39
 
17
40
  You can install Smeagol with RubyGems:
18
41
 
19
- $ [sudo] gem install smeagol
42
+ $ [sudo] gem install smeagol
20
43
 
21
44
  And then, if you want code highlighting, follow the
22
45
  [Installation Guide](http://pygments.org/docs/installation) for Pygments.
23
46
 
24
- Ta da. You're ready to go.
47
+ Ta da! You're ready to go.
48
+
49
+ Of course, the first thing you need to do is clone your Gollum wiki repo.
50
+
51
+ $ git clone git@github.com:user/user.github.com.git
25
52
 
26
53
 
27
- ## RUNNING
54
+ ## PREVIEWING
28
55
 
29
- To run smeagol, simply change directories to your Gollum repository and run the
30
- `smeagol` executable from the command line:
56
+ To preview your site via smeagol, simply change directories to your Gollum repository
57
+ and run `smeagol preview` from the command line:
31
58
 
32
- $ cd /path/to/repo
33
- $ smeagol
59
+ $ cd /path/to/repo
60
+ $ smeagol preview
34
61
 
35
62
  This will run a web server at `http://localhost:4567`. You can change the port
36
63
  by setting the `--port` or `-p` option on the command line.
37
64
 
38
65
 
39
- ## UPDATING
66
+ ## CUSTOMIZING
67
+
68
+ Of course, you want to customize your site to suit your style. To do this you
69
+ need to add some Smeagol support files. Use the `init` command to have Smeagol
70
+ put the default files in place.
71
+
72
+ $ cd path/to/wiki
73
+ $ smeagol init
74
+
75
+ In your wiki this will add a few files. One of these is `_settings.yml` which you
76
+ use to configure smeagol for your site. See SETTINGS below.
77
+
78
+ There will also be a file called `_layouts/page.mustache`. Using Mustache templating
79
+ use this file to create a custom page layout for your site. To learn more
80
+ about the variables available for use in this template see
81
+ the [Smeagol Wiki](http://github.com/rubyworks/smeagol/wiki).
82
+
83
+ Be sure to add these files to your repo and commit them. (You can just check
84
+ these files in and push to the server. It will not effect you Gollum
85
+ wiki in any way.)
86
+
87
+
88
+ ## SETTINGS
40
89
 
41
- There are two ways to update the repository through Smeagol:
90
+ The `_settings.yml` file allows you to configure certain behaviors of Smeagol.
91
+ An example `_settings.yml` file:
42
92
 
43
- 1. Auto Update
44
- 1. Manual Update
93
+ ---
94
+ static: public
95
+ url: http://trans.github.com
96
+ source_url: http://github.com/trans
97
+ title: 7R4N5.C0D3
98
+ author: trans
99
+ description:
100
+ Trans Programming Blog
101
+
102
+ menu:
103
+ - title: Homepage
104
+ href: "/"
105
+ - title: RSS Feed
106
+ href: "/rss.xml"
107
+ - title: Projects
108
+ href: "http://github.com/trans"
109
+
110
+ See the API documentation for more details about each field.
111
+
112
+
113
+ ## SERVING
114
+
115
+ Smeagol can serve multiple Gollum repos simulataneously. To do this
116
+ create a configuration file at `~/.smeagol/config.yml`. An example file
117
+ looks like this:
118
+
119
+ ---
120
+ port: 3000
121
+ auto_update: true
122
+ cache_enabled: true
123
+ repositories:
124
+ - path: ~/websites/acme/wiki
125
+ cname: acme.org
126
+ origin: 'git@github.com:acme/acme.wiki.git'
127
+ ref: master
128
+ bare: false
129
+ secret: X123
130
+
131
+ Then to serve the listed repositories use:
132
+
133
+ $ smeagol serve
134
+
135
+
136
+ ## UPDATING
137
+
138
+ There are two ways to handle updates of the repository through Smeagol:
139
+ *automatic updating* and *manual updating*.
45
140
 
46
141
  To setup Smeagol to automatically update your repository in fixed intervals,
47
- simply pass the `--auto-update` option in the command line and Smeagol will
48
- automatically perform a `git pull origin master` on your repository once per
49
- day.
142
+ simply pass the `--auto-update` option in the `smeagol-serve` command and Smeagol
143
+ will automatically perform a `git pull origin master` on your repository once
144
+ per day.
50
145
 
51
- To perform a manual update, simply go to the URL,
52
- `http://localhost:4567/update`, and Smeagol will perform a git pull. Change the
53
- URL to your appropriate hostname and port.
146
+ To perform a manual update, simply go to the `update` route, e.g. `http://localhost:4567/update`,
147
+ and Smeagol will perform a git pull. Of course, change the URL appropriately
148
+ for your hostname and port.
54
149
 
55
150
 
56
151
  ## CONTRIBUTE
@@ -58,9 +153,20 @@ URL to your appropriate hostname and port.
58
153
  Have a great idea for Smeagol? Awesome. Fork the repository and add a feature
59
154
  or fix a bug. There are a couple things I ask:
60
155
 
61
- 1. You must have tests for all code you check in.
62
- 1. Create an appropriately named topic branch that contains your change.
156
+ * Create an appropriately named topic branch that contains your change.
157
+ * Please try to provide tests for all code you check in.
158
+
159
+ Note that Smeagol uses Citron and AE for testing. And admittedly the project
160
+ is water-falling too much at present. So if you would like to contribute, but
161
+ don't have any specific request, writing a few tests would be a great help.
162
+
163
+
164
+ ## COPYRIGHTS
165
+
166
+ Smeagol is distributed under the terms of the **BSD-2-Clause** license.
167
+
168
+ * Copyright 2012 Trans, Rubyworks
169
+ * Copyright 2009 Ben Johnson
63
170
 
64
- Also, to run the Cucumber tests in Smeagol, you must first install `rdiscount`:
171
+ Please see LICENSE.txt file for details.
65
172
 
66
- $ gem install rdiscount