motiro 0.6.5 → 0.6.6
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.
- data/README +1 -1
- data/app/controllers/report_controller.rb +10 -6
- data/app/controllers/wiki_controller.rb +12 -2
- data/app/core/version.rb +1 -1
- data/app/core/wiki_reporter.rb +2 -2
- data/app/helpers/application_helper.rb +7 -0
- data/app/models/feed_observer.rb +27 -0
- data/app/models/page.rb +4 -0
- data/app/models/{page_sweeper.rb → wiki_sweeper.rb} +4 -2
- data/app/reporters/darcs_reporter.rb +1 -1
- data/app/views/report/list.rhtml +2 -4
- data/app/views/wiki/page_feed.rxml +25 -0
- data/config/environment.rb +1 -1
- data/config/routes.rb +8 -14
- data/public/stylesheets/motiro.css +5 -0
- data/test/acceptance/account_test.rb +3 -3
- data/test/acceptance/events_test.rb +1 -1
- data/test/acceptance/main_page_test.rb +2 -2
- data/test/acceptance/subversion_test.rb +16 -16
- data/test/fixtures/pages.yml +6 -0
- data/test/fixtures/revisions.yml +36 -1
- data/test/functional/report_controller_test.rb +4 -4
- data/test/functional/report_features_test.rb +1 -1
- data/test/functional/report_subversion_test.rb +4 -4
- data/test/functional/root_controller_test.rb +1 -1
- data/test/functional/wiki_controller_test.rb +29 -5
- data/test/unit/darcs_reporter_test.rb +2 -2
- data/test/unit/wiki_reporter_test.rb +13 -0
- data/vendor/plugins/global_routing/init.rb +53 -0
- metadata +345 -341
@@ -41,7 +41,7 @@ class DarcsReporterTest < Test::Unit::TestCase
|
|
41
41
|
assert_equal 'thiago.arrais', hl.author
|
42
42
|
assert_equal 'Some refactoring after the mess', hl.description
|
43
43
|
assert_equal Time.utc(2006, 7, 17, 20, 9, 39), hl.happened_at
|
44
|
-
assert_equal '20060717200939-49d33-c04fbb63892ae64cd96d1ad8f1ad2dd0a6e8e7da
|
44
|
+
assert_equal '20060717200939-49d33-c04fbb63892ae64cd96d1ad8f1ad2dd0a6e8e7da',
|
45
45
|
hl.rid
|
46
46
|
assert_equal 'darcs', hl.reported_by
|
47
47
|
end
|
@@ -49,7 +49,7 @@ class DarcsReporterTest < Test::Unit::TestCase
|
|
49
49
|
def test_fetches_headline_details
|
50
50
|
@darcs_changes = P1
|
51
51
|
|
52
|
-
rid = '20060717200939-49d33-c04fbb63892ae64cd96d1ad8f1ad2dd0a6e8e7da
|
52
|
+
rid = '20060717200939-49d33-c04fbb63892ae64cd96d1ad8f1ad2dd0a6e8e7da'
|
53
53
|
hl = @reporter.headline(rid)
|
54
54
|
|
55
55
|
assert_equal 'thiago.arrais', hl.author
|
@@ -90,6 +90,19 @@ class WikiReporterTest < Test::Unit::TestCase
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
def test_provides_includes_page_text_in_headline_description
|
94
|
+
FlexMock.use do |page_provider|
|
95
|
+
page_provider.should_receive(:find).
|
96
|
+
zero_or_more_times.
|
97
|
+
and_return([Page.new(:name => 'SomePage').revise(bob, now,
|
98
|
+
:title => 'Some title',
|
99
|
+
:text => 'Here goes some text for some wiki page')])
|
100
|
+
hl = FeaturesReporter.new(:page_provider => page_provider).headlines[0]
|
101
|
+
assert_equal "Some title\n\nHere goes some text for some wiki page", hl.description
|
102
|
+
assert_equal 'Some title', hl.title
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
93
106
|
def test_respond_to_latest_headlines
|
94
107
|
FlexMock.use do |page_provider|
|
95
108
|
page_provider.should_receive(:find).zero_or_more_times.and_return([])
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Motiro - A project tracking tool
|
2
|
+
# Copyright (C) 2006-2007 Thiago Arrais
|
3
|
+
#
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation; either version 2 of the License, or
|
7
|
+
# any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program; if not, write to the Free Software
|
16
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
|
18
|
+
module ActionController::Routing
|
19
|
+
class MotiroSegment < DynamicSegment
|
20
|
+
def match_extraction(next_capture)
|
21
|
+
"imatch = match[#{next_capture}].match(/-/)\n" +
|
22
|
+
"params[:page_name] = imatch ? imatch.pre_match : match[#{next_capture}]\n" +
|
23
|
+
"params[:locale] = imatch.post_match unless imatch.nil?"
|
24
|
+
end
|
25
|
+
|
26
|
+
def extraction_code
|
27
|
+
s = "page_name_value = hash[:page_name] && hash[:page_name].clone"
|
28
|
+
s << "\nreturn [nil, nil] if page_name_value.nil?"
|
29
|
+
s << "\n#{expiry_statement}"
|
30
|
+
|
31
|
+
s << "\nlocale_value = hash[:locale]"
|
32
|
+
s << "\noptions.delete(:locale)"
|
33
|
+
s << "\nexpired, hash = true, options if !expired && expire_on[:locale]"
|
34
|
+
s << "\npage_name_value << '-' << locale_value unless locale_value.nil?"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class MotiroRouteBuilder < RouteBuilder
|
39
|
+
def segment_for(string)
|
40
|
+
if string.match(/\A:page_name/)
|
41
|
+
[MotiroSegment.new(:page_name), $~.post_match]
|
42
|
+
else
|
43
|
+
super
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
class RouteSet
|
49
|
+
def builder
|
50
|
+
@builder ||= MotiroRouteBuilder.new
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|