Permalink
Browse files

Merge branch 'master' of https://github.com/zuhao/isitfedoraruby

  • Loading branch information...
Nicolás Satragno
Nicolás Satragno committed Jan 11, 2013
2 parents 4c08a05 + 7fabeee commit b21dd07a009ffc9b38d0310fba3fd23f83fa4099
View
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
-gem 'rails', '3.2.3'
+gem 'rails', '~> 3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -12,7 +12,7 @@ gem 'bootstrap-sass', '~> 2.0.0'
#i18n support
gem 'fast_gettext'
-gem 'gettext_i18n_rails', '>= 0.4.3'
+gem 'gettext_i18n_rails', '>= 0.4.0'
gem 'rails-i18n'
group :assets do
@@ -34,6 +34,7 @@ gem 'versionomy'
gem 'gems'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'pkgwat'
+gem 'ruby-bugzilla'
group :test, :development do
gem 'rspec-rails'
View
@@ -1,46 +1,7 @@
* List of tasks for isitfedoraruby
-** TODO Add i18n support [90%]
-Nicolás Satragno is currently working on this
-- [X] Make i18n branch
- - [X] Branch
- - [X] Merge changes
- - [X] Push branch
-- [X] Add gettext support
-- [X] Research about getting the app translated
- - Discovered: *MUST* use po files
-- [X] Add calls to _('') around the app
- - [X] Home
- - [X] Footer
- - [X] Header
- - [X] Stats
- - [X] Visualizations
- - [X] FedoraRpms
- - [X] RubyGems
- - [X] About
- - [X] Success stories
- - [X] Show FedoraRpm
- - [X] Show RubyGem
- - [X] Contribute
-- [-] Add localized languages to fast_gettext init
- - [X] en
- - [X] es
- - [ ] Others
-- [ ] Upload project to transifex platform
-- [ ] Give transifex ssh access to .po folder
- -> Maybe we can also fork the repo to avoid a security risk
- -> Done!
-- [-] Add i18n support on error pages
- - [X] Configure 404 and 500 views as error pages
- - [ ] Add _('') calls on error pages
- -> waiting for error pages to be ready
-
-
-
** DONE Improve search
-Mark Klein did this
-- [ ] Should make it more "lazy" ie match without having to *exactly* type a name
-- [ ] Probably also search for maintainers
+- [ ] Include maintainers in the content to search for
** TODO optimize update rpms and gems process
@@ -49,21 +10,15 @@ Mark Klein did this
- [ ] Allow one to set update options interactively
- [ ] Allow one to pause/continue update
-** TODO Fill static pages
-- [ ] Fill success stories page (maybe ask ruby SIG?)
-- [ ] Fill how to contribute page (fork repo, make pull request, join #fedora-ruby on freenode, etc)
-
** TODO Add decent robots.txt
** TODO Fix "most wanted gems" (or erase)
** TODO Make a nice error message appear when a user types a wrong URL
-> Example: http://www.isitfedoraruby.com/fedorarpms/non-existent-rpm
-- [ ] Make a "non-existent-rpm" RPM does not exist sign
- [ ] It would be totally awesome to have a "did you mean...?" sign
-** TODO improve import mechanism
-Kendhia is working on this
+** TODO furthur improve import mechanism
- Instead of scraping websites, we should use the APIs for git, bugzilla,
koji, fedora, and more
@@ -80,5 +35,3 @@ Nicolás Satragno is working on this
- We can hook into the rubygems API to automatically run commands
such as gem2rpm on gem updates
- May require improvements to gem2rpm
-
-** TODO writeup content for the success stories and contribute sections
@@ -1,14 +1,24 @@
$(function() {
-$("#search_field").tokenInput("/searches/suggest_gems.json", {
- onAdd: function (item) {
- $('input[id$=search_field]').val(item.name);
+ var search_text = null;
+
+ $("#search_field").tokenInput("/searches/suggest_gems.json", {
+ onAdd: function (item) {
+ $('input[id$=search_field]').val(item.name);
},
- crossDomain: false,
- tokenLimit: 1,
- tokenValue: name
- });
-$('input[id$=token-input-search_field]').keyup(function() {
- var copyVal = $(this).val();
- $('input[id$=search_field]').val(copyVal);
- });
+ crossDomain: false,
+ tokenLimit: 1,
+ tokenValue: name
+ });
+
+ $('input[id$=token-input-search_field]').keyup(function() {
+ search_text = $(this).val();
+ $('input[id$=search_field]').val(search_text);
+ });
+
+ // XXX hack to preserve search text search box
+ // looses focus
+ $("#token-input-search_field").blur(function(event){
+ $(event.target).val(search_text);
+ });
+
});
View
@@ -1,5 +1,6 @@
require 'versionomy'
require 'xmlrpc/client'
+require 'bugzilla'
class FedoraRpm < ActiveRecord::Base
FEDORA_VERSIONS = {'rawhide' => 'master',
@@ -175,17 +176,14 @@ def retrieve_bugs
puts "Importing rpm #{name} bugs"
self.bugs.clear
- bugzilla_search = URI.parse(bugzilla_url).read
- doc = Nokogiri::HTML(bugzilla_search)
-
# get bugs and their titles and last_updated
- bugs = doc.xpath("//td[@class='bz_short_desc_column']/a").collect { |bz| [bz.attr('href').gsub('show_bug.cgi?id=', ''), bz.text.strip] }
+ xmlrpc = Bugzilla::XMLRPC.new("bugzilla.redhat.com")
+ bugs = Bugzilla::Bug.new(xmlrpc).search("summary" => name, "product" => "fedora")["bugs"]
bugs.each { |bug|
- update = doc.xpath("//tr[@id='b#{bug.first}']//td[@class='bz_changeddate_column']").text
arb = Bug.new
- arb.name = bug.last
- arb.bz_id = bug.first
- arb.last_updated = update
+ arb.name = bug["summary"]
+ arb.bz_id = bug["id"]
+ arb.last_updated = bug["last_change_time"].to_time
arb.is_review = true if arb.name =~ /^Review Request.*#{name}\s.*$/
self.bugs << arb
}
@@ -7,8 +7,8 @@
%li= link_to _('Home'), root_path
%li= link_to _('Ruby Gems'), rubygems_path
%li= link_to _('Fedora Rpms'), fedorarpms_path
- %li= link_to _('About'), about_path
%li= link_to _('Contribute'), contribute_path
+ %li= link_to _('About'), about_path
%li
= form_tag( { :controller => 'searches', :action => 'redirect' }, :class => 'form-search', :method => 'post') do
= text_field_tag :search, params[:search] ||= '', :id => 'search_field', :class => 'input-medium search-query'
@@ -1,5 +1,5 @@
%h1= _('About')
-= image_tag('http://openclipart.org/people/gblas.ivan/rubi.svg', :size => '100x120')
+= image_tag('http://openclipart.org/people/gblas.ivan/rubi.svg', :size => '100x120', :style => 'float: right')
%p= _('IsItFedoraRuby is a web-application (a Rails application) for keeping track of the Fedora/Ruby integration, especially gem->rpm conversion, documentation, and success stories.')
%p= _('The project was started on 2012 as a <a href=https://fedoraproject.org/wiki/GSOC_2012/Student_Application_Zuhao/IsItFedoraRuby>Google Summer Of Code project</a> by Zuhao, and it is growing to include Ruby Special Interest Group.').html_safe

0 comments on commit b21dd07

Please sign in to comment.