From 5d1bd8af067a5554ee8f2994691a5109e175fa2b Mon Sep 17 00:00:00 2001 From: Joachim Filip Ignacy Bartosik Date: Mon, 4 Jul 2011 19:28:33 +0200 Subject: Pull information on how long meeting took from Gentoo archives --- site/app/models/agenda_item.rb | 75 +++++- site/db/schema.rb | 7 +- site/features/agenda_items.feature | 4 + .../features/step_definitions/agenda_item_steps.rb | 13 + site/features/support/paths.rb | 3 + site/lib/tasks/update_discussion_times.rb | 10 + ...181309f75a15da95fffdf921bf313b87.xml?passthru=1 | 237 ++++++++++++++++++ ...3132152624ffdcf3217437d95e75c634.xml?passthru=1 | 236 ++++++++++++++++++ ...59e3fb9cae272cb4fea7a40d6940d7b7.xml?passthru=1 | 235 ++++++++++++++++++ ...b5b2b992bbbfb4f5e7532db90af8f28a.xml?passthru=1 | 230 +++++++++++++++++ ...c0c8b0aa686f83a7268cd13f067d6da2.xml?passthru=1 | 231 +++++++++++++++++ ...e490369a0c7e6c279af9baef63897629.xml?passthru=1 | 275 +++++++++++++++++++++ site/spec/models/agenda_item_spec.rb | 27 ++ site/spec/support/http_stub.rb | 22 ++ 14 files changed, 1597 insertions(+), 8 deletions(-) create mode 100644 site/lib/tasks/update_discussion_times.rb create mode 100644 site/spec/files/msg_181309f75a15da95fffdf921bf313b87.xml?passthru=1 create mode 100644 site/spec/files/msg_3132152624ffdcf3217437d95e75c634.xml?passthru=1 create mode 100644 site/spec/files/msg_59e3fb9cae272cb4fea7a40d6940d7b7.xml?passthru=1 create mode 100644 site/spec/files/msg_b5b2b992bbbfb4f5e7532db90af8f28a.xml?passthru=1 create mode 100644 site/spec/files/msg_c0c8b0aa686f83a7268cd13f067d6da2.xml?passthru=1 create mode 100644 site/spec/files/msg_e490369a0c7e6c279af9baef63897629.xml?passthru=1 create mode 100644 site/spec/support/http_stub.rb diff --git a/site/app/models/agenda_item.rb b/site/app/models/agenda_item.rb index eaa6ede..b76b067 100644 --- a/site/app/models/agenda_item.rb +++ b/site/app/models/agenda_item.rb @@ -3,11 +3,12 @@ class AgendaItem < ActiveRecord::Base hobo_model # Don't put anything above this fields do - title :string - discussion :string - body :markdown - rejected :boolean, :default => false - timelimits :text, :null => false, :default => '' + title :string + discussion :string + body :text + rejected :boolean, :default => false + timelimits :text, :null => false, :default => '' + discussion_time :string, :null => false, :default => '' timestamps end @@ -25,6 +26,7 @@ class AgendaItem < ActiveRecord::Base end def update_permitted? + return false if discussion_time_changed? return false if agenda._?.state == 'old' return false if user_changed? return true if acting_user.council_member? @@ -55,6 +57,69 @@ class AgendaItem < ActiveRecord::Base end protected + # Updated discussion time for a single agenda item + # protected because we want to call it only from + # AgendaItem.update_discussion_times + # or similar methods in children classes (if there will be any) + def update_discussion_time + link_regexp = /^(https?:\/\/)?archives.gentoo.org\/([a-zA-Z-]+)\/(msg_[a-fA-F0-9]+.xml)$/ + uri_match = link_regexp.match(discussion) + return unless uri_match + + group = uri_match[2] + msg = uri_match[3] + message_info = get_message(group, msg) + first_date = Time.parse message_info[:date] + last_date = first_date + + to_visit = [] + visited = Set.new([msg]) + + to_visit += message_info[:links] + + until to_visit.empty? + msg = to_visit.pop() + + next if visited.include? msg + visited.add msg + message_info = get_message(group, msg) + current_date = Time.parse message_info[:date] + + first_date = current_date if first_date > current_date + last_date = current_date if last_date < current_date + to_visit += message_info[:links] + end + + duration = ((last_date - first_date) / 1.day).floor + first_date = first_date.strftime '%Y.%m.%d' + last_date = last_date.strftime '%Y.%m.%d' + self.discussion_time = "From #{first_date} to #{last_date}, #{duration} full days" + self.save! + end + + def get_message(group, msg) + Net::HTTP.start("archives.gentoo.org") { |http| + resp = http.get("/#{group}/#{msg}?passthru=1") + doc = REXML::Document.new(resp.body) + table = REXML::XPath.match(doc, '//table/tr[th=\'Replies:\']/../tr') + in_replies = false + reply_links = [] + table.each do |row| + th = REXML::XPath.first(row, "th") + if th + in_replies = (th.text == 'Replies:') + else + next unless in_replies + reply = REXML::XPath.first(row, "ti/uri") + reply_link = reply.attribute(:link).to_s + reply_links.push(reply_link) + end + end + date = resp.body.match(/\<\!--X-Date: (.*) --\>/)[1] + {:date => date, :links => reply_links} + } + end + def timelimits_entered_properly regexp = /^\d+:\d+( .*)?$/ for line in timelimits.split("\n") diff --git a/site/db/schema.rb b/site/db/schema.rb index c39cb60..2b69ac8 100644 --- a/site/db/schema.rb +++ b/site/db/schema.rb @@ -10,18 +10,19 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110706144851) do +ActiveRecord::Schema.define(:version => 20110706145154) do create_table "agenda_items", :force => true do |t| t.string "title" t.string "discussion" t.text "body" - t.boolean "rejected", :default => false + t.boolean "rejected", :default => false t.datetime "created_at" t.datetime "updated_at" t.integer "user_id" t.integer "agenda_id" - t.text "timelimits", :default => "", :null => false + t.text "timelimits", :default => "", :null => false + t.string "discussion_time", :default => "", :null => false end add_index "agenda_items", ["agenda_id"], :name => "index_agenda_items_on_agenda_id" diff --git a/site/features/agenda_items.feature b/site/features/agenda_items.feature index 18d301f..2507e2d 100644 --- a/site/features/agenda_items.feature +++ b/site/features/agenda_items.feature @@ -54,3 +54,7 @@ Feature: Suggest Agenda Items And "Reject" button should be inline And I should see "Add to current agenda" button inside content body And "Add to current agenda" button should be inline + + Scenario: View discussion times + Given some agenda item with discussion times + Then I should see discussion times when viewing agenda items diff --git a/site/features/step_definitions/agenda_item_steps.rb b/site/features/step_definitions/agenda_item_steps.rb index 5bf5de2..b600bad 100644 --- a/site/features/step_definitions/agenda_item_steps.rb +++ b/site/features/step_definitions/agenda_item_steps.rb @@ -39,3 +39,16 @@ Then /^"([^"]*)" button should be inline$/ do |arg1| page.all(:xpath, "//input[@type='submit'][@value='#{arg1}']").should_not be_empty end end + +Given /^some agenda item with discussion times$/ do + Factory(:agenda_item) + Factory(:agenda_item, :discussion_time => 'From 2011.07.01 to 2011.07.05, 4 full days') + Factory(:agenda_item, :discussion_time => 'manually set') +end + +Then /^I should see discussion times when viewing agenda items$/ do + AgendaItem.all.each do |item| + When "I am on agenda item number #{item.id} show page" + Then "I should see \"#{item.discussion_time}\"" + end +end diff --git a/site/features/support/paths.rb b/site/features/support/paths.rb index e08acc5..92e736e 100644 --- a/site/features/support/paths.rb +++ b/site/features/support/paths.rb @@ -35,6 +35,9 @@ module NavigationHelpers when /([1-9]*)th agenda page/ agenda_path(Agenda.find $1) + when /agenda item number ([1-9]*) show page/ + agenda_item_path($1) + when /newest agenda item page/ agenda_item_path(AgendaItem.last) diff --git a/site/lib/tasks/update_discussion_times.rb b/site/lib/tasks/update_discussion_times.rb new file mode 100644 index 0000000..7d85595 --- /dev/null +++ b/site/lib/tasks/update_discussion_times.rb @@ -0,0 +1,10 @@ +desc = 'Update discussion times for ageda items that are not assigned or assigned to current agenda' + +namespace :management do + task :update_discussion_times => :environment do + current_items = Agenda.current.agenda_items + unassigned_items = AgendaItem.agenda_is(nil) + all_items = current_items + unassigned_items + all_items.each { |item| item.update_discussion_time } + end +end diff --git a/site/spec/files/msg_181309f75a15da95fffdf921bf313b87.xml?passthru=1 b/site/spec/files/msg_181309f75a15da95fffdf921bf313b87.xml?passthru=1 new file mode 100644 index 0000000..9b17ded --- /dev/null +++ b/site/spec/files/msg_181309f75a15da95fffdf921bf313b87.xml?passthru=1 @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + +List Archive: gentoo-soc + + + Gentoo Mailing List Administrators + + + +Archive of the gentoo-soc mailing list. + + +1.0 +Jul 05, 2011 + + +
+ + +List Archive: gentoo-soc + + + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + + + + + + + +
Navigation:
Headers:
+ + +To: + + +gentoo-soc@g.o + + + + + +From: + + +Joachim Filip Bartosik <jbartosik@...> + + + + + +Subject: + + + Council web app - weekly report #2 + + + + + +Date: + + +Tue, 07 Jun 2011 22:05:27 +0200 + + + +
+ + + + + + + + +
(Note: this is c&p from my blog [0])
+
+Last week I:
+
+        Fixed some bugs
+        Added support for proxies:
+            each council member can appoint one proxy per meeting
+            proxy must not be a council member
+            council member who appointed proxy will not be listed as
+‘voter’ (for IRC bot)
+            appointed proxy will be listed as voter
+        Nearly finished work on bot
+            It obtains list of users allowed to vote from application
+            It obtains list of agenda items (with voting options for
+each item)
+            It helps to manage meeting (you can use #nextitem and
+#previtem commands)
+            It manages voting (#startvote, #endvote)
+        Application can send email reminders about meetings.
+
+For short description of project and sources, read this[1].
+
+[0]
+http://ahenobarbi.wordpress.com/2011/06/07/council-application-%E2%80%93-weekly-report-2/
+[1]
+http://ahenobarbi.wordpress.com/2011/05/30/council-application-short-introduction/
+
+
+ + + + + + signature.asc (OpenPGP digital signature) + + +
Attachment:
+ + + + + + + + + + + + Re: Council web app - weekly report #3
+ -- Joachim Filip Bartosik +
+ + + + + + + + + + Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + Re: Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + Re: Council web app - introduction + + + + + + + Re: Council web app - weekly report #3 + + + + + + + Gentoo Maven Integration - Weekly Report #2 + + + + + + + Re: Re: Rework Porthole to use the new public portage API -- Weekly report #1 + + +
Replies:
References:
Navigation:
Previous by thread:
Next by thread:
Previous by date:
Next by date:
+ + + + + + +
+
+
diff --git a/site/spec/files/msg_3132152624ffdcf3217437d95e75c634.xml?passthru=1 b/site/spec/files/msg_3132152624ffdcf3217437d95e75c634.xml?passthru=1 new file mode 100644 index 0000000..1636f58 --- /dev/null +++ b/site/spec/files/msg_3132152624ffdcf3217437d95e75c634.xml?passthru=1 @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + +List Archive: gentoo-soc + + + Gentoo Mailing List Administrators + + + +Archive of the gentoo-soc mailing list. + + +1.0 +Jul 05, 2011 + + +
+ + +List Archive: gentoo-soc + + + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + + + + + + + +
Navigation:
Headers:
+ + +To: + + +gentoo-soc@g.o + + + + + +From: + + +Joachim Filip Bartosik <jbartosik@...> + + + + + +Subject: + + + Re: Council web app - weekly report #3 + + + + + +Date: + + +Mon, 13 Jun 2011 10:46:59 +0200 + + + +
+ + + + + + + + +
(Note: this is c&p from my blog [0])
+Last week I:
+
+    Wrote Supybot[1] plugin that regularly fetches JSON data from given
+location. Then it checks timestamp, if timestam is newer then previous
+it sends message to listed users.
+    Application now tracks slaking properly - it marks participation
+after meeting (council members who voted at least once are present).
+Then it calculates "slacking status" for current council members based
+on council term start date and participations.
+
+For short description of project and sources, read this[2].
+
+[0]
+http://ahenobarbi.wordpress.com/2011/06/13/council-application-%E2%80%93-weekly-report-3/
+[1] http://sourceforge.net/projects/supybot/
+[2]
+http://ahenobarbi.wordpress.com/2011/05/30/council-application-short-introduction/
+
+
+ + + + + + signature.asc (OpenPGP digital signature) + + +
Attachment:
+ + + + + + + + + + + + Re: Re: Council web app - weekly report #3
+ -- Rich Freeman +
+ + + + + + + + + + Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + Re: Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + Council web app - weekly report #2
+ -- Joachim Filip Bartosik +
+ + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + Council web app - weekly report #2 + + + + + + + Re: Re: Council web app - weekly report #3 + + + + + + + Project Glentoo: Week #3 Status Report + + + + + + + Rework Porthole to use the new public portage API -- Weekly report #3 + + +
Replies:
References:
Navigation:
Previous by thread:
Next by thread:
Previous by date:
Next by date:
+ + + + + + +
+
+
diff --git a/site/spec/files/msg_59e3fb9cae272cb4fea7a40d6940d7b7.xml?passthru=1 b/site/spec/files/msg_59e3fb9cae272cb4fea7a40d6940d7b7.xml?passthru=1 new file mode 100644 index 0000000..3af9ffa --- /dev/null +++ b/site/spec/files/msg_59e3fb9cae272cb4fea7a40d6940d7b7.xml?passthru=1 @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + +List Archive: gentoo-soc + + + Gentoo Mailing List Administrators + + + +Archive of the gentoo-soc mailing list. + + +1.0 +Jul 04, 2011 + + +
+ + +List Archive: gentoo-soc + + + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + + + + + + + +
Navigation:
Headers:
+ + +To: + + +gentoo-soc@g.o + + + + + +From: + + +Joachim Filip Bartosik <jbartosik@...> + + + + + +Subject: + + + Council web app - weekly report #4 + + + + + +Date: + + +Mon, 20 Jun 2011 11:38:34 +0200 + + + +
+ + + + + + + + +
(Note: this is c&p from my blog [0])
+
+Last week I used metrical[1] on the web app and improved tests coverage
+and variable naming. I also removed some stuff it reported as “code
+duplication”. Metrical warned about some stuff, but I couldn’t find a
+reasonable way to fix it.
+
+I tried to switch to capybara-webkit[2] for cucumber tests but I
+couldn’t find a way to remove session cookies (and I need it to test
+“Remember me” feature) so I made a feature request[3] (including a
+suggested patch) and I’m waiting.
+
+I added
+#option add
+#option remove
+#option list
+
+commands to MeetBot[4] to allow changing voting options during meeting
+(I must do some work on the webapp end to handle added and removed
+option properly).
+
+I also improved tests for my changes to MeetBot[4] and wrote test for
+Reminder (the Supybot[5]  plugin I wrote last week[6]).
+
+[0]
+http://ahenobarbi.wordpress.com/2011/06/20/council-application-%E2%80%93-weekly-report-4/
+[1] http://rubydoc.info/gems/metrical/0.0.5/frames
+[2] http://rubygems.org/gems/capybara-webkit
+[3] https://github.com/thoughtbot/capybara-webkit/issues/79
+[4] http://wiki.debian.org/MeetBot
+[5] http://sourceforge.net/projects/supybot/
+[6]
+http://ahenobarbi.wordpress.com/2011/06/13/council-application-%E2%80%93-weekly-report-3/
+
+
+
+ + + + + + signature.asc (OpenPGP digital signature) + + +
Attachment:
+ + + + + + + + + + + + + + Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + Re: Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + Re: Re: Council web app - weekly report #3 + + + + + + + Council application – weekly report #5 + + + + + + + Gentoo/Java IDE integration Weekly report #5 + + + + + + + Rework Porthole to use the new public portage API -- Weekly report #4 + + +
References:
Navigation:
Previous by thread:
Next by thread:
Previous by date:
Next by date:
+ + + + + + +
+
+
diff --git a/site/spec/files/msg_b5b2b992bbbfb4f5e7532db90af8f28a.xml?passthru=1 b/site/spec/files/msg_b5b2b992bbbfb4f5e7532db90af8f28a.xml?passthru=1 new file mode 100644 index 0000000..2c4e6a4 --- /dev/null +++ b/site/spec/files/msg_b5b2b992bbbfb4f5e7532db90af8f28a.xml?passthru=1 @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + +List Archive: gentoo-soc + + + Gentoo Mailing List Administrators + + + +Archive of the gentoo-soc mailing list. + + +1.0 +Jul 05, 2011 + + +
+ + +List Archive: gentoo-soc + + + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + + + + + + + +
Navigation:
Headers:
+ + +To: + + +gentoo-soc@g.o + + + + + +From: + + +Joachim Filip Bartosik <jbartosik@...> + + + + + +Subject: + + + Council application – weekly report #5 + + + + + +Date: + + +Tue, 28 Jun 2011 12:40:05 +0200 + + + +
+ + + + + + + + +
+(Note: this is c&p from my blog [0])
+
+Last week I worked to improve MeetBot:
+
+    I added support for #changeitemcommand – it allows you to move
+through agenda items faster then #netxitem/ #previtem.
+    Bot will close voting after last vote
+    Bot can  send reminders. You can add reminder with
+
+    #timelimit add :
+
+    remove it with
+
+    #timelimt remove message
+
+    list set reminders with
+
+    #timelimit list
+
+    or set them in web application before meeting. Changing item removes
+all reminders.
+
+For short description of project and sources, read this[1].
+
+[0]
+http://ahenobarbi.wordpress.com/2011/06/28/council-application-%E2%80%93-weekly-report-5/
+[1]
+http://ahenobarbi.wordpress.com/2011/05/30/council-application-short-introduction/
+
+
+ + + + + + signature.asc (OpenPGP digital signature) + + +
Attachment:
+ + + + + + + + + + + + + + Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + Re: Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + Council web app - weekly report #4 + + + + + + + Rework Porthole to use the new public portage API -- Weekly report #1 + + + + + + + Re: Distfile patching support - Weekly report #5 + + + + + + + Gentoo Maven Integration - Weekly Report #5 + + +
References:
Navigation:
Previous by thread:
Next by thread:
Previous by date:
Next by date:
+ + + + + + +
+
+
diff --git a/site/spec/files/msg_c0c8b0aa686f83a7268cd13f067d6da2.xml?passthru=1 b/site/spec/files/msg_c0c8b0aa686f83a7268cd13f067d6da2.xml?passthru=1 new file mode 100644 index 0000000..db13d41 --- /dev/null +++ b/site/spec/files/msg_c0c8b0aa686f83a7268cd13f067d6da2.xml?passthru=1 @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + +List Archive: gentoo-soc + + + Gentoo Mailing List Administrators + + + +Archive of the gentoo-soc mailing list. + + +1.0 +Jul 05, 2011 + + +
+ + +List Archive: gentoo-soc + + + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + + + + + + + +
Navigation:
Headers:
+ + +To: + + +gentoo-soc@g.o + + + + + +From: + + +Rich Freeman <rich0@g.o> + + + + + +Subject: + + +Re: Re: Council web app - weekly report #3 + + + + + +Date: + + +Mon, 13 Jun 2011 09:24:09 -0400 + + + +
+ + + + + + + + +
On Mon, Jun 13, 2011 at 4:46 AM, Joachim Filip Bartosik
+<jbartosik@...> wrote:
+>    Application now tracks slaking properly - it marks participation
+> after meeting (council members who voted at least once are present).
+> Then it calculates "slacking status" for current council members based
+> on council term start date and participations.
+
+Honestly, I've seen this kind of thing tried so many times and fail in
+so many situations that I have to say that I think this isn't the
+right way to go about this.
+
+Why not let somebody in the Council just mark off attendance?
+Sometimes automation isn't the best solution.  What if somebody was
+present but there was only one vote and they didn't vote, or whatever?
+ I could see some value in the thing helping to facilitate taking
+attendance (looking at who talked during the meeting and suggesting
+that to the attendance-taker for confirmation).  In the end, however,
+deciding whether somebody slacked shouldn't be based on an algorithm -
+if it fails for whatever reason then suddenly we're back to just doing
+it manually 100%.
+
+I'm a big fan of KISS for these sorts of things.  The 95% solution is
+a lot better than the 99.9999% solution that is worth 10% when it gets
+something wrong trying too hard to get it all right.
+
+Rich
+
+
+
+ + + + + + + + + + + + + Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + Re: Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + Council web app - weekly report #2
+ -- Joachim Filip Bartosik +
+ + + + Re: Council web app - weekly report #3
+ -- Joachim Filip Bartosik +
+ + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + Re: Council web app - weekly report #3 + + + + + + + Council web app - weekly report #4 + + + + + + + Rework Porthole to use the new public portage API -- Weekly report #3 + + + + + + + Gentoo/Java integration Project Weekly report #4 + + +
References:
Navigation:
Previous by thread:
Next by thread:
Previous by date:
Next by date:
+ + + + + + +
+
+
diff --git a/site/spec/files/msg_e490369a0c7e6c279af9baef63897629.xml?passthru=1 b/site/spec/files/msg_e490369a0c7e6c279af9baef63897629.xml?passthru=1 new file mode 100644 index 0000000..a89a8ad --- /dev/null +++ b/site/spec/files/msg_e490369a0c7e6c279af9baef63897629.xml?passthru=1 @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + +List Archive: gentoo-soc + + + Gentoo Mailing List Administrators + + + +Archive of the gentoo-soc mailing list. + + +1.0 +Jul 05, 2011 + + +
+ + +List Archive: gentoo-soc + + + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + + + + + + + +
Navigation:
Headers:
+ + +To: + + +gentoo-soc@g.o + + + + + +From: + + +Joachim Filip Bartosik <jbartosik@...> + + + + + +Subject: + + + Re: Council web app - introduction + + + + + +Date: + + +Mon, 30 May 2011 19:23:44 +0200 + + + +
+ + + + + + + + +
(Note: this is c&p from my blog [0])
+
+I’m going to finish work early (first week of August) so I started
+working three weeks ago.
+
+Some functionality is ready:
+
+    Anyone can view agendas
+        Agenda has state:
+            Open – council members and administrators can edit it.
+            Closed for submissions – when meeting is close and no one
+should change agenda.
+            Meeting ongoing – currently unused.
+            Old – old agendas, no one can change them.
+        There is always exactly one agenda in state different then “old”
+(that is in open, closed for submissions or meeting ongoing state).  cal
+this agenda “current agenda”.
+        There is list of agenda items
+            Every item has fields for title, description, and discussion(s).
+            Any registered user can create a new item. Initially item is
+not assigned to agenda. There is listing of all unassigned (suggested)
+agenda items.
+            Council members can add it to current agenda. Items added to
+agenda don’t appear any more on the suggested agenda items list. They
+appear as agenda items for a specific agenda.
+            Council members can reject it. Rejected items don’t appear
+on suggested agenda items list.
+        For every agenda item there is voting options list.
+    Anyone can register
+    Registered user can be marked as administrator
+    Registered user can be marked as council member
+    I started work on the IRC bot
+        When someone says #startmeeting (in addition to everything
+MeetBot usually does) it obtains two JSON files containing:
+            Array of nicks allowed to vote on the meeting
+            Array of agenda items. Each agenda item is array. First item
+of that array is title of agenda item. Second item is array with voting
+options for agenda item.
+            This looks a more complicated then it really is, so here is
+an example: suppose current  has two two items: ‘What I will eat for
+diner’ and ‘Should I walk the dog before or after dinner’. Voting
+options for the first one are ‘Pizza’, ‘Sandwiches’ and ‘Nothing’.
+Choices for the second one are ‘Yes’ and ‘No’. This results in an array:
+
+            [["What I will eat for diner", ["Pizza", "Sandwiches",
+"Nothing"]], ["Should I walk the dog before or after dinner", ["Yes",
+"No"]]]
+        Other commands I added are: #nextitem, #previtem (to change
+currently discussed item), #startvote, #endvote, #vote(to vote).
+        When someone issues #endmeeting command bot posts voting results
+(JSON with hash mapping agenda item title to hash mapping nick to voting
+choice).
+
+For short description of project and sources, read this[1].
+
+[0]
+http://ahenobarbi.wordpress.com/2011/05/30/council-application-weekly-report-1/
+[1]
+http://ahenobarbi.wordpress.com/2011/05/30/council-application-short-introduction/
+
+
+ + + + + + signature.asc (OpenPGP digital signature) + + +
Attachment:
+ + + + + + + + + + + + Council application – weekly report #5
+ -- Joachim Filip Bartosik +
+ + + + Council web app - weekly report #4
+ -- Joachim Filip Bartosik +
+ + + + Council web app - weekly report #2
+ -- Joachim Filip Bartosik +
+ + + + + + + + + + Council web app - introduction
+ -- Joachim Filip Bartosik +
+ + + + + + + + + + Lists: + gentoo-soc: + < Prev + By Thread + Next > + < Prev + By Date + Next > + + + + + + + Council web app - introduction + + + + + + + Council web app - weekly report #2 + + + + + + + Council web app - introduction + + + + + + + Rework Porthole to use the new public portage API -- Weekly report #1 + + +
Replies:
References:
Navigation:
Previous by thread:
Next by thread:
Previous by date:
Next by date:
+ + + + + + +
+
+
diff --git a/site/spec/models/agenda_item_spec.rb b/site/spec/models/agenda_item_spec.rb index 72ee0bb..961b663 100644 --- a/site/spec/models/agenda_item_spec.rb +++ b/site/spec/models/agenda_item_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' +require 'support/http_stub.rb' describe AgendaItem do it 'should allow all registered users to create' do @@ -119,4 +120,30 @@ describe AgendaItem do item.errors[:timelimits].should_not be_nil end end + + describe '.update_discussion_time' do + it 'should do nothing if discussion is not url to discussion on gentoo archives' do + items = [Factory(:agenda_item), + Factory(:agenda_item, :discussion_time => 'something'), + Factory(:agenda_item, :discussion => 'http://archives.gentoo.org/gentoo-bsd/'), + Factory(:agenda_item, :discussion_time => 'something', + :discussion => 'http://archives.gentoo.org/gentoo-bsd/')] + items.each do |item| + lambda { + item.send(:update_discussion_time) + }.should_not change(item, :discussion_time) + end + end + + + + it 'should set discussion_time properly if discussion is url to discussion on gentoo archives' do + item = Factory(:agenda_item, + :discussion => + 'http://archives.gentoo.org/gentoo-soc/msg_e490369a0c7e6c279af9baef63897629.xml') + lambda { + item.send(:update_discussion_time) + }.should change(item, :discussion_time).from('').to('From 2011.05.30 to 2011.06.28, 28 full days') + end + end end diff --git a/site/spec/support/http_stub.rb b/site/spec/support/http_stub.rb new file mode 100644 index 0000000..ba6565e --- /dev/null +++ b/site/spec/support/http_stub.rb @@ -0,0 +1,22 @@ +class ResponseStub + def initialize(filename) + @filename = filename + end + def body + path = File.expand_path(File.join(File.dirname(__FILE__), "../files", @filename)) + File.open(path).read + end +end + +class RespStub + def get(path) + filename = path.split('/').last + ResponseStub.new(filename) + end +end + +class Net::HTTP + def self.start(serv) + yield(RespStub.new) + end +end -- cgit v1.2.3-65-gdbad