Permalink
Browse files

Update gems and implement coverage progress bar

  • Loading branch information...
zedtux committed May 1, 2014
1 parent c94fc62 commit 2358862dbd5ff10fe7215226e462410596485160
View
@@ -1,4 +1,6 @@
AllCops:
Excludes:
Exclude:
- !ruby/regexp /\/db\/.*$/
- !ruby/regexp /\/features\/.*$/
- !ruby/regexp /\/cache\/.*$/
- !ruby/regexp /\/script\/.*$/
View
10 Gemfile
@@ -1,13 +1,12 @@
source 'https://rubygems.org'
gem 'rails', '~> 4.0.2'
gem 'rails'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'less-rails'
gem 'therubyracer', :platforms => :ruby
gem 'bootstrap-on-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'pg'
gem 'puma'
gem 'slim-rails'
@@ -22,7 +21,9 @@ gem 'open_uri_redirections' # open-uri library patched to follow http to https r
gem 'array_is_uniq', :require => 'array' # Implemented the missing unqi? method on Ruby Arrays
gem 'pluralize_no_count_if_one'
gem 'capistrano3-puma'
group :assets do
gem 'coffee-rails'
end
group :development do
gem 'better_errors'
@@ -36,9 +37,10 @@ group :development do
gem 'capistrano-bundler'
gem 'rails_best_practices'
gem 'rubocop'
gem 'capistrano3-puma'
end
group :test do
group :test, :cucumber do
gem 'capybara'
gem 'cucumber-rails', :require => false
gem 'database_cleaner'
View
@@ -1,42 +1,44 @@
GIT
remote: https://github.com/thoughtbot/shoulda-matchers.git
revision: cd9594603eb9485deb63f3ce107e4ebf490efbf5
revision: 1511ed916156c6072cfba05b37f9f2c1bec2f0b6
specs:
shoulda-matchers (2.5.0)
shoulda-matchers (2.6.1)
activesupport (>= 3.0.0)
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.4)
actionpack (= 4.0.4)
actionmailer (4.1.0)
actionpack (= 4.1.0)
actionview (= 4.1.0)
mail (~> 2.5.4)
actionpack (4.0.4)
activesupport (= 4.0.4)
builder (~> 3.1.0)
erubis (~> 2.7.0)
actionpack (4.1.0)
actionview (= 4.1.0)
activesupport (= 4.1.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.4)
activesupport (= 4.0.4)
builder (~> 3.1.0)
activerecord (4.0.4)
activemodel (= 4.0.4)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.4)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.4)
actionview (4.1.0)
activesupport (= 4.1.0)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.0)
activesupport (= 4.1.0)
builder (~> 3.1)
activerecord (4.1.0)
activemodel (= 4.1.0)
activesupport (= 4.1.0)
arel (~> 5.0.0)
activesupport (4.1.0)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
tzinfo (~> 1.1)
addressable (2.3.6)
appconfig (0.1.1)
arel (4.0.2)
arel (5.0.1.20140414130214)
array_is_uniq (0.0.1)
ast (1.1.0)
ast (2.0.0)
awesome_print (1.2.0)
better_errors (1.1.0)
coderay (>= 1.0.0)
@@ -45,8 +47,8 @@ GEM
debug_inspector (>= 0.0.1)
bootstrap-on-rails (0.0.2)
less-rails
builder (3.1.4)
capistrano (3.1.0)
builder (3.2.2)
capistrano (3.2.1)
i18n
rake (>= 10.0.0)
sshkit (~> 1.3)
@@ -107,7 +109,7 @@ GEM
debug_inspector (0.0.2)
diff-lcs (1.2.5)
docile (1.1.3)
email_spec (1.5.0)
email_spec (1.4.0)
launchy (~> 2.1)
mail (~> 2.2)
erubis (2.7.0)
@@ -119,9 +121,6 @@ GEM
hub (1.12.0)
i18n (0.6.9)
ice_cube (0.11.3)
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
@@ -139,25 +138,25 @@ GEM
treetop (~> 1.4.8)
mime-types (1.25.1)
mini_portile (0.5.3)
minitest (4.7.5)
multi_json (1.9.2)
minitest (5.3.3)
multi_json (1.9.3)
multi_test (0.1.1)
net-scp (1.1.2)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.8.0)
newrelic_rpm (3.7.3.204)
net-ssh (2.9.0)
newrelic_rpm (3.8.0.218)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
open_uri_redirections (0.1.4)
parser (2.1.7)
ast (~> 1.1)
parser (2.1.9)
ast (>= 1.1, < 3.0)
slop (~> 3.4, >= 3.4.5)
pg (0.17.1)
pluralize_no_count_if_one (0.0.1)
railties
polyglot (0.3.4)
powerpack (0.0.9)
puma (2.8.1)
puma (2.8.2)
rack (>= 1.1, < 2.0)
quiet_assets (1.0.2)
railties (>= 3.1, < 5.0)
@@ -166,15 +165,17 @@ GEM
rack
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.4)
actionmailer (= 4.0.4)
actionpack (= 4.0.4)
activerecord (= 4.0.4)
activesupport (= 4.0.4)
rails (4.1.0)
actionmailer (= 4.1.0)
actionpack (= 4.1.0)
actionview (= 4.1.0)
activemodel (= 4.1.0)
activerecord (= 4.1.0)
activesupport (= 4.1.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.4)
sprockets-rails (~> 2.0.0)
rails_best_practices (1.15.2)
railties (= 4.1.0)
sprockets-rails (~> 2.0)
rails_best_practices (1.15.3)
activesupport
awesome_print
code_analyzer (>= 0.4.3)
@@ -183,14 +184,14 @@ GEM
i18n
require_all
ruby-progressbar
rails_layout (1.0.13)
railties (4.0.4)
actionpack (= 4.0.4)
activesupport (= 4.0.4)
rails_layout (1.0.14)
railties (4.1.0)
actionpack (= 4.1.0)
activesupport (= 4.1.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
rake (10.2.2)
rake (10.3.1)
redis (3.0.7)
redis-namespace (1.4.1)
redis (~> 3.0.4)
@@ -210,14 +211,14 @@ GEM
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rubocop (0.20.1)
rubocop (0.21.0)
json (>= 1.7.7, < 2)
parser (~> 2.1.7)
parser (~> 2.1.9)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (1.4.2)
safe_yaml (1.0.2)
safe_yaml (1.0.3)
sexp_processor (4.4.3)
sidekiq (2.17.7)
celluloid (>= 0.15.2)
@@ -247,18 +248,18 @@ GEM
railties (>= 3.0, < 4.2)
slim (~> 2.0)
slop (3.5.0)
sprockets (2.12.0)
sprockets (2.12.1)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
sprockets-rails (2.1.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sshkit (1.3.0)
sshkit (1.4.0)
net-scp (>= 1.1.2)
net-ssh
net-ssh (>= 2.8.0)
term-ansicolor
temple (0.6.7)
term-ansicolor (1.3.0)
@@ -277,7 +278,8 @@ GEM
polyglot (>= 0.3.1)
turbolinks (2.2.2)
coffee-rails
tzinfo (0.3.39)
tzinfo (1.1.0)
thread_safe (~> 0.1)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
@@ -302,14 +304,14 @@ DEPENDENCIES
capistrano-rails
capistrano3-puma
capybara
coffee-rails
coveralls
cucumber-rails
cucumber-timecop
database_cleaner
email_spec
git
hub
jbuilder (~> 1.2)
jquery-rails
launchy
less-rails
@@ -320,7 +322,7 @@ DEPENDENCIES
pluralize_no_count_if_one
puma
quiet_assets
rails (~> 4.0.2)
rails
rails_best_practices
rails_layout
rake
View
@@ -1,5 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
# for example lib/tasks/capistrano.rake,
# and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
@@ -4,10 +4,11 @@
# @author [guillaumeh]
#
class FormulasController < ApplicationController
before_filter :current_objects, only: :index
before_filter :calculate_percentage, only: :index
before_filter :current_object, only: [:show, :refresh_description]
def index
@formulas = Homebrew::Formula.internals.active.order(:name)
@new_since_a_week = Homebrew::Formula.internals.new_this_week.order(:name)
@inactive_formulas = Homebrew::Formula.internals.inactive.order(:name)
if @inactive_formulas.present?
@@ -39,4 +40,17 @@ def current_object
flash[:error] = "This formula doesn't exists"
redirect_to root_url
end
def current_objects
@formulas = Homebrew::Formula.internals.active.order(:name)
end
def calculate_percentage
with_a_description_count = Homebrew::Formula.internals
.with_a_description.count
@coverage = 0
unless with_a_description_count.zero?
@coverage = (with_a_description_count * 100) / @formulas.size
end
end
end
@@ -53,11 +53,12 @@ class Formula < ActiveRecord::Base
}
scope :new_this_week, lambda {
where("created_at BETWEEN LOCALTIMESTAMP - INTERVAL '7 days' " \
"AND LOCALTIMESTAMP")
'AND LOCALTIMESTAMP')
}
scope :inactive, lambda {
where('touched_on < ?', Import.last_succes_date_or_today)
}
scope :with_a_description, -> { where('description is not NULL') }
# @nodoc ~~~ custom class methods ~~~
@@ -13,11 +13,13 @@ module GitRepository
# otherwise just call `git pull`.
#
def self.fetch_up_to_date_git_repository
git = if File.exists?(AppConfig.homebrew.git_repository.location)
git = if File.exist?(AppConfig.homebrew.git_repository.location)
open_git_repository
else
path = File.join(AppConfig.homebrew.git_repository.location,
AppConfig.homebrew.git_repository.name)
# Create the location path
FileUtils.mkdir_p(AppConfig.homebrew.git_repository.location)
FileUtils.mkdir_p(path)
# Clone the Git repo to the location path
clone_git_repository
end
@@ -4,6 +4,10 @@
p.text-center
iframe src="http://ghbtns.com/github-btn.html?user=zedtux&repo=brewformulas.org&type=watch&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"
a href="https://twitter.com/share" class="twitter-share-button" data-via="brewformulas" data-size="large" data-related="machomebrew" Tweet
p Coverage of formulas with description:
div class="progress" id="formulas_coverage"
div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="#{@coverage}" aria-valuemin="0" aria-valuemax="100" style="width: #{@coverage}%"
span class="sr-only" #{@coverage}% Complete (success)
ul class="nav nav-tabs"
li class="active"
View
@@ -1,4 +1,4 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
Oops, something went wrong.

0 comments on commit 2358862

Please sign in to comment.