irwi 0.2.3 → 0.2.4

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.
@@ -88,11 +88,20 @@ If you have Rails prior to 2.3 when you should also call:
88
88
 
89
89
  To generate default wiki views.
90
90
 
91
+ == I18n Issues
92
+
93
+ If you get some weird errors like
94
+
95
+ missing interpolation argument in "%{count} %B %Y, %H:%M"
96
+
97
+ Please check your Rails and I18n versions, because of incompatibility issue between Rails prior to 2.3.6 and I18n 0.4.x (http://github.com/svenfuchs/i18n/issues/issue/20). If it's your case, consider upgrade of Rails or downgrade of I18n. Big thanks to Tomasz Stachewicz for information ;)
98
+
91
99
  == Contributors
92
100
 
93
101
  * Alexey Noskov (http://github.com/alno)
94
102
  * Ravi Bhim (http://github.com/ravibhim)
95
- * http://github.com/valodzka
103
+ * Pavel Valodzka (http://github.com/valodzka)
104
+ * Xavier Defrang (http://github.com/xavier)
96
105
 
97
106
  Feel free to add yourself when you add new features.
98
107
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{irwi}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexey Noskov", "Ravi Bhim"]
12
- s.date = %q{2010-06-24}
12
+ s.date = %q{2010-09-09}
13
13
  s.description = %q{Irwi is Ruby on Rails plugin which adds wiki functionality to your application. }
14
14
  s.email = %q{alexey.noskov@gmail.com ravi.bhim@yahoo.com}
15
15
  s.extra_rdoc_files = [
@@ -84,7 +84,7 @@ Gem::Specification.new do |s|
84
84
  s.homepage = %q{http://github.com/alno/irwi}
85
85
  s.rdoc_options = ["--charset=UTF-8"]
86
86
  s.require_paths = ["lib"]
87
- s.rubygems_version = %q{1.3.6}
87
+ s.rubygems_version = %q{1.3.7}
88
88
  s.summary = %q{Irwi is Ruby on Rails plugin which adds wiki functionality to your application.}
89
89
  s.test_files = [
90
90
  "spec/support/route_mapper_spec.rb",
@@ -105,7 +105,7 @@ Gem::Specification.new do |s|
105
105
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
106
106
  s.specification_version = 3
107
107
 
108
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
108
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
109
109
  s.add_runtime_dependency(%q<diff-lcs>, [">= 1.1.2"])
110
110
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
111
111
  else
@@ -39,7 +39,7 @@ module Irwi::Helpers::WikiPagesHelper
39
39
  end
40
40
 
41
41
  def wiki_diff( old_text, new_text )
42
- Irwi.config.comparator.render_changes( old_text, new_text )
42
+ Irwi.config.comparator.render_changes(h(old_text), h(new_text))
43
43
  end
44
44
 
45
45
  def wiki_user( user )
@@ -55,8 +55,8 @@ module Irwi::Helpers::WikiPagesHelper
55
55
  \]\]
56
56
  (\w+)?/xu do |m|
57
57
  text = "#$2#$3"
58
- link = $1 || $2
59
- "<a href=\"#{wiki_link link}\">#{text}</a>"
58
+ link, anchor = if $1 then $1.split('#', 2) else $2 end
59
+ "<a href=\"#{wiki_link link}#{ '#' + anchor if anchor}\">#{text}</a>"
60
60
  end
61
61
  end
62
62
 
@@ -116,6 +116,12 @@ describe Irwi::Helpers::WikiPagesHelper do
116
116
  @m.wiki_linkify( '[[Some other page|Go other page]] - link' ).should == '<a href="url">Go other page</a> - link'
117
117
  @m.wiki_linkify( '[[Some other page]]s are there' ).should == '<a href="url">Some other pages</a> are there'
118
118
  end
119
+
120
+ specify "should linkify with anchors" do
121
+ @m.should_receive(:wiki_link).once.with('Some other page').and_return('url')
122
+
123
+ @m.wiki_linkify( 'And [[Some other page#other|other page]]' ).should == 'And <a href="url#other">other page</a>'
124
+ end
119
125
 
120
126
  specify "should generate link for non-existent page" do
121
127
  page_class = mock "WikiPageClass"
@@ -142,6 +148,11 @@ describe Irwi::Helpers::WikiPagesHelper do
142
148
  @m.wiki_link( 'Page title' ).should == 'url'
143
149
  end
144
150
 
151
+ specify "not be vulnerable to XSS when showing a diff" do
152
+ xss = '<script>alert("exploit")</script>'
153
+ @m.wiki_diff('foo bar', "foo #{xss} bar").should_not include(xss)
154
+ end
155
+
145
156
  end
146
157
 
147
158
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irwi
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 31
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 2
8
- - 3
9
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
10
11
  platform: ruby
11
12
  authors:
12
13
  - Alexey Noskov
@@ -15,16 +16,18 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-06-24 00:00:00 +04:00
19
+ date: 2010-09-09 00:00:00 +04:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
22
23
  name: diff-lcs
23
24
  prerelease: false
24
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
25
27
  requirements:
26
28
  - - ">="
27
29
  - !ruby/object:Gem::Version
30
+ hash: 23
28
31
  segments:
29
32
  - 1
30
33
  - 1
@@ -36,9 +39,11 @@ dependencies:
36
39
  name: rspec
37
40
  prerelease: false
38
41
  requirement: &id002 !ruby/object:Gem::Requirement
42
+ none: false
39
43
  requirements:
40
44
  - - ">="
41
45
  - !ruby/object:Gem::Version
46
+ hash: 13
42
47
  segments:
43
48
  - 1
44
49
  - 2
@@ -129,23 +134,27 @@ rdoc_options:
129
134
  require_paths:
130
135
  - lib
131
136
  required_ruby_version: !ruby/object:Gem::Requirement
137
+ none: false
132
138
  requirements:
133
139
  - - ">="
134
140
  - !ruby/object:Gem::Version
141
+ hash: 3
135
142
  segments:
136
143
  - 0
137
144
  version: "0"
138
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
+ none: false
139
147
  requirements:
140
148
  - - ">="
141
149
  - !ruby/object:Gem::Version
150
+ hash: 3
142
151
  segments:
143
152
  - 0
144
153
  version: "0"
145
154
  requirements: []
146
155
 
147
156
  rubyforge_project:
148
- rubygems_version: 1.3.6
157
+ rubygems_version: 1.3.7
149
158
  signing_key:
150
159
  specification_version: 3
151
160
  summary: Irwi is Ruby on Rails plugin which adds wiki functionality to your application.