wikitext 1.2.1 → 1.3.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.
@@ -1,4 +1,4 @@
1
- # Copyright 2008 Wincent Colaiuta
1
+ # Copyright 2008-2009 Wincent Colaiuta
2
2
  # This program is free software: you can redistribute it and/or modify
3
3
  # it under the terms of the GNU General Public License as published by
4
4
  # the Free Software Foundation, either version 3 of the License, or
@@ -16,18 +16,10 @@ require 'wikitext/string'
16
16
 
17
17
  module Wikitext
18
18
  class TemplateHandler
19
- def initialize view; end
20
19
 
21
- def render text, locals = {}
22
- text.w
20
+ # tested with Rails 2.2.2: the API has now changed so many times that I'm no longer going to support older versions of Rails
21
+ def self.call template
22
+ 'template.source.w'
23
23
  end
24
24
  end
25
25
  end
26
-
27
- if ActionView::Template.respond_to? :register_template_handler # Rails 2.1.0_RC1 and above
28
- ActionView::Template.register_template_handler :wikitext, Wikitext::TemplateHandler
29
- elsif ActionView::Base.respond_to? :register_template_handler # Rails 2.0.2
30
- ActionView::Base.register_template_handler :wikitext, Wikitext::TemplateHandler
31
- else
32
- raise "Incompatible Rails API version (can't find register_template_handler method)"
33
- end
@@ -1,4 +1,4 @@
1
- # Copyright 2007-2008 Wincent Colaiuta
1
+ # Copyright 2007-2009 Wincent Colaiuta
2
2
  # This program is free software: you can redistribute it and/or modify
3
3
  # it under the terms of the GNU General Public License as published by
4
4
  # the Free Software Foundation, either version 3 of the License, or
@@ -13,5 +13,5 @@
13
13
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
14
14
 
15
15
  module Wikitext
16
- VERSION = '1.2.1'
16
+ VERSION = '1.3.0'
17
17
  end # module Wikitext
data/spec/spec_helper.rb CHANGED
@@ -44,11 +44,11 @@ end
44
44
 
45
45
  module Wikitext
46
46
  if not const_defined? 'EXTDIR'
47
- # append the local "ext" directory to search path if not already present
47
+ # prepend the local "ext" directory to search path if not already present
48
48
  base = File.join(File.dirname(__FILE__), '..')
49
49
  EXTDIR = Pathname.new(File.join(base, 'ext')).realpath
50
50
  normalized = $:.collect { |path| Pathname.new(path).realpath rescue path }
51
- $:.push(EXTDIR) unless normalized.include?(EXTDIR)
51
+ $:.unshift(EXTDIR) unless normalized.include?(EXTDIR)
52
52
  end
53
53
  end # module Wikitext
54
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wikitext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wincent Colaiuta
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-11 00:00:00 +02:00
12
+ date: 2009-01-04 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  requirements: []
97
97
 
98
98
  rubyforge_project: wikitext
99
- rubygems_version: 1.2.0
99
+ rubygems_version: 1.3.1
100
100
  signing_key:
101
101
  specification_version: 2
102
102
  summary: Wikitext-to-HTML translator