Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Migration to Rails 4.0 (based on ruby 2.1)

  • Loading branch information...
commit 32605632b0fd9b1ce9b7d21dfedea65132dd017d 1 parent 73f28b5
@ancorgs ancorgs authored
View
51 Gemfile
@@ -1,8 +1,20 @@
source 'https://rubygems.org'
-gem 'rails', '~> 3.2.1'
+gem 'rails', '~> 4.0.3'
gem 'nokogiri'
+# Use SCSS for stylesheets
+gem 'sass-rails', '~> 4.0.0'
+# With compass
+gem 'compass-rails'
+# Use Uglifier as compressor for JavaScript assets
+gem 'uglifier', '>= 1.3.0'
+# Use CoffeeScript for .js.coffee assets and views
+# gem 'coffee-rails', '~> 4.0.0'
+# Use jquery as the JavaScript library
+gem 'jquery-rails'
+gem 'jquery-ui-rails'
+
gem 'gettext_i18n_rails', '>= 0.4.3'
gem 'fast_gettext', '>= 0.7.0'
@@ -18,32 +30,43 @@ group :development do
gem 'gettext', '>= 1.9.3', :require => false
end
-gem 'mysql2'
+# MySQL is not used, as far as I know
+# gem 'mysql2'
gem 'delayed_job', '>3.0'
gem 'delayed_job_active_record'
gem 'xmlhash', '>= 1.2.2'
-gem 'jquery-rails'
-gem 'jquery-ui-rails'
-
-gem 'memcache-client'
+#gem 'memcache-client'
+gem 'dalli'
gem 'sqlite3'
gem 'minitest', '< 5.0'
gem 'hoptoad_notifier', "~> 2.3"
-group :assets do
- gem 'sass-rails' # if running rails 3.1 or greater
- gem 'compass-rails'
- gem 'uglifier'
- # install nodejs instead!
- #gem 'therubyracer'
+#gem 'actionpack-page_caching'
+#gem 'actionpack-action_caching'
+
+group :doc do
+ # bundle exec rake doc:rails generates the API under doc/api.
+ gem 'sdoc', require: false
end
group :test do
- gem 'capybara', '~>2.0.1'
- gem 'capybara-webkit', '< 1.0'
+# This doesn't work because capybara-webkit (~> 1.1.1) depends on
+# capybara (< 2.2.0, >= 2.0.2) ruby
+# gem 'capybara', '~>2.2.1'
+# gem 'capybara-webkit', '~>1.1.1'
+# This 'bundles' but does not work (incompatibility)
+# gem 'capybara', '~>2.2.1'
+# gem 'capybara-webkit', '< 1.0'
+# And this (the only working solution) cannot by installed because capybara-webkit (~> 1.1.1)
+# requires 'websocket (~> 1.0.4)' but rubygem-websocket-1_0_7 requires ruby(abi) = 2.0.0
+# gem 'capybara', '~>2.0.3'
+# gem 'capybara-webkit', '~>1.1.1'
+ gem 'capybara'
+ gem 'poltergeist'
+
gem 'webmock'
end
View
202 Gemfile.lock
@@ -1,63 +1,57 @@
GEM
remote: https://rubygems.org/
specs:
- actionmailer (3.2.13)
- actionpack (= 3.2.13)
- mail (~> 2.5.3)
- actionpack (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- builder (~> 3.0.0)
+ actionmailer (4.0.3)
+ actionpack (= 4.0.3)
+ mail (~> 2.5.4)
+ actionpack (4.0.3)
+ activesupport (= 4.0.3)
+ builder (~> 3.1.0)
erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.5)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.2.1)
- activemodel (3.2.13)
- activesupport (= 3.2.13)
- builder (~> 3.0.0)
- activerecord (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activeresource (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- activesupport (3.2.13)
- i18n (>= 0.6.1)
- multi_json (~> 1.0)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ activemodel (4.0.3)
+ activesupport (= 4.0.3)
+ builder (~> 3.1.0)
+ activerecord (4.0.3)
+ activemodel (= 4.0.3)
+ activerecord-deprecated_finders (~> 1.0.2)
+ activesupport (= 4.0.3)
+ arel (~> 4.0.0)
+ activerecord-deprecated_finders (1.0.3)
+ activesupport (4.0.3)
+ i18n (~> 0.6, >= 0.6.4)
+ minitest (~> 4.2)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.37)
addressable (2.3.5)
- arel (3.0.2)
- builder (3.0.4)
- capistrano (2.15.5)
+ arel (4.0.1)
+ atomic (1.1.14)
+ builder (3.1.4)
+ capistrano (2.14.2)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
- capybara (2.0.3)
+ capybara (2.2.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
- selenium-webdriver (~> 2.0)
- xpath (~> 1.0.0)
- capybara-webkit (0.14.2)
- capybara (~> 2.0, >= 2.0.2)
- json
- childprocess (0.3.9)
- ffi (~> 1.0, >= 1.0.11)
- chunky_png (1.2.9)
+ xpath (~> 2.0)
+ chunky_png (1.3.0)
+ cliver (0.3.2)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
- compass-rails (1.0.3)
- compass (>= 0.12.2, < 0.14)
- crack (0.4.1)
- safe_yaml (~> 0.9.0)
+ compass-rails (1.1.3)
+ compass (>= 0.12.2)
+ crack (0.4.2)
+ safe_yaml (~> 1.0.0)
+ dalli (2.7.0)
delayed_job (4.0.0)
activesupport (>= 3.0, < 4.1)
delayed_job_active_record (4.0.0)
@@ -65,13 +59,12 @@ GEM
delayed_job (>= 3.0, < 4.1)
erubis (2.7.0)
execjs (2.0.2)
- fast_gettext (0.8.0)
- ffi (1.9.3)
+ fast_gettext (0.8.1)
fssm (0.2.10)
- gettext (3.0.2)
+ gettext (3.1.0)
locale (>= 2.0.5)
text
- gettext_i18n_rails (1.0.1)
+ gettext_i18n_rails (1.0.3)
fast_gettext (>= 0.4.8)
highline (1.6.20)
hike (1.2.3)
@@ -79,81 +72,80 @@ GEM
activesupport
builder
i18n (0.6.9)
- journey (1.0.4)
- jquery-rails (3.0.4)
+ jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
- jquery-ui-rails (4.1.0)
- railties (>= 3.1.0)
+ jquery-ui-rails (4.2.0)
+ railties (>= 3.2.16)
json (1.8.1)
- locale (2.0.9)
+ locale (2.1.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- memcache-client (1.8.5)
mime-types (1.25)
mini_portile (0.5.2)
- minitest (4.7.4)
- multi_json (1.8.2)
- mysql2 (0.3.14)
+ minitest (4.7.5)
+ multi_json (1.8.4)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
- net-ssh (2.7.0)
+ net-ssh (2.8.0)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
- nokogiri (1.6.0)
+ nokogiri (1.6.1)
mini_portile (~> 0.5.0)
- pkg-config (1.1.4)
- polyglot (0.3.3)
- rack (1.4.5)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-ssl (1.3.3)
- rack
+ pkg-config (1.1.5)
+ poltergeist (1.5.0)
+ capybara (~> 2.1)
+ cliver (~> 0.3.1)
+ multi_json (~> 1.0)
+ websocket-driver (>= 0.2.0)
+ polyglot (0.3.4)
+ rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
- rails (3.2.13)
- actionmailer (= 3.2.13)
- actionpack (= 3.2.13)
- activerecord (= 3.2.13)
- activeresource (= 3.2.13)
- activesupport (= 3.2.13)
- bundler (~> 1.0)
- railties (= 3.2.13)
- rails-i18n (0.7.4)
- i18n (~> 0.5)
- railties (3.2.13)
- actionpack (= 3.2.13)
- activesupport (= 3.2.13)
- rack-ssl (~> 1.3.2)
+ rails (4.0.3)
+ actionmailer (= 4.0.3)
+ actionpack (= 4.0.3)
+ activerecord (= 4.0.3)
+ activesupport (= 4.0.3)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.0.3)
+ sprockets-rails (~> 2.0.0)
+ rails-i18n (4.0.1)
+ i18n (~> 0.6)
+ rails (~> 4.0)
+ railties (4.0.3)
+ actionpack (= 4.0.3)
+ activesupport (= 4.0.3)
rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (>= 0.14.6, < 2.0)
- rake (10.1.0)
- rdoc (3.12.2)
- json (~> 1.4)
- rubyzip (0.9.9)
- safe_yaml (0.9.7)
- sass (3.2.12)
- sass-rails (3.2.6)
- railties (~> 3.2.0)
+ thor (>= 0.18.1, < 2.0)
+ rake (10.1.1)
+ rdoc (4.1.0)
+ safe_yaml (1.0.1)
+ sass (3.2.14)
+ sass-rails (4.0.1)
+ railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10)
- tilt (~> 1.3)
- selenium-webdriver (2.35.1)
- childprocess (>= 0.2.5)
- multi_json (~> 1.0)
- rubyzip (< 1.0.0)
- websocket (~> 1.0.4)
- sprockets (2.2.2)
+ sprockets-rails (~> 2.0.0)
+ sdoc (0.4.0)
+ json (~> 1.8)
+ rdoc (~> 4.0, < 5.0)
+ sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
+ sprockets-rails (2.0.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
sqlite3 (1.3.8)
text (1.2.3)
thor (0.18.1)
+ thread_safe (0.1.3)
+ atomic
tilt (1.4.1)
treetop (1.4.15)
polyglot
@@ -162,13 +154,13 @@ GEM
uglifier (2.4.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
- webmock (1.16.0)
+ webmock (1.17.3)
addressable (>= 2.2.7)
crack (>= 0.3.2)
- websocket (1.0.7)
+ websocket-driver (0.3.2)
xmlhash (1.3.6)
pkg-config
- xpath (1.0.0)
+ xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS
@@ -176,9 +168,9 @@ PLATFORMS
DEPENDENCIES
capistrano (~> 2.13)
- capybara (~> 2.0.1)
- capybara-webkit (< 1.0)
+ capybara
compass-rails
+ dalli
delayed_job (> 3.0)
delayed_job_active_record
fast_gettext (>= 0.7.0)
@@ -187,14 +179,14 @@ DEPENDENCIES
hoptoad_notifier (~> 2.3)
jquery-rails
jquery-ui-rails
- memcache-client
minitest (< 5.0)
- mysql2
nokogiri
- rails (~> 3.2.1)
+ poltergeist
+ rails (~> 4.0.3)
rails-i18n
- sass-rails
+ sass-rails (~> 4.0.0)
+ sdoc
sqlite3
- uglifier
+ uglifier (>= 1.3.0)
webmock
xmlhash (>= 1.2.2)
View
5 app/controllers/main_controller.rb
@@ -2,8 +2,9 @@
class MainController < ApplicationController
- # these pages are completely static:
- caches_page :release, :download_js unless Rails.env.development?
+ # these pages are completely static, but
+ # page caching have been extracted from Rails 4
+ # caches_page :release, :download_js unless Rails.env.development?
def ymp_with_arch_and_version
path = "/published/#{params[:project]}/#{params[:repository]}/#{params[:arch]}/#{params[:binary]}?view=ymp"
View
4 app/controllers/order_controller.rb
@@ -25,7 +25,9 @@ def new
end
def create
- @order = Order.new params[:order]
+ @order = Order.new params.require(:order).permit(:title, :name, :street1,
+ :zip, :city, :country, :phone, :email, :amount, :reason, :deadline,
+ :company, :street2, :county, :material)
if @order.save
Promomailer.promo_order(@order).deliver
redirect_to "/order/thanks" and return
View
22 app/controllers/package_controller.rb
@@ -108,19 +108,23 @@ def thumbnail
private
def image pkgname, type, default_url
- image_url = "http://screenshots.debian.net/" + type + "/" + pkgname.downcase
- begin
- content = open( image_url, "rb") {|io| io.read }
- rescue OpenURI::HTTPError => e
- logger.debug("No screenshot found for: " + pkgname)
- path = File.join( Rails.root, "public/package/" + type + "/" + pkgname + ".png" )
- content = open( default_url, "rb") {|io| io.read }
- end
response.headers['Cache-Control'] = "public, max-age=#{2.months.to_i}"
response.headers['Content-Type'] = 'image/png'
response.headers['Content-Disposition'] = 'inline'
+ cache_key = "t:#{type}-p:#{pkgname}"
+ content = Rails.cache.read(cache_key)
+ if content.nil?
+ image_url = "http://screenshots.debian.net/" + type + "/" + pkgname.downcase
+ begin
+ content = open( image_url, "rb") {|io| io.read }
+ rescue OpenURI::HTTPError => e
+ logger.debug("No screenshot found for: " + pkgname)
+ path = File.join( Rails.root, "public/package/" + type + "/" + pkgname + ".png" )
+ content = open( default_url, "rb") {|io| io.read }
+ end
+ Rails.cache.write(cache_key, content) unless path
+ end
render :text => content, :content_type => 'image/png'
- cache_page unless path
FileUtils.ln_sf( default_url, path ) if path rescue logger.error "Couldn't create default link for #{path}"
end
View
11 app/helpers/application_helper.rb
@@ -15,17 +15,6 @@ def theme_prefix
@@theme_prefix
end
- def compute_asset_host(source)
- if defined? USE_STATIC
- if source.slice(0, theme_prefix.length) == theme_prefix
- return "http://static.opensuse.org"
- end
- return "http://static.opensuse.org/hosts/#{USE_STATIC}"
- end
- super(source)
- end
-
-
def top_downloads
r = Rails.cache.read('top_downloads') || []
# it's possible we will have to enqueue one on cold caches
View
3  app/models/order.rb
@@ -27,9 +27,6 @@ class Order < ActiveRecord::Base
validates_presence_of :title, :name, :street1, :zip, :city, :country,
:phone, :email, :amount, :reason, :deadline
- attr_accessible :title, :name, :street1, :zip, :city, :country,
- :phone, :email, :amount, :reason, :deadline, :company, :street2, :county, :material
-
validates :email, :format => { :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :on => :create }
validates :deadline, format: { with: %r{^2[0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]}, on: :create }, unless: "deadline == 'NONE'"
validates_numericality_of :amount
View
1  app/models/search_history.rb
@@ -1,3 +1,2 @@
class SearchHistory < ActiveRecord::Base
- attr_accessible :query, :count, :base, :ymp
end
View
11 app/views/layouts/application.html.erb
@@ -74,7 +74,16 @@
<div id="content" class="container_12 content-wrapper">
- <%= render :partial => 'search/find_form' unless @hide_search_box %>
+ <% unless @hide_search_box %>
+ <%# Caching is really crucial in the front page (at release date, at least) %>
+ <% if controller.controller_name == "main" && controller.action_name == "release" %>
+ <% cache do %>
+ <%= render :partial => 'search/find_form' %>
+ <% end %>
+ <% else %>
+ <%= render :partial => 'search/find_form' %>
+ <% end %>
+ <% end %>
<div id="search_result_container">
<%= yield %>
View
2  app/views/main/download.erb
@@ -1,3 +1,4 @@
+<% cache do %>
var mymedium = "<%= @medium %>";
var mylink = '';
@@ -160,3 +161,4 @@ $(function() {
$("#help_arch_content").dialog('open');
});
});
+<% end %>
View
2  app/views/main/release.html.erb
@@ -1,3 +1,4 @@
+<% cache do %>
<%
@right_box = :search
@page_title = _("Download %s") % @releasename
@@ -190,3 +191,4 @@
alert("Please note that the Internet Explorer (all versions) is not capable of handling\nfiles larger than 4 GB.\n\nThis means that you will not be able to download the DVD images using IE.\n\nPlease use a different browser or a downloadmanager.")
</script>
<![endif]-->
+<% end %>
View
18 config/application.rb
@@ -2,12 +2,9 @@
require 'rails/all'
-if defined?(Bundler)
- # If you precompile assets before deploying to production, use this line
- Bundler.require(*Rails.groups(:assets => %w(development test)))
- # If you want your assets lazily compiled in production, use this line
- # Bundler.require(:default, :assets, Rails.env)
-end
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env)
module SoftwareOO
class Application < Rails::Application
@@ -45,18 +42,9 @@ class Application < Rails::Application
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
- # Enforce whitelist mode for mass assignment.
- # This will create an empty whitelist of attributes available for mass-assignment for all models
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
- # parameters by using an attr_accessible or attr_protected declaration.
- config.active_record.whitelist_attributes = true
-
# Enable the asset pipeline
config.assets.enabled = true
- # Version of your assets, change this if you want to expire all your assets
- config.assets.version = '1.0'
-
# Skip frameworks you're not going to use
#config.frameworks -= [ :action_web_service, :active_resource ]
View
2  config/environments/development.rb
@@ -1,5 +1,7 @@
SoftwareOO::Application.configure do
config.cache_store = :memory_store
+ # Do not eager load code on boot.
+ config.eager_load = false
end
if defined? CONFIG
View
9 config/environments/production.rb
@@ -7,11 +7,18 @@
config.serve_static_assets = false
# Compress JavaScripts and CSS
- config.assets.compress = true
+ config.assets.js_compressor = :uglifier
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
+
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both thread web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
end
View
2  config/environments/test.rb
@@ -1,5 +1,7 @@
SoftwareOO::Application.configure do
config.cache_store = :memory_store
+ # Do not eager load code on boot.
+ config.eager_load = false
end
CONFIG['api_username'] = 'test'
View
2  config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-SoftwareOO::Application.config.secret_token = 'c050e083dbf151eb80cd7a86a3eb7c5e3a06a172d774b01664b0082b77736220f9aa9061247a49f7690b0fec328a59c28aea8e84ff0ceee4f2f5f7e93d194395'
+SoftwareOO::Application.config.secret_key_base = 'ab50e083dbf151eb80cd7a86a3eb7c5e3a06a172d774b01664b0082b77736220f9aa9061247a49f7690b0fec328a59c28aea8e84ff0ceee4f2f5f7e93d1943c0'
View
70 config/routes.rb
@@ -1,43 +1,43 @@
SoftwareOO::Application.routes.draw do
controller :main do
- match '/' => :index
- match 'developer' => :developer
- match ':release/download.js' => :download_js
- match 'main/download' => :download
+ get '/' => :index
+ get 'developer' => :developer
+ get ':release/download.js' => :download_js
+ get 'main/download' => :download
- match '123' => :release, :release => "123", :outdated => true
- match '123/:locale' => :release, :release => "123", :outdated => true, :constraints => { :locale => /[\w]+/ }
- match '122' => :release, :release => "122", :outdated => true
- match '122/:locale' => :release, :release => "122", :outdated => true, :constraints => { :locale => /[\w]+/ }
- match '121' => :release, :release => "121", :outdated => true
- match '121/:locale' => :release, :release => "121", :outdated => true, :constraints => { :locale => /[\w]+/ }
- match ':release' => :releasemain, :constraints => { :release => /[123][\d]+/ }, :format => false
- match ':release/:locale' => :release, :constraints => { :release => /[123][\d]+/, :locale => /[\w]+/ }, :format => false
- match 'developer/:locale' => :release, :release => "developer", :format => false, :constraints => { :locale => /[\w]+/ }
+ get '123' => :release, :release => "123", :outdated => true
+ get '123/:locale' => :release, :release => "123", :outdated => true, :constraints => { :locale => /[\w]+/ }
+ get '122' => :release, :release => "122", :outdated => true
+ get '122/:locale' => :release, :release => "122", :outdated => true, :constraints => { :locale => /[\w]+/ }
+ get '121' => :release, :release => "121", :outdated => true
+ get '121/:locale' => :release, :release => "121", :outdated => true, :constraints => { :locale => /[\w]+/ }
+ get ':release' => :releasemain, :constraints => { :release => /[123][\d]+/ }, :format => false
+ get ':release/:locale' => :release, :constraints => { :release => /[123][\d]+/, :locale => /[\w]+/ }, :format => false
+ get 'developer/:locale' => :release, :release => "developer", :format => false, :constraints => { :locale => /[\w]+/ }
- match 'change_install' => :change_install
+ get 'change_install' => :change_install
- match 'ymp/:project/:repository/:package.ymp' => :ymp_without_arch_and_version,
+ get 'ymp/:project/:repository/:package.ymp' => :ymp_without_arch_and_version,
:constraints => { :project => /[\w\-\.:\+]+/, :repository => /[\w\-\.:\+]+/, :package => /[-+\w\.:\@]+/ }
- match 'ymp/:project/:repository/:arch/:binary.ymp' => :ymp_with_arch_and_version,
+ get 'ymp/:project/:repository/:arch/:binary.ymp' => :ymp_with_arch_and_version,
:constrains => { :project => /[\w\-\.:]+/, :repository => /[\w\-\.:]+/, :arch => /[\w\-\.:]+/, :binary => /[\w\-\.:\+]+/ }
end
controller :search do
- match 'search' => :searchresult, :format => false
- match 'find' => :find, :format => false
+ get 'search' => :searchresult, :format => false
+ get 'find' => :find, :format => false
end
controller :package do
- match 'package/:package' => :show, :constraints => { :package => /[-+\w\.:\@]+/ }
- match 'package/thumbnail/:package.png' => :thumbnail, :constraints => { :package => /[-+\w\.:\@]+/ }
- match 'package/screenshot/:package.png' => :screenshot, :constraints => { :package => /[-+\w\.:\@]+/ }
+ get 'package/:package' => :show, :constraints => { :package => /[-+\w\.:\@]+/ }
+ get 'package/thumbnail/:package.png' => :thumbnail, :constraints => { :package => /[-+\w\.:\@]+/ }
+ get 'package/screenshot/:package.png' => :screenshot, :constraints => { :package => /[-+\w\.:\@]+/ }
- match 'packages' => :categories
- match 'appstore' => :categories
- match 'packages/:category' => :category, :constraints => { :category => /[\w\-\.: ]+/ }
- match 'appstore/:category' => :category, :constraints => { :category => /[\w\-\.: ]+/ }
+ get 'packages' => :categories
+ get 'appstore' => :categories
+ get 'packages/:category' => :category, :constraints => { :category => /[\w\-\.: ]+/ }
+ get 'appstore/:category' => :category, :constraints => { :category => /[\w\-\.: ]+/ }
end
resource :orders, :controller => "order" do
@@ -47,22 +47,22 @@
end
controller 'order' do
- match 'order/thanks' => :thanks
+ get 'order/thanks' => :thanks
end
- match 'promodvd' => "order#new"
- match 'promodvds' => "order#new"
+ get 'promodvd' => "order#new"
+ get 'promodvds' => "order#new"
- match 'codecs' => "codecs#index"
+ get 'codecs' => "codecs#index"
- match 'statistic' => "statistic#index"
+ get 'statistic' => "statistic#index"
# compatibility routes for old download implementation
- match 'download' => "download#package"
- match 'download.:format' => "download#package"
- match 'download/iframe' => "download#package", :format => 'iframe'
- match 'download/json' => "download#package", :format => 'json'
+ get 'download' => "download#package"
+ get 'download.:format' => "download#package"
+ get 'download/iframe' => "download#package", :format => 'iframe'
+ get 'download/json' => "download#package", :format => 'json'
- match '/download/:action(.:format)', :controller => 'download'
+ get '/download/:action(.:format)', :controller => 'download'
end
View
5 test/test_helper.rb
@@ -4,9 +4,10 @@
require 'rails/test_help'
require 'capybara/rails'
-Capybara.default_driver = :webkit
+require 'capybara/poltergeist'
+Capybara.default_driver = :poltergeist
-require 'webmock/test_unit'
+require 'webmock/minitest'
# Prevent webmock to prevent capybara to connect to localhost
WebMock.disable_net_connect!(:allow_localhost => true)
Please sign in to comment.
Something went wrong with that request. Please try again.