Skip to content

Commit

Permalink
Return sanity to the test suite and ignore the normal statistics cache.
Browse files Browse the repository at this point in the history
Because the statistics cache clashes with what's the current version on
the server on each deploy.
  • Loading branch information
alloy committed Dec 7, 2013
1 parent 3b9da36 commit 4287f61
Show file tree
Hide file tree
Showing 13 changed files with 6,568 additions and 489 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -4,4 +4,4 @@
public/*.rss
tmp/*
log/*
statistics.yml
caches/statistics.yml
6 changes: 3 additions & 3 deletions Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/CocoaPods/Core.git
revision: 3f71c7e99a4e7919053ff00787974638fd1fdc16
revision: 88f665e11b1e9632e328aeee1b244a68adff89a3
branch: master
specs:
cocoapods-core (0.28.0)
Expand Down Expand Up @@ -62,9 +62,9 @@ GEM
multi_xml (0.5.5)
multipart-post (1.2.0)
nap (0.6.0)
octokit (2.6.2)
octokit (2.6.3)
sawyer (~> 0.5.1)
posix-spawn (0.3.6)
posix-spawn (0.3.8)
pygments.rb (0.5.4)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
Expand Down
4 changes: 3 additions & 1 deletion Rakefile
@@ -1,5 +1,5 @@

task :default => 'spec:all'
task :default => :spec

#--------------------------------------#

Expand All @@ -15,6 +15,8 @@ namespace :spec do
end
end

task :spec => 'spec:all'

def specs(dir)
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
end
Expand Down
24 changes: 14 additions & 10 deletions app.rb
Expand Up @@ -31,28 +31,33 @@ class CocoaPodsNotifierApp < Sinatra::Application
register Sinatra::Cache
set :cache_output_dir, File.join(APP_ROOT, 'public')
set :cache_enabled, true

if ENV['RACK_ENV'] == 'production'
ExceptIO::Client.configure "cocoapods-feeds-cocoapods-org", ENV['EXCEPTIO_KEY']
end
end

# Development configurations.
#
configure :development do
require 'awesome_print'
require 'sinatra/reloader'
register Sinatra::Reloader
end

Pod::Specification::Set::Statistics.instance.cache_expiration = 60 * 60 * 24
Pod::Specification::Set::Statistics.instance.cache_file = APP_ROOT + 'caches/statistics.yml'
configure :production do
ExceptIO::Client.configure "cocoapods-feeds-cocoapods-org", ENV['EXCEPTIO_KEY']
end

configure :development, :production do
$silent = false
Pod::Specification::Set::Statistics.instance.cache_expiration = 60 * 60 * 24
Pod::Specification::Set::Statistics.instance.cache_file = APP_ROOT + 'caches/statistics.yml'
end

# Repo Actions
#-------------------------------------------------------------------------#

def self.master_repo
@master_repo ||= Repo.new(APP_ROOT + 'tmp/.cocoapods/master')
@master_repo ||= begin
repo = Repo.new(APP_ROOT + 'tmp/.cocoapods/master')
repo.silent = $silent
repo
end
end

# Clones the master repo from the remote and generates the feeds and
Expand Down Expand Up @@ -100,7 +105,6 @@ def self.update

slim :index


rescue Exception => e
puts "[!] get / failed: #{e}".red
puts e.backtrace.join("\n")
Expand Down

0 comments on commit 4287f61

Please sign in to comment.