serious 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/README.rdoc +15 -2
  2. data/Rakefile +4 -0
  3. data/VERSION +1 -1
  4. data/bin/serious +117 -0
  5. data/serious.gemspec +4 -1
  6. metadata +5 -4
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = Serious
2
2
 
3
3
  Serious is a blog engine inspired by other filesystem-based engines like jekyll (http://jekyllrb.com/)
4
- and toto (http://cloudhead.io/toto), but is based upon Sinatra and rack and thus can be hosted
4
+ and toto (http://cloudhead.io/toto) and is based upon Sinatra and rack, thus can be hosted
5
5
  very easily (and for free) on heroku (http://heroku.com).
6
6
 
7
7
  The articles are stored in plain text files with an opinionated naming scheme which is used for
@@ -18,7 +18,7 @@ so a basic article looks something like this:
18
18
  ~
19
19
  ## Some content. You can use markdown in your articles, and also <%= "erb" %>
20
20
  <% highlight do %>
21
- puts 'it will also syntax-highlight your codes'
21
+ puts "it will also syntax-highlight your codes"
22
22
  <% end %>
23
23
 
24
24
  There are quite a few assumptions made by this format: You have to specify your title in yaml format
@@ -80,6 +80,12 @@ You might also want to test your blog locally. Use thin (<code>sudo gem install
80
80
 
81
81
  Go to <code>localhost:3000</code> and enjoy.
82
82
 
83
+ == Archives
84
+
85
+ The whole archives can be accessed at <code>/archives</code>. Archives by year, month and date
86
+ are available at <code>/2009</code> (all of 2009), <code>/2009/05</code> (May 2009),
87
+ <code>/2009/05/15</code> (May 15th 2009).
88
+
83
89
  == Configuration
84
90
 
85
91
  Inside your config.ru, you can customize the settings for your Serious site.
@@ -195,7 +201,9 @@ to learn how to add your own formatters or erb helpers.
195
201
 
196
202
  * static pages
197
203
  * make summary delim configurable
204
+ * beautifuller date formatting in frontend
198
205
  * make caching better
206
+ * make it possible to host in subdirectories
199
207
  * valid xhtml in demo setup
200
208
  * generator for basic app?
201
209
  * rake tasks for generating new posts and validating existing
@@ -213,6 +221,11 @@ to learn how to add your own formatters or erb helpers.
213
221
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
214
222
  * Send me a pull request. Bonus points for topic branches.
215
223
 
224
+ == Thanks
225
+
226
+ Alexis Sellier for toto, the main inspiration for this gem
227
+ Ryan Bates for the great coderay css
228
+
216
229
  == Copyright
217
230
 
218
231
  Copyright (c) 2010 Christoph Olszowka. See LICENSE for details.
data/Rakefile CHANGED
@@ -11,6 +11,10 @@ begin
11
11
  gem.homepage = "http://github.com/colszowka/serious"
12
12
  gem.authors = ["Christoph Olszowka"]
13
13
 
14
+ gem.bindir = 'bin'
15
+ gem.executables = ['serious']
16
+ gem.default_executable = 'serious'
17
+
14
18
  gem.add_dependency 'sinatra', ">= 0.9.4"
15
19
  gem.add_dependency 'stupid_formatter', '>= 0.2.0'
16
20
  gem.add_dependency 'builder', ">= 2.1.2"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.0
data/bin/serious ADDED
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Prepare ARGV
4
+ ARGS = ARGV.map {|a| a.strip.chomp }
5
+
6
+ if !(DIRNAME = ARGS[0])
7
+ puts "Usage: serious DIRNAME (--views) (--public) (--heroku) (--no-git)"
8
+ puts "Note: Only lowercase letters and dashes ('-') are allowed for DIRNAME"
9
+ puts "Options:"
10
+ puts " --views: Copies the default views into your site so you can modify them and sets"
11
+ puts " config accordingly. By default your site will use the views supplied with"
12
+ puts " the serious gem"
13
+ puts " --public: Copies the default public folder into your site and sets config accordingly"
14
+ puts " By default your site will use the public folder supplied with the serious gem"
15
+ puts " --no-git: Will not create a new git repository (by default, it does)"
16
+ puts " --heroku: Creates a heroku app named with dirname and pushes your site to it."
17
+ puts " Requires the heroku gem to be installed"
18
+ exit 1
19
+ end
20
+
21
+ if File.exist?(DIRNAME)
22
+ puts "#{DIRNAME} exists!"
23
+ exit 1
24
+ end
25
+
26
+ unless DIRNAME =~ /^[a-z][a-z\-]*$/
27
+ puts "Only lowercase-letters and '-' allowed in dirname!"
28
+ exit 1
29
+ end
30
+
31
+
32
+ require 'fileutils'
33
+ puts "Creating directory #{DIRNAME}"
34
+ FileUtils.mkdir_p(File.join(DIRNAME, 'articles'))
35
+ Dir.chdir(DIRNAME)
36
+
37
+ GEM_ROOT = File.join(File.dirname(__FILE__), '..')
38
+
39
+ def copy_public
40
+ puts 'Copying public dir'
41
+ FileUtils.cp_r File.join(GEM_ROOT, 'lib', 'site', 'public'), './'
42
+ end
43
+
44
+ def copy_views
45
+ puts 'Copying views dir'
46
+ FileUtils.cp_r File.join(GEM_ROOT, 'lib', 'site', 'views'), './'
47
+ end
48
+
49
+ def views?
50
+ ARGS.include?('--views')
51
+ end
52
+
53
+ def public?
54
+ ARGS.include?('--public')
55
+ end
56
+
57
+ def heroku?
58
+ ARGS.include?('--heroku')
59
+ end
60
+
61
+ def git?
62
+ !ARGS.include?('--no-git')
63
+ end
64
+
65
+ copy_views if views?
66
+ copy_public if public?
67
+
68
+ puts "Writing config.ru"
69
+ File.open('config.ru', 'w+') do |config|
70
+ config.puts "require 'serious'"
71
+ config.puts "Serious.set :title, '#{DIRNAME}'"
72
+ config.puts "Serious.set :author, 'Your Name here'"
73
+ config.puts "Serious.set :url, 'http://#{DIRNAME}.heroku.com'"
74
+
75
+ if public? and views?
76
+ config.puts "Serious.set :root, Dir.getwd"
77
+ elsif public?
78
+ config.puts "Serious.set :public, File.join(Dir.getwd, 'public')"
79
+ elsif views?
80
+ config.puts "Serious.set :views, File.join(Dir.getwd, 'views')"
81
+ end
82
+ config.puts 'run Serious'
83
+ end
84
+
85
+ puts "Creating .gems file"
86
+ File.open(".gems", "w+") do |gems|
87
+ gems.puts "stupid_formatter"
88
+ gems.puts "serious --version '>= #{File.read(File.join(GEM_ROOT, 'VERSION')).strip.chomp}'"
89
+ end
90
+
91
+ if git?
92
+ puts "Creating git repo"
93
+ system "git init"
94
+ system "git add . && git commit -m 'Initial commit'"
95
+ end
96
+
97
+ if heroku?
98
+ if git?
99
+ puts "Creating heroku app"
100
+ if system "heroku create #{DIRNAME}"
101
+ puts "Pushing to heroku - in 5 seconds"
102
+ sleep 5
103
+ if system 'git push heroku master'
104
+ puts "Your app now lives at http://#{DIRNAME}.heroku.com"
105
+ else
106
+ puts "Failed to push to heroku!"
107
+ end
108
+ else
109
+ puts "ERROR: Failed to create heroku app"
110
+ end
111
+
112
+ else
113
+ puts "ERROR: Can't create heroku app without git!"
114
+ end
115
+ end
116
+
117
+ puts "Done!"
data/serious.gemspec CHANGED
@@ -5,13 +5,15 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{serious}
8
- s.version = "0.1.4"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Christoph Olszowka"]
12
12
  s.date = %q{2010-02-13}
13
+ s.default_executable = %q{serious}
13
14
  s.description = %q{Serious is a simple, file-driven blog engine inspired by toto and driven by sinatra}
14
15
  s.email = %q{christoph at olszowka dot de}
16
+ s.executables = ["serious"]
15
17
  s.extra_rdoc_files = [
16
18
  "LICENSE",
17
19
  "README.rdoc"
@@ -23,6 +25,7 @@ Gem::Specification.new do |s|
23
25
  "README.rdoc",
24
26
  "Rakefile",
25
27
  "VERSION",
28
+ "bin/serious",
26
29
  "lib/serious.rb",
27
30
  "lib/serious/article.rb",
28
31
  "lib/site/public/css/coderay.css",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Olszowka
@@ -10,7 +10,7 @@ bindir: bin
10
10
  cert_chain: []
11
11
 
12
12
  date: 2010-02-13 00:00:00 +01:00
13
- default_executable:
13
+ default_executable: serious
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sinatra
@@ -74,8 +74,8 @@ dependencies:
74
74
  version:
75
75
  description: Serious is a simple, file-driven blog engine inspired by toto and driven by sinatra
76
76
  email: christoph at olszowka dot de
77
- executables: []
78
-
77
+ executables:
78
+ - serious
79
79
  extensions: []
80
80
 
81
81
  extra_rdoc_files:
@@ -88,6 +88,7 @@ files:
88
88
  - README.rdoc
89
89
  - Rakefile
90
90
  - VERSION
91
+ - bin/serious
91
92
  - lib/serious.rb
92
93
  - lib/serious/article.rb
93
94
  - lib/site/public/css/coderay.css