]> git.wincent.com - wikitext.git/log
wikitext.git
11 years agoFix typo in code comment
Wincent Colaiuta [Fri, 3 Dec 2010 16:09:02 +0000 (17:09 +0100)] 
Fix typo in code comment

See:

  https://wincent.com/issues/1754

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoUpdate to RSpec 2.2 for faster spec runs
Wincent Colaiuta [Wed, 1 Dec 2010 14:31:02 +0000 (15:31 +0100)] 
Update to RSpec 2.2 for faster spec runs

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoBump version number post-release
Wincent Colaiuta [Sat, 6 Nov 2010 00:15:42 +0000 (01:15 +0100)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoBump version number for 2.1.1 release 2.1.1
Wincent Colaiuta [Sat, 6 Nov 2010 00:09:47 +0000 (01:09 +0100)] 
Bump version number for 2.1.1 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoClear RUBYOPT in spec environment to keep Bundler out
Wincent Colaiuta [Sat, 6 Nov 2010 00:08:39 +0000 (01:08 +0100)] 
Clear RUBYOPT in spec environment to keep Bundler out

Bundler injects itself into subprocesses, which wreaks havoc with our
Rails tests.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoFix another token-dropping bug
Wincent Colaiuta [Sat, 6 Nov 2010 00:07:05 +0000 (01:07 +0100)] 
Fix another token-dropping bug

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoAdd another example for token-swallowing bug
Wincent Colaiuta [Fri, 5 Nov 2010 23:56:07 +0000 (00:56 +0100)] 
Add another example for token-swallowing bug

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoDon't drop unexpected token on the floor after failed external link
Wincent Colaiuta [Fri, 5 Nov 2010 23:51:12 +0000 (00:51 +0100)] 
Don't drop unexpected token on the floor after failed external link

This specifically arises after an EXT_LINK_START + PATH sequence. At
this point we expect a SPACE token, but if we don't get it, we were just
dropping it on the floor, which is bad.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoRemove BASEDIR constant from spec_helper
Wincent Colaiuta [Sun, 17 Oct 2010 17:47:53 +0000 (19:47 +0200)] 
Remove BASEDIR constant from spec_helper

We can rely on Ruby itself to guard against double-evaluating the
spec_helper file seeing as we always require it as "spec_helper" and
rely on the load path being set up in order to find it.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoRemove explicit rubygems require from spec_helper
Wincent Colaiuta [Sun, 17 Oct 2010 17:46:38 +0000 (19:46 +0200)] 
Remove explicit rubygems require from spec_helper

As we should always be run via Bundler (specifically, bin/rspec) there
is no need to ever require rubygems explicitly as it will already have
been loaded and the load path set up by Bundler.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoDon't use absolute path when requiring spec_helper.rb
Wincent Colaiuta [Sun, 17 Oct 2010 17:42:59 +0000 (19:42 +0200)] 
Don't use absolute path when requiring spec_helper.rb

RSpec 2.0 adds the spec directory to the load path, so it is no longer
necessary to specify an absolute path in order to ensure that the helper
only gets evaluated once.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoUse Bundler to manage development environment
Wincent Colaiuta [Sun, 17 Oct 2010 15:41:32 +0000 (17:41 +0200)] 
Use Bundler to manage development environment

Note that this actually breaks many (all?) of the specs which run
in the scratch Rails environments set up to test the extension against
different versions of Rails.

This is because Bundler tries to apply the same restrictions to those
sub-environments as apply to the parent environment, so more changes
will be needed to adapt those Rails tests to work in a Bundler-dominated
world.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoBump version number post-release
Wincent Colaiuta [Sun, 17 Oct 2010 15:09:03 +0000 (17:09 +0200)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoBump version number for 2.1 release 2.1
Wincent Colaiuta [Sun, 17 Oct 2010 15:07:35 +0000 (17:07 +0200)] 
Bump version number for 2.1 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoAdd docs and specs for external_link_rel attribute
Wincent Colaiuta [Sun, 17 Oct 2010 15:04:07 +0000 (17:04 +0200)] 
Add docs and specs for external_link_rel attribute

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoAdd ability to override external_link_rel at parse time
Wincent Colaiuta [Sun, 17 Oct 2010 14:42:10 +0000 (16:42 +0200)] 
Add ability to override external_link_rel at parse time

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoAdd ability to override external_link_rel via an accessor
Wincent Colaiuta [Sun, 17 Oct 2010 14:41:31 +0000 (16:41 +0200)] 
Add ability to override external_link_rel via an accessor

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoSwitch to RSpec 2.0
Wincent Colaiuta [Sun, 17 Oct 2010 13:23:08 +0000 (15:23 +0200)] 
Switch to RSpec 2.0

Signed-off-by: Wincent Colaiuta <win@wincent.com>
11 years agoAdd ability to add rel="nofollow" to external links
Mike Stangel [Sun, 17 Oct 2010 12:36:48 +0000 (14:36 +0200)] 
Add ability to add rel="nofollow" to external links

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRemove references to old (GPL) license
Wincent Colaiuta [Thu, 29 Jul 2010 07:25:48 +0000 (09:25 +0200)] 
Remove references to old (GPL) license

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoMake Yardoc upload site configurable
Wincent Colaiuta [Mon, 26 Jul 2010 17:26:01 +0000 (19:26 +0200)] 
Make Yardoc upload site configurable

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodocs: add list examples
Wincent Colaiuta [Sun, 11 Jul 2010 09:34:18 +0000 (11:34 +0200)] 
docs: add list examples

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoFormat all "pre" blocks for YARD
Wincent Colaiuta [Wed, 23 Jun 2010 16:12:20 +0000 (18:12 +0200)] 
Format all "pre" blocks for YARD

This means marking all non-Ruby "pre" blocks using a "!!!wikitext" or
"!!!html" marker.

At the moment there is no syntax highlighting for wikitext or HTML, so
those tags are effectively equivalent to "!!!plain", but the important
thing is that we stop YARD from inappropriately applying Ruby syntax
highlighting rules to non-ruby code, and if syntax highlighting for the
other languages is ever added, we will be ready for it.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump YARD requirement to 0.5.8
Wincent Colaiuta [Wed, 23 Jun 2010 15:34:47 +0000 (17:34 +0200)] 
Bump YARD requirement to 0.5.8

From the official announcement:

  Yesterday I released YARD 0.5.7. Unfortunately a few important bug fixes
  were omitted from the release because they were lost in the 0.6-master
  branch and I did not merge them back. That was a total screwup on my
  part. Hopefully this doesn't happen again (some extra specs were added
  to make sure this issue stays fixed).

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRequire at least 0.5.7 of YARD
Wincent Colaiuta [Tue, 22 Jun 2010 06:37:34 +0000 (08:37 +0200)] 
Require at least 0.5.7 of YARD

0.5.7 is needed as it includes a fix for "!!!plain" syntax. See:

  http://groups.google.com/group/yardoc/browse_thread/thread/85c49739f6df5a84

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoHandle missing "add_development_dependency" by defining it
Wincent Colaiuta [Tue, 22 Jun 2010 06:35:56 +0000 (08:35 +0200)] 
Handle missing "add_development_dependency" by defining it

This will allow us to conveniently add requirements where needed.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodoc: add custom title to generated documentation
Wincent Colaiuta [Sun, 13 Jun 2010 18:23:17 +0000 (20:23 +0200)] 
doc: add custom title to generated documentation

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agogit: ignore .yardoc directory
Wincent Colaiuta [Sun, 13 Jun 2010 17:45:03 +0000 (19:45 +0200)] 
git: ignore .yardoc directory

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoDRY up gemspec
Wincent Colaiuta [Sun, 13 Jun 2010 17:37:24 +0000 (19:37 +0200)] 
DRY up gemspec

Rather than repeating the gem names (4 of them), repeat the
"respond_to?" check (1 check) each time through the loop.

Speed not an issue, here, so just run the check every time
through the loop rather than sacrificing readability by
cluttering things up with a local variable.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoUse YARD for doc generation instead of RDoc
Wincent Colaiuta [Sun, 13 Jun 2010 17:34:39 +0000 (19:34 +0200)] 
Use YARD for doc generation instead of RDoc

The documentation is still going to require some tweaks, but this commit
switches over the build process to use YARD.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRemove RDoc hack notes; we're switching to YARD
Wincent Colaiuta [Sun, 13 Jun 2010 17:25:37 +0000 (19:25 +0200)] 
Remove RDoc hack notes; we're switching to YARD

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodoc: wrap SAMPLE.txt
Wincent Colaiuta [Sun, 13 Jun 2010 11:19:36 +0000 (13:19 +0200)] 
doc: wrap SAMPLE.txt

For better display on narrow terminals.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodoc: reference CHEATSHEET.txt from SAMPLE.txt
Wincent Colaiuta [Sun, 13 Jun 2010 11:16:33 +0000 (13:16 +0200)] 
doc: reference CHEATSHEET.txt from SAMPLE.txt

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodoc: point out how to inspect translated sample markup
Wincent Colaiuta [Sun, 13 Jun 2010 11:14:41 +0000 (13:14 +0200)] 
doc: point out how to inspect translated sample markup

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number post-release
Wincent Colaiuta [Sun, 13 Jun 2010 10:44:18 +0000 (12:44 +0200)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number for 2.0 release 2.0
Wincent Colaiuta [Sun, 13 Jun 2010 10:29:44 +0000 (12:29 +0200)] 
Bump version number for 2.0 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodoc: force the creation of a couple of hyperlinks
Wincent Colaiuta [Sun, 13 Jun 2010 10:15:39 +0000 (12:15 +0200)] 
doc: force the creation of a couple of hyperlinks

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodoc: add missing option to parse documentation
Wincent Colaiuta [Sun, 13 Jun 2010 10:10:54 +0000 (12:10 +0200)] 
doc: add missing option to parse documentation

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodoc: updates for "output_style" and HTML5 changes
Wincent Colaiuta [Sun, 13 Jun 2010 10:03:55 +0000 (12:03 +0200)] 
doc: updates for "output_style" and HTML5 changes

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBackend support for HTML5/XML output styles
Wincent Colaiuta [Sun, 13 Jun 2010 09:29:15 +0000 (11:29 +0200)] 
Backend support for HTML5/XML output styles

HTML5 has two output syntaxes, HTML and XML. Under HTML5 the HTML output
syntax is likely to be predominant, given that the XML syntax can only
be used if it is served with an appropriate MIME type (ie.
application/xml), and the vast majority of deployed web servers are
configured to use a text/html MIME type.

So, this dictates that for our 2.0 release we are going to default to
emitting HTML syntax, but allow the user to override the default and
emit XML syntax if required.

In practice, the only place in the code base where this necessitates a
change is the part where we emit "img" tags. In the XML syntax, these
tags should be self-closing; ie:

  <img src="foo.png" alt="Foo!" />

Whereas in the HTML syntax they should not (even if all user agents
accept them anyway); ie:

  <img src="foo.png" alt="Foo!">

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoAdd options for "output_style" (no backend yet)
Wincent Colaiuta [Sun, 13 Jun 2010 08:53:02 +0000 (10:53 +0200)] 
Add options for "output_style" (no backend yet)

Provide 3 means for users to specify an output style:

  (1) At initialization time:

      parser = Wikitext::Parser.new :output_style => :xml

  (2) By setting an instance variable via an accessor:

      parser = Wikitext::Parser.new
      parser.output_style = :xml

  (3) By passing in an override option at parse time:

      parser = Wikitext::Parser.new
      parser.parse input, :output_style => :xml

Note that at the moment this is just the option-handling code; the
actual behavior change hasn't been implemented yet.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRun specs under Rails 3.0.0.beta4
Wincent Colaiuta [Sat, 12 Jun 2010 23:01:35 +0000 (01:01 +0200)] 
Run specs under Rails 3.0.0.beta4

Note how that when targetting Rails 3 release versions, we can't use the
version number as the app name as we did with Rails 2.

This is because Rails 3 tries to turn the name into a constant, and
constants can't start with a number. To work around this we take such
version numbers and prepend them with a "v" to create a test app name;
this in turn can be "constantized" into "V300Beta4" or similar.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoMake "Edge Rails" specs work again
Wincent Colaiuta [Sat, 12 Jun 2010 22:22:30 +0000 (00:22 +0200)] 
Make "Edge Rails" specs work again

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoStart refactoring Rails specs
Wincent Colaiuta [Sat, 12 Jun 2010 20:37:22 +0000 (22:37 +0200)] 
Start refactoring Rails specs

The "Edge" Rails specs have been broken for a long time as we really
need a separate code path for these (too many changes in the underlying
machinery).

Lay the groundwork by renaming the existing working infrastructure as
a "rails2".

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoSimplify Rails 2 auto-initialization
Wincent Colaiuta [Sat, 12 Jun 2010 18:58:19 +0000 (20:58 +0200)] 
Simplify Rails 2 auto-initialization

Now that:

  require 'wikitext'

Effectively does the work that 'rails/init.rb' used to do, the latter
can now be reduced to just that:

  require 'wikitext'

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoAuto-initialize under Rails 3
Wincent Colaiuta [Sat, 12 Jun 2010 18:47:30 +0000 (20:47 +0200)] 
Auto-initialize under Rails 3

Under Rails 2 we get free auto-initialization behavior by including a
"rails/init.rb" file in our gem.

Under Rails 3 things have changed as described here:

  http://railsdispatch.com/posts/how-rails-3-enables-more-choices-part-1

Rails will effectively do a:

  require 'wikitext'

Early on in the application boot process. In our case, that effectively
means that the code in the C extension's Init_wikitext() function will
be evaluated.

So, in this commit, we replicate in C what we would have done in the
following manner if the Wikitext gem were just a pure Ruby project:

  if Object.const_defined? :ActiveSupport
    # we are running under Rails
    require 'wikitext/nil_class'
    require 'wikitext/string'

    if ActiveSupport.respond_to? :on_load
      # running under Rails 3
      ActiveSupport.on_load :action_view do
        require 'wikitext/rails_template_handler'
      end
    else
      # running under Rails 2
      require 'wikitext/rails_template_handler'
    end

Note that because one of the code paths involves passing in a block, we
have to define a couple of ancilliary helper functions and use
rb_iterate() to achieve the same effect in C.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoSplit String#wikitext_preprocess into a separate file
Wincent Colaiuta [Sat, 12 Jun 2010 16:08:10 +0000 (18:08 +0200)] 
Split String#wikitext_preprocess into a separate file

This has always been a bit of a wart, the fact that what is essentially
an application-specific preprocessing pass was included in our
"wikitext/strings" file.

Now, if you want the behavior you have to explicitly require
'wikitext/preprocess'.

As a side effect of this change, the file now serves as a nice example
of how to implement a custom preprocessing phase if you need it.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agorails/init.rb: trust LOAD_PATH
Wincent Colaiuta [Sat, 12 Jun 2010 15:46:55 +0000 (17:46 +0200)] 
rails/init.rb: trust LOAD_PATH

Rather than doing requires with absolute paths, trust the calling
environment (in this case, Rails 2) to set up the LOAD_PATH
appropriately.

This saves us later on re-requiring the same file with a different,
relative path and needlessly re-evaluating the same code.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRename rails.rb to rails_template_handler.rb
Wincent Colaiuta [Sat, 12 Jun 2010 15:43:47 +0000 (17:43 +0200)] 
Rename rails.rb to rails_template_handler.rb

To avoid confusion with "rails/init.rb" file elsewhere in the repo.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoFit "compile" method onto 1 line
Wincent Colaiuta [Sat, 12 Jun 2010 15:37:04 +0000 (17:37 +0200)] 
Fit "compile" method onto 1 line

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agodoc: initial updates for forthcoming 2.0 release
Wincent Colaiuta [Fri, 11 Jun 2010 16:49:39 +0000 (18:49 +0200)] 
doc: initial updates for forthcoming 2.0 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoEmit <code> rather than <tt> elements
Wincent Colaiuta [Fri, 11 Jun 2010 16:33:55 +0000 (18:33 +0200)] 
Emit <code> rather than <tt> elements

The <tt> element has been dropped from HTML5 and the recommendation is
to instead use more "semantic" elements such as <code>, <samp> and
<kbd>. As one of the major goals for the 2.0 release is to emit valid
HTML5, the <tt> element has to go.

Given that we are working with wikitext markup and the focus is on
simplicity, we won't be adding new syntax to enable the user to control
which of the three "semantic" tag alternatives is emitted.

Instead, we maintain the existing input markup options (that is,
backticks and <tt> elements will continue to be recognized) to maintain
compatibility with existing bodies of wikitext markup, and we choose
one of the three possible elements as a replacement for <tt>.

In the end, we're going with <code> because it seems to be the most
frequently used in the terrain where the wikitext module is used (online
wikis). A customization option to override this choice could be added in
the future, but I honestly don't expect there to be any demand for it.
Likewise, explicit support for <samp> and <kbd> tags could be added, but
I doubt there'll ever be a call for it, as the whole point of working in
wikitext markup is to have an easy-to-use format and not have to write
HTML tags.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRun Rails specs against many more versions of Rails 2
Wincent Colaiuta [Thu, 10 Jun 2010 18:41:05 +0000 (20:41 +0200)] 
Run Rails specs against many more versions of Rails 2

Previously we only ran against Rails 2.2.2 (the latest release at the
time the specs were written) and Rails "Edge".

In this commit we extend that to run against all versions of Rails 2
put out since the release of 2.2.2. The only exception to this is
version 2.3.0, which is marked as pending because it throws a Rack
exception. I am not sure if the version of Rack bundled with 2.3.0 has
some kind of bug, or this is an interaction with the versions of Rack
that are on my system (1.0.1 and 1.1.0) and might be getting
inadvertently pulled into the tests.

Note that we don't bother running the specs against versions of Rails
older than 2.2.2, because that came out in November 2008, and there is
not much sense in retroactively extending compatibility even further
backwards in time.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRestore template handler functionality in Rails 2
Wincent Colaiuta [Thu, 10 Jun 2010 17:55:47 +0000 (19:55 +0200)] 
Restore template handler functionality in Rails 2

As noted in commit 3fd2ea3, we fixed template handlers for Rails 3 but
did so at the expense of support for Rails 2.

This commit adds back the old Rails 2 code path as a fallback for when
the new code path is tried and fails in the absence of Rails 3.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoMove to Rails 3 template UI
Wincent Colaiuta [Wed, 9 Jun 2010 21:33:32 +0000 (23:33 +0200)] 
Move to Rails 3 template UI

It seems that under Rails 3 the old "self.call" method no longer works
in the same fashion. Previously returning the string "template.source.w"
worked because Rails, evidently, ended up eval'ing it in a context where
"template" resolved to the desired object.

In Rails 3, however, this is no longer the case, and it ends up trying
to call a "template" method on the controller, failing.

Googling for different template handlers shows that some use "render"
(for example, liquid) but I am unable to get any variant of "render" to
work under Rails 3.

On the other hand, the three handlers included with Rails itself (ERB,
Builder, and RJS) all use the "compile" method, as does Haml.

It's hard to tell from the scant in-code documentation, but it looks
like "compile" might be "the" supported way to write template handlers
for now. The only reference I can find to this online is this thread
from back in 2008:

  http://www.ruby-forum.com/topic/159810

In which Josh Peek says:

  I'd really like deprecate the TemplateHandler#render all together. If
  you think your handler can not be compiled, you always just compile in
  a delegate call to your "noncompilable" handler. This leaves us with
  only one method, compile.

So I am not sure if this is the "official" stance on the API, but in
light of the fact that I can't get anything else to work, I am going to
go with "compile" for now.

This unfortunately requires a somewhat ugly gsub call in order to escape
any single quotes that might be in the input, but it seems a necessary
evil. For example, a template with this wikitext markup:

  * don't you like this list?

Will be "compiled" to:

  '<ul>
    <li>don\'t you like this list?<li>
  </ul>
  '

Which when evaluated and emitted to the output steam becomes:

  <ul>
    <li>don't you like this list?</li>
  </ul>

Note that this commit makes things work with Rails 3 only, breaking
Rails 2 support. In a subsequent commit I plan to add in a conditional
code path that kicks in when running under Rails 2.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number post-release maint
Wincent Colaiuta [Wed, 9 Jun 2010 20:12:00 +0000 (22:12 +0200)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number for 1.12 release 1.12
Wincent Colaiuta [Wed, 9 Jun 2010 20:08:56 +0000 (22:08 +0200)] 
Bump version number for 1.12 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoUpdate release notes for 1.12 release
Wincent Colaiuta [Wed, 9 Jun 2010 20:04:41 +0000 (22:04 +0200)] 
Update release notes for 1.12 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoMark String#w and String#to_wikitext output as HTML safe
Wincent Colaiuta [Wed, 9 Jun 2010 19:33:58 +0000 (21:33 +0200)] 
Mark String#w and String#to_wikitext output as HTML safe

This applies only when running under Rails 3, or when the "html_safe"
method is otherwise available.

As these methods are the most commonly used methods for translating
wikitext markup to HTML in Rails applications, this should provide a
fairly convenient upgrade path for developers moving from Rails 2 to
Rails 3.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number post-release
Wincent Colaiuta [Sun, 25 Apr 2010 22:20:19 +0000 (00:20 +0200)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number for 1.11 release 1.11
Wincent Colaiuta [Sun, 25 Apr 2010 22:11:35 +0000 (00:11 +0200)] 
Bump version number for 1.11 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRakefile: Add missing ".gem" extension to "gem push" invocation
Wincent Colaiuta [Sun, 25 Apr 2010 22:13:05 +0000 (00:13 +0200)] 
Rakefile: Add missing ".gem" extension to "gem push" invocation

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRakefile: simplify spec task by shelling out
Wincent Colaiuta [Sun, 25 Apr 2010 22:02:57 +0000 (00:02 +0200)] 
Rakefile: simplify spec task by shelling out

Just run "spec spec" directly rather than depending on special support
and configuration from RSpec's "spec" Rake task.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoAdd spec.opts file
Wincent Colaiuta [Sun, 25 Apr 2010 22:00:15 +0000 (00:00 +0200)] 
Add spec.opts file

This provides colorized output etc when running "spec spec" from the
command line.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoMake specs non-executable
Wincent Colaiuta [Sun, 25 Apr 2010 21:58:02 +0000 (23:58 +0200)] 
Make specs non-executable

These were originally intended to be run independently as Ruby scripts,
but in practice they are only run using the "spec" tool, so remove the
bang line and unset the executable bit.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoUse wikitext/rails as a substitute for rails/init
Wincent Colaiuta [Sun, 25 Apr 2010 20:12:06 +0000 (22:12 +0200)] 
Use wikitext/rails as a substitute for rails/init

Seeing as it seems that Rails 3 and Bundler no longer automatically
execute the "rails/init" file, users will now have to require
"wikitext/rails" if they want to get the functionality that was
previously activated from the "rails/init" file.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoUpdate documentation for 1.11 release
Wincent Colaiuta [Sun, 25 Apr 2010 19:54:12 +0000 (21:54 +0200)] 
Update documentation for 1.11 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoAdd wikitext_wrapper executable
Wincent Colaiuta [Sun, 25 Apr 2010 19:36:54 +0000 (21:36 +0200)] 
Add wikitext_wrapper executable

As mentioned in commit 4488c7b, in the library files we trust either the
packaging system (usually RubyGems) or the user to correctly set up the
LOAD_PATH so that all files will be found when included using simple
relative paths like "wikitext/version" and so on.

The specs and benchmarking scripts already explcitly set the LOAD_PATH
and use absolute paths where appropriate to ensure that the local
version is tested rather than some other version that might be installed
elsewhere on the system.

This commit addresses the last missing piece of the puzzle, the
"bin/wikitext" executable. That was also changed to trust the LOAD_PATH
and use shorter relative paths, and this will work for the installed
case because the packaging system (RubyGems) will actually set up a
wrapper in the user's PATH which sets up the LOAD_PATH appropraitely.

In local testing however, no such wrapper script is in place so trying
to run "bin/wikitext" will either fail (when no version is installed on
the system in th PATH) or will most likely use the wrong version (when
another version is found elsewhere).

So, for the purposes of local testing we here add a wrapper script that
achieves the same affect as the wrapper created by RubyGems during
installation: we set up a local LOAD_PATH and then fire off the real
executable.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoUse relative paths in "require" statements
Wincent Colaiuta [Sun, 25 Apr 2010 19:25:02 +0000 (21:25 +0200)] 
Use relative paths in "require" statements

Trust the packaging system (usually RubyGems) to set up the LOAD_PATH
appropriately, thus allowing us to use cleaner and simpler "require"
startements.

Note that the spec suite already explicitly sets up the LOAD_PATH so
that the version in the current working directory is tested and not any
other versions which may be installed elsewhere on the system.

The "bin/wikitext" executable, however, doesn't do any special setup so
it will use the installed version if it is found first in the load-path.
This isn't a problem for real installs because the packaging system (ie
RubyGems) sets up an appropriate wrapper executable to set up the
LOAD_PATH first. (For local testing, I still need to set up such a
wrapper.)

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRemove repeated calls to expand_path
Wincent Colaiuta [Sun, 25 Apr 2010 18:45:57 +0000 (20:45 +0200)] 
Remove repeated calls to expand_path

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRakefile: run "make" target before "gem build"
Wincent Colaiuta [Mon, 19 Apr 2010 20:53:56 +0000 (22:53 +0200)] 
Rakefile: run "make" target before "gem build"

This is the reincarnation of commit 829011d, which fixed a subtle
problem with a missing file in the built gem.

We basically have to make sure that we've run the "make" target so that
all of the C files, including the Ragel-generated C file, is present in
the directory at the time "gem build" is called.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agogemspec: remove dependency on rake/gempackagetask
Wincent Colaiuta [Mon, 19 Apr 2010 20:42:20 +0000 (22:42 +0200)] 
gemspec: remove dependency on rake/gempackagetask

We don't need any of the bells and whistles of Rake's FileList, so can
just use Dir[].

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agogemspec: use more precise FileList specfication
Wincent Colaiuta [Mon, 19 Apr 2010 20:36:01 +0000 (22:36 +0200)] 
gemspec: use more precise FileList specfication

Make sure that any crud (things like .DS_Store files) that might be on
the filesystem doesn't get included in the gem.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agogemspec: update homepage attribute
Wincent Colaiuta [Mon, 19 Apr 2010 20:34:23 +0000 (22:34 +0200)] 
gemspec: update homepage attribute

There is still nothing very interesting on the Wikitext product page at
wincent.com, but it is still a more permanent home than rubyforge.org is
likely to be in the long term.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoExtract gemspec out into separate file
Wincent Colaiuta [Mon, 19 Apr 2010 20:31:16 +0000 (22:31 +0200)] 
Extract gemspec out into separate file

As recommended here for compatibility with Bundler's "install from Git
repo" feature:

  http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/

Note that while there is some disagreement in the comments on that post
about whether this is a clever or correct thing to do, in the present
case we are merely extracting the hand-edited gemspec out into a
separate file, not "checking in a generated file into the repo".

The change seems justified because it buys us compatibility with a
Bundler feature at no real cost.

Likewise, the other main complaint raised on a different post on the
same blog (ie. that building from Git repos can run into complications
where you end up with two different gems with different code but the
same version number) doesn't apply here because I have always used a
sane version numbering scheme, bumping the version number after each
release, so a released gem will never have the same version as an
intermediate version built directly from the repo:

  http://yehudakatz.com/2010/04/12/some-of-the-problems-bundler-solves/

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number post-release
Wincent Colaiuta [Sun, 21 Mar 2010 19:22:06 +0000 (20:22 +0100)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoFix CSS class of explicit mailto: URIs 1.10.1
Wincent Colaiuta [Sun, 21 Mar 2010 19:01:55 +0000 (20:01 +0100)] 
Fix CSS class of explicit mailto: URIs

Previously we only correctly handled "mailto" links when the link target
itself included the "mailto:" prefix.

In other cases, where the prefix was passed in separately, for example,
we did not apply the special CSS class.

Now we always check both the link target and the prefix to see if either
of them begins with "mailto:".

Fixes the spec failures reported in:

  https://wincent.com/issues/1389

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoRebuild with Ragel 6.6
Wincent Colaiuta [Sun, 21 Mar 2010 17:54:20 +0000 (18:54 +0100)] 
Rebuild with Ragel 6.6

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoDeclare development dependencies in gemspec
Wincent Colaiuta [Sun, 21 Mar 2010 17:38:01 +0000 (18:38 +0100)] 
Declare development dependencies in gemspec

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoFix builds on 64-bit Darwin platforms
Wincent Colaiuta [Sun, 21 Mar 2010 17:32:57 +0000 (18:32 +0100)] 
Fix builds on 64-bit Darwin platforms

Way back in ancient history when wikitext still used an ANTLR-generated
lexer, the evil commit 7a510102 added a horrible specific ARCHFLAGS
override to overcome the fact that ANTLR didn't produce Universal
binaries.

This worked fine on 32-bit machines, and the evil commit was allowed to
persist through the codebase for over two years, long after ANTLR was
ripped out and replaced with the vastly superior Ragel-generated lexer.

Today on testing on a 64-bit Darwin machine for the first time I
discovered the evil, and this commit expurgates it.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number post-release
Wincent Colaiuta [Sun, 1 Nov 2009 15:59:37 +0000 (16:59 +0100)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoBump version number for 1.10 release 1.10
Wincent Colaiuta [Sun, 1 Nov 2009 14:59:49 +0000 (15:59 +0100)] 
Bump version number for 1.10 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoUpdate release notes for 1.10 release
Wincent Colaiuta [Sun, 1 Nov 2009 14:57:26 +0000 (15:57 +0100)] 
Update release notes for 1.10 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoTeach wikitext tool to accept file arguments
Wincent Colaiuta [Sun, 1 Nov 2009 13:26:55 +0000 (14:26 +0100)] 
Teach wikitext tool to accept file arguments

If additional arguments are supplied they will be interpreted as
files to be processed in non-interactive mode (and any input on STDIN
will be ignored).

This is the final part of ticket #1399; see:

  https://wincent.com/issues/1399

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoMove command-line tool code inside Wikitext::Tool namespace
Wincent Colaiuta [Sun, 1 Nov 2009 12:56:22 +0000 (13:56 +0100)] 
Move command-line tool code inside Wikitext::Tool namespace

This keeps the methods declared in the file out of the global namespace.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
12 years agoDon't require highline unless running in interactive mode
Wincent Colaiuta [Sun, 1 Nov 2009 12:50:40 +0000 (13:50 +0100)] 
Don't require highline unless running in interactive mode

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoAdd non-interactive (piping) mode
Wincent Colaiuta [Sat, 19 Sep 2009 10:16:05 +0000 (12:16 +0200)] 
Add non-interactive (piping) mode

If input is from a pipe or output is to a pipe we enter non-interactive
mode and just process the input from STDIN and send it to STDOUT without
any prompts, looping, or colorization.

This is a partial implementation of the feature requested here:

  https://wincent.com/issues/1399

(The remaining part is to also accept filename arguments as a means of
entering non-interactive mode.)

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoDon't require rubygems unless loading highline library fails
Wincent Colaiuta [Sat, 19 Sep 2009 09:58:25 +0000 (11:58 +0200)] 
Don't require rubygems unless loading highline library fails

Don't depend on rubygems unless necessary.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoPrint version when launching wikitext executable
Wincent Colaiuta [Sat, 19 Sep 2009 09:57:01 +0000 (11:57 +0200)] 
Print version when launching wikitext executable

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoInclude "wikitext" executable in Gem distribution
Wincent Colaiuta [Sat, 19 Sep 2009 09:47:43 +0000 (11:47 +0200)] 
Include "wikitext" executable in Gem distribution

The "wikitext" command-line tool has been in the repository for quite a
while, but never included in the Gem distribution. Included by user
request; see:

  https://wincent.com/issues/1398

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoBump version number post-release
Wincent Colaiuta [Thu, 6 Aug 2009 12:36:53 +0000 (14:36 +0200)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoBump version number for 1.9 release 1.9
Wincent Colaiuta [Thu, 6 Aug 2009 12:35:10 +0000 (14:35 +0200)] 
Bump version number for 1.9 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoUpdate RDoc for new "link_proc" feature
Wincent Colaiuta [Thu, 6 Aug 2009 12:33:46 +0000 (14:33 +0200)] 
Update RDoc for new "link_proc" feature

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoRemove repetition of ID2SYM() and rb_intern()
Wincent Colaiuta [Thu, 6 Aug 2009 12:14:21 +0000 (14:14 +0200)] 
Remove repetition of ID2SYM() and rb_intern()

Use a couple of temporary variables to avoid the ugly repeated calls to
ID2SYM() and rb_intern() with exactly the same parameters each time.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoSilence compiler warning in StringValue
Wincent Colaiuta [Thu, 6 Aug 2009 12:11:21 +0000 (14:11 +0200)] 
Silence compiler warning in StringValue

Our use of "StringValue(j)", where "j" is of type "long" and the macro
wants a value of type "VALUE" ("unsigned long") produce a warning that
"pointer targets in passing argument 1 of ‘rb_string_value’ differ in
signedness".

Merely casting ("StringValue((VALUE)j)") doesn't work because
"StringValue" itself is a macro and produces this warning: "argument to
'&' not really an lvalue; this will be a hard error in the future".

So use a temporary variable to suppress the warning without having to
use a cast inside the macro.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoImplement "link_proc" option ("red link" support)
Wincent Colaiuta [Thu, 23 Jul 2009 20:41:27 +0000 (22:41 +0200)] 
Implement "link_proc" option ("red link" support)

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoAccept optional options hash on "nil.w"
Wincent Colaiuta [Fri, 19 Jun 2009 11:04:29 +0000 (13:04 +0200)] 
Accept optional options hash on "nil.w"

This can help us to avoid constructs like:

  text = attribute.empty? ? '' : attribute.w(:base_heading_level => 3)

We can instead just use:

  text = attribute.w :base_heading_level => 3

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoUse fixed-width markup in release notes for class names etc
Wincent Colaiuta [Wed, 27 May 2009 15:49:24 +0000 (17:49 +0200)] 
Use fixed-width markup in release notes for class names etc

Make things more consistent with the rest of the documentation by using
fixed-width font markup for CSS class names and HTML tags in the release
notes (rather than using double quotes).

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoRemove "not yet released" label from 1.8 heading in release notes
Wincent Colaiuta [Wed, 27 May 2009 15:48:03 +0000 (17:48 +0200)] 
Remove "not yet released" label from 1.8 heading in release notes

Signed-off-by: Wincent Colaiuta <win@wincent.com>
13 years agoBump version number post-release
Wincent Colaiuta [Wed, 27 May 2009 15:45:35 +0000 (17:45 +0200)] 
Bump version number post-release

Signed-off-by: Wincent Colaiuta <win@wincent.com>