rote 0.3.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NGYyMGY1ZjJjYjZiZmUwYTlhMjcxYjI0ODNkODMxM2QyMmNmMTEzMA==
5
+ data.tar.gz: !binary |-
6
+ NWIyYTE0M2M0OWRlNTA4NGIwYzVhNjI2NTRjMTE2OWE4ZDk0Njk5YQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NTI0ODEzMDljMmEwZWU4YzNkMzVlYzUyMjkxNTJkNmZmZjBjYmQwYTliZjBh
10
+ YWNhYzc2YjAzMzUzNGIxNmViN2E5ZTQ5NzNhNzNlYzExYzkzMjdiNzI4MmZi
11
+ OWE4YjRlYWRjMjQ5Y2U4YWIzNDk5MDUwYWE5MjIxYmI4MzUzNzY=
12
+ data.tar.gz: !binary |-
13
+ NWVjZWIzMDhhMmI3ODMxMDFmMWE4NjlhNjgyNWUwM2FjZDY5YWNkYzA5ODNk
14
+ NmRkY2NjMmEwZjYxNmNlNjk2ODExYjUyNGNkOTdiYzkyZDNlYzM1ODU0OGYx
15
+ YTVmZmM0ZTU5YTczYjRhYWE5ZWY3MTkzMWZhMmRmODYwNGRjYWQ=
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c)2005, 2006 Ross Bamford (and contributors). All rights reserved.
1
+ Copyright (c)2005-2013 Ross Bamford (and contributors). All rights reserved.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
@@ -1,47 +1,51 @@
1
- = ROTE - A static website build tool for Ruby
1
+ ROTE - A static website build tool for Ruby
2
+ ===========================================
2
3
 
3
- == What is this?
4
+ What is this?
5
+ -------------
4
6
 
5
7
  Rote is a simple page-based template system that was written to make it
6
8
  easier to author and maintain non-dynamic websites and offline documentation.
7
- Rote provides a simple commandline or Rake [http://rake.rubyforge.org] based
9
+ Rote provides a simple commandline or [Rake](http://rake.rubyforge.org) based
8
10
  build for your pages, with page rendering (optionally supporting Textile, RDoc,
9
- Markdown, and embedded Ruby code with RedCloth [http://redcloth.rubyforge.org/]
10
- and ERB [http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html]),
11
+ Markdown, and embedded Ruby code with [RedCloth](http://redcloth.rubyforge.org/)
12
+ and [ERB](http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html)),
11
13
  layout, and general documentation / website build tasks.
12
14
 
13
- == Prerequisites
15
+ Prerequisites
16
+ -------------
14
17
 
15
18
  Rote requires the following (versions are as per my development environment,
16
19
  you may find you can use older versions, you may not).
17
20
 
18
- * Ruby 1.8.x (http://ruby-lang.org/)
19
- * Rake 0.6.2 ('gem install rake')
21
+ * Ruby 1.9.3 (http://ruby-lang.org/)
22
+ * Rake 0.9.9.2 ('gem install rake')
20
23
 
21
24
  The following optional dependencies will be used if present:
22
25
 
23
- * RubyGems 0.8.11 (http://rubygems.rubyforge.org/)
24
- * RedCloth 3.0.4 ('gem install RedCloth') (_Only required if Textile formatting is used_)
25
- * BlueCloth 1.0.0 ('gem install BlueCloth') (_Only required if Markdown or formatting is used_)
26
- * Syntax 1.0.0 ('gem install syntax') (_Only required if syntax highlighting formatting is used_)
27
- * HTMLTidy (http://tidy.sourceforge.net/) (_Only required if Tidy filter is used_)
26
+ * RubyGems 1.8.16 (http://rubygems.rubyforge.org/)
27
+ * RedCloth 4.2.9 ('gem install RedCloth') (*Only required if Textile formatting is used*)
28
+ * BlueCloth 1.0.1 ('gem install BlueCloth') (*Only required if Markdown or formatting is used*)
29
+ * Syntax 1.0.0 ('gem install syntax') (*Only required if syntax highlighting formatting is used*)
30
+ * HTMLTidy (http://tidy.sourceforge.net/) (*Only required if Tidy filter is used*)
28
31
 
29
- RubyGems [http://rubyforge.org/frs/?group_id=126] is *highly recommended*,
32
+ [RubyGems](http://rubygems.org) is **highly recommended**,
30
33
  and makes for not only an easier install but a cleaner library path.
31
- Rote is tested with Gems 0.8.11.
34
+ Rote is tested with Gems 2.0.3.
32
35
 
33
36
  Please note that Rote is written and tested on Linux - I have no facilities
34
37
  to test with, e.g. Windows, and would like very much to hear about any issues
35
38
  that affect usage with other OSes.
36
39
 
37
- == Installation ...
40
+ Installation ...
41
+ -----------------
38
42
 
39
- === ... with RubyGems?
43
+ ### ... with RubyGems?
40
44
 
41
45
  If you have RubyGems, you can install Rote by simply issuing the command:
42
-
46
+ ```
43
47
  gem install -r rote
44
-
48
+ ```
45
49
  Which should download the latest version and install it, including
46
50
  the 'rote' wrapper script and man pages. If you experience problems,
47
51
  or wish to perform an offline installation, then simply download the
@@ -52,17 +56,18 @@ directory.
52
56
  You will need to copy them to the appropriate location manually if using
53
57
  this method.
54
58
 
55
- === ... with install.rb?
59
+ ### ... with install.rb?
56
60
 
57
61
  If you don't have RubyGems, you can install from one of the tarball or zip
58
- packages, using the following command:
59
-
62
+ packages found on [our RubyForge page](http://http://rubyforge.org/frs/?group_id=1120)
63
+ , using the following command:
64
+ ```
60
65
  ruby install.rb
61
-
66
+ ```
62
67
  from the unpacked root directory. This will copy the libaries to the
63
68
  appropriate place, and set up the rote wrapper script, manpages, and so on.
64
69
 
65
- === ... in my own way?
70
+ ### ... in my own way?
66
71
 
67
72
  If you're one of those people who just has to be different, then you'll be
68
73
  pleased to know you can carry on that tradition, and place the files
@@ -70,7 +75,7 @@ pretty much where you like. Simply point an environment variable,
70
75
  ROTE_LIB, at the top-level lib directory (where rote.rb is found), and
71
76
  ensure rote (or a symlink) is visible in your path.
72
77
 
73
- === Did it work?
78
+ ### Did it work?
74
79
 
75
80
  With that done, you should be able to run
76
81
 
@@ -79,20 +84,22 @@ With that done, you should be able to run
79
84
  to verify that the command-line wrapper is working. You should of course see
80
85
  the version number of your Rote installation.
81
86
 
82
- *NOTE* Windows users - you may experience problems at this point, with Rote
87
+ **NOTE** Windows users - you may experience problems at this point, with Rote
83
88
  complaining that 'rake' is an invalid command. To fix this, simply set an
84
89
  environment variable, RAKE_CMD, with the command to execute for rake
85
90
  (e.g. rake.bat).
86
91
 
87
- == How do I use it?
92
+ How do I use it?
93
+ ----------------
88
94
 
89
95
  Please see the user guide for usage information. The latest version can be
90
- found online at http://rote.rubyforge.org/guide/ , and documentation source for
96
+ found online at http://github.com/roscopeco/rote , and documentation source for
91
97
  a specific release is included in the release package.
92
98
 
93
99
  See above for instructions on building the documentation set.
94
100
 
95
- === A note about version numbers
101
+ A note about version numbers
102
+ ----------------------------
96
103
 
97
104
  Rote uses odd/even numbers for development/release versions. When the final
98
105
  version component is odd, the package is an 'unofficial' build - generally
@@ -108,22 +115,25 @@ version consistency.
108
115
  If you are bundling Rote with your product, please ensure you use an official
109
116
  release version whenever possible. If you must use a developmental version,
110
117
  please modify the package version to reflect the fact that it is a custom
111
- build (e.g. 0.1.3-mycompany-20051021) to prevent inconsistent development
118
+ build (e.g. 0.1.3-mycompany-20121021) to prevent inconsistent development
112
119
  packages from escaping into the wild.
113
120
 
114
- === Further information
121
+ Further information
122
+ -------------------
115
123
 
116
- Rote is developed by Ross Bamford (rosco <at> roscopeco.co.uk), with help from
124
+ Rote is developed by Ross Bamford (roscopeco at gmail dot com), with help from
117
125
  the developers listed in CONTRIBUTORS. Any bugs are probably down to Ross,
118
126
  though, so flame him if it breaks your day ;P
119
127
 
120
- * Homepage - http://rote.rubyforge.org/
121
- * Project - http://rubyforge.org/projects/rote
122
- * Issues - http://rubyforge.org/tracker/?group_id=1120
128
+ * Homepage - http://github.com/roscopeco/rote
129
+ * Issues - https://github.com/roscopeco/rote/issues
123
130
  * Lists - rote-users@rubyforge.org, rote-devel@rubyforge.org (http://rubyforge.org/mail/?group_id=1120)
124
131
 
132
+ Thanks
133
+ ------
134
+
125
135
  As you may have guessed, Rote's hosting and development services are provided
126
- by http://RubyForge.org .
136
+ by a combination of [GitHub](http://github.com) and [Rubyforge](http://rubyforge.org).
127
137
 
128
138
  The people who have been instrumental in making Rote a better piece of
129
139
  software, without direct involvement in the development process. Without the
data/Rakefile CHANGED
@@ -1,24 +1,24 @@
1
1
  # Rote Rakefile (run with 'rake' command)
2
2
  #
3
- # Copyright 2005 Ross Bamford (and contributors). All rights reserved.
3
+ # Copyright 2005, 2012 Ross Bamford (and contributors). All rights reserved.
4
4
  # Rote is distributed under an MIT style license. See LICENSE for details.
5
5
  #
6
6
  # This Rakefile is heavily based on Rake's own Rakefile.
7
7
  # Portions copyright (c)2003, 2004 Jim Weirich (jim <AT> weirichhouse.org)
8
8
  #
9
- # $Id: Rakefile 185 2006-10-26 19:41:31Z roscopeco $
9
+ # $Id$
10
10
  #
11
11
 
12
12
  begin
13
13
  require 'rubygems'
14
- require 'rake/gempackagetask'
14
+ require 'rubygems/package_task'
15
15
  rescue Exception
16
16
  nil
17
17
  end
18
18
 
19
19
  require 'rake/clean'
20
20
  require 'rake/testtask'
21
- require 'rake/rdoctask'
21
+ require 'rdoc/task'
22
22
  # This needs to go at the front of the libpath
23
23
  # Otherwise, any pre-installed rote gets found,
24
24
  # and used from there. This is only necessary
@@ -33,6 +33,23 @@ require 'rote/format/html'
33
33
  require 'rote/extratasks'
34
34
  include Rote
35
35
 
36
+ # workaround a (possible) bug in Rake, or maybe a problem we've introduced...
37
+ module Rake
38
+ class << self
39
+ old_rake_check_options = instance_method(:rake_check_options).bind(self)
40
+ old_rake_output_message = instance_method(:rake_output_message).bind(self)
41
+
42
+ define_method(:rake_check_options) do |*args|
43
+ old_rake_check_options.call(*args)
44
+ end
45
+
46
+ define_method(:rake_output_message) do |*args|
47
+ old_rake_output_message.call(*args)
48
+ end
49
+ end
50
+ end
51
+ # end workaround
52
+
36
53
  CLEAN.include('tidy.log')
37
54
  CLOBBER.include('TAGS')
38
55
  CLOBBER.include('html')
@@ -50,7 +67,7 @@ else
50
67
  end
51
68
 
52
69
  if ENV['REL']
53
- PKG_VERSION = ENV['REL']
70
+ PKG_VERSION = ENV['REL'].dup
54
71
  else
55
72
  PKG_VERSION = CURRENT_VERSION
56
73
  end
@@ -112,22 +129,24 @@ rd = Rake::RDocTask.new(:rdoc) { |rdoc|
112
129
  rdoc.rdoc_dir = 'html/rdoc'
113
130
  # rdoc.template = 'kilmer'
114
131
  # rdoc.template = 'css2'
115
- rdoc.template = 'doc/jamis.rb'
132
+ # rdoc.template = 'doc/jamis.rb'
116
133
  rdoc.title = "Rote"
117
- rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
118
- rdoc.rdoc_files.include('README', 'LICENSE', 'TODO', 'CONTRIBUTORS')
134
+ rdoc.options << '--line-numbers' << '--main' << 'README.md'
135
+ rdoc.rdoc_files.include('README.md', 'LICENSE', 'TODO', 'CONTRIBUTORS')
119
136
  rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
120
137
  rdoc.rdoc_files.exclude(/\bcontrib\b/)
121
138
  rdoc.rdoc_files.exclude('lib/rote/project/**/*')
122
139
  }
123
140
 
124
141
  # Code coverage report
125
- Rote::RCovTask.new { |rcov|
126
- rcov.test_files.include 'test/gem*.rb'
127
- rcov.source_files.include 'lib/**/*.rb'
128
- rcov.profile = true
129
- rcov.output_dir = 'html/coverage'
130
- }
142
+ # TODO removed for now as rcov doesn't like Ruby 1.9
143
+ #Rote::RCovTask.new { |rcov|
144
+ # rcov.test_files.include 'test/gem*.rb'
145
+ # rcov.source_files.include 'lib/**/*.rb'
146
+ # rcov.profile = true
147
+ # rcov.output_dir = 'html/coverage'
148
+ # rcov.failonerror = false # don't stop the build if rcov doesn't work...
149
+ #}
131
150
 
132
151
  # Create a task build the website / docs
133
152
  ws = Rote::DocTask.new(:doc) { |site|
@@ -143,10 +162,10 @@ ws = Rote::DocTask.new(:doc) { |site|
143
162
  # use 'page' layout, textile formatting, ruby syntax, Tidy to xhtml
144
163
  page.layout 'page'
145
164
 
146
- page.page_filter Filters::RedCloth.new(:textile)
165
+ page.page_filter Filters::RedCloth.new
147
166
  page.page_filter Filters::Syntax.new
148
167
 
149
- page.post_filter Filters::Tidy.new
168
+ #page.post_filter Filters::Tidy.new
150
169
  end
151
170
 
152
171
  site.res.dir = 'doc/res'
@@ -157,7 +176,7 @@ ws = Rote::DocTask.new(:doc) { |site|
157
176
  }
158
177
 
159
178
  # add rdoc/rcov deps to doc task
160
- task :doc => [:rdoc, :rcov]
179
+ task :doc => [:rdoc]
161
180
 
162
181
  desc "Publish the documentation and web site"
163
182
  task :doc_upload => [ :doc ] do
@@ -202,6 +221,7 @@ else
202
221
  s.name = 'rote'
203
222
  s.version = PKG_VERSION
204
223
  s.summary = "Adds template-based doc support to Rake."
224
+ s.license = "MIT"
205
225
  s.description = <<-EOF
206
226
  Rote is a set of Rake task libraries and utilities that
207
227
  enable easy rendering of textual documentation formats
@@ -232,10 +252,8 @@ else
232
252
  s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
233
253
  s.rdoc_options <<
234
254
  '--title' << 'Rote -- Template-based doc support for Rake' <<
235
- '--main' << 'README' <<
255
+ '--main' << 'README.md' <<
236
256
  '--line-numbers' <<
237
- '--inline-source' <<
238
- '--template' << 'doc/jamis.rb'
239
257
  '-o' << 'html'
240
258
 
241
259
  s.test_files = Dir.glob('test/gem_*.rb')
@@ -261,7 +279,7 @@ else
261
279
  end
262
280
  end
263
281
 
264
- package_task = Rake::GemPackageTask.new(spec) do |pkg|
282
+ package_task = Gem::PackageTask.new(spec) do |pkg|
265
283
  pkg.need_zip = true
266
284
  pkg.need_tar_gz = true
267
285
  pkg.package_dir = 'pkg'
@@ -424,15 +442,17 @@ task :prerelease do
424
442
  end
425
443
 
426
444
  # Are all source files checked in?
427
- if ENV['RELTEST']
428
- announce "Release Task Testing, skipping checked-in file test"
429
- else
430
- announce "Checking for unchecked-in files..."
431
- data = `svn status`
432
- unless data =~ /^$/
433
- fail "SVN status is not clean ... do you have unchecked-in files?"
434
- end
435
- announce "No outstanding checkins found ... OK"
445
+ announce "Checking for unchecked-in files..."
446
+ data = `git status`
447
+ unless data =~ /nothing to commit \(working directory clean\)/m
448
+ fail "GIT status is not clean ... do you have unchecked-in files?"
449
+ end
450
+ announce "No outstanding checkins found ... OK"
451
+
452
+ # Check we're on master
453
+ branch = /^\*\s+(.*)$/.match(`git branch`)[1]
454
+ if !branch.eql? 'master'
455
+ fail "Please merge to master before making a release"
436
456
  end
437
457
  end
438
458
 
@@ -454,34 +474,22 @@ task :update_version => [:prerelease] do
454
474
  end
455
475
  mv "lib/rote.rb.new", "lib/rote.rb"
456
476
  if ENV['RELTEST']
457
- announce "Release Task Testing, skipping commiting of new version"
477
+ announce "Release Task Testing; Would exec: git commit -m \"Updated to version #{PKG_VERSION}\" lib/rote.rb"
458
478
  else
459
- sh %{svn commit -m "Updated to version #{PKG_VERSION}" lib/rote.rb}
479
+ sh %{git commit -m "Updated to version #{PKG_VERSION}" lib/rote.rb}
460
480
  end
461
481
  end
462
482
  end
463
483
 
464
- desc "Create a new SVN tag with the latest release number (REL=x.y.z)"
484
+ desc "Create a new Git tag with the latest release number (REL=x.y.z)"
465
485
  task :tag => [:prerelease] do
466
486
  reltag = "REL_#{PKG_VERSION.gsub(/\./, '_')}"
467
487
  reltag << ENV['REUSE'].gsub(/\./, '_') if ENV['REUSE']
468
- announce "Tagging CVS with [#{reltag}]"
488
+ announce "Tagging Git with [#{reltag}]"
469
489
  if ENV['RELTEST']
470
- announce "Release Task Testing, skipping SVN tagging"
490
+ announce "Release Task Testing; Would exec: git tag -a #{reltag} -m \"Release #{PKG_VERSION}\""
471
491
  else
472
- # need to get current base URL
473
- s = `svn info`
474
- if s =~ /URL:\s*([^\n]*)\n/
475
- svnroot = $1
476
- if svnroot =~ /^(.*)\/trunk/
477
- svnbase = $1
478
- sh %{svn cp #{svnroot} #{svnbase}/tags/#{reltag} -m "Release #{PKG_VERSION}"}
479
- else
480
- fail "Please merge to trunk before making a release"
481
- end
482
- else
483
- fail "Unable to determine repository URL from 'svn info' - is this a working copy?"
484
- end
492
+ sh %{git tag -a #{reltag} -m "Release #{PKG_VERSION}"}
485
493
  end
486
494
  end
487
495
 
data/bin/rote CHANGED
@@ -1,37 +1,40 @@
1
1
  #
2
- # Commandline launcher for Rote, (c)2005 Ross Bamford
2
+ # Commandline launcher for Rote, (c)2005, 2012 Ross Bamford (and contributors)
3
3
  #
4
4
  # Get set up with library paths, however we're installed.
5
5
 
6
- def croak
6
+ def croak(e)
7
7
  puts "Cannot locate Rote libraries - Do you need to set $ROTE_LIB ?"
8
+ p e
8
9
  exit(1)
9
10
  end
10
11
 
11
- begin
12
- require 'rubygems'
13
- rescue LoadError
14
- # just ignore, don't use gems
15
- end
16
-
17
12
  fail = false
18
13
  rote_lib = nil
19
14
 
20
15
  begin
21
- require 'rote'
22
- require 'rote/app'
23
-
16
+ require 'rote.rb'
17
+ require 'rote/app.rb'
18
+
24
19
  # find this later
25
20
  rote_lib = nil
26
- rescue LoadError
27
- unless fail || !(rote_lib = ENV['ROTE_LIB'])
28
- $: << rote_lib
29
- # at least we can know this now...
21
+ rescue LoadError => e
22
+ unless fail
23
+ if rote_lib = ENV['ROTE_LIB']
24
+ $:.unshift rote_lib
25
+ else
26
+ begin
27
+ require 'rubygems'
28
+ rescue LoadError
29
+ # just ignore, we're clutching at straws now...
30
+ end
31
+ end
32
+ # at least we can know this now, or we're failing next iter anyway...
30
33
  builtin = File.join(rote_lib,'rote/builtin.rf')
31
34
  fail = true # next time.
32
35
  retry
33
36
  else
34
- croak
37
+ croak(e)
35
38
  end
36
39
  end
37
40