Permalink
Browse files

Merge pull request #5 from 3den/all_the_assets

All the assets With Pjax and Rails 4
  • Loading branch information...
2 parents 0e22691 + 3a7dfa6 commit 204e862accd5d9e773bf60f2dc19d7f1933e0290 @steveklabnik committed Jun 9, 2014
View
17 Gemfile
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
-gem 'rails', '3.2.8'
+gem 'rails', '4.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -9,17 +9,13 @@ gem 'sqlite3'
gem 'json'
-# Gems used only for assets and not required
-# in production environments by default.
-group :assets do
- gem 'sass-rails', '~> 3.2.3'
- gem 'coffee-rails', '~> 3.2.1'
+gem 'sass-rails', '~> 4.0.0'
+gem 'coffee-rails', '~> 4.0.0'
- # See https://github.com/sstephenson/execjs#readme for more supported runtimes
- # gem 'therubyracer', :platforms => :ruby
+# See https://github.com/sstephenson/execjs#readme for more supported runtimes
+# gem 'therubyracer', :platforms => :ruby
- gem 'uglifier', '>= 1.0.3'
-end
+gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
@@ -42,5 +38,6 @@ gem 'turbolinks'
group :test do
gem 'rspec-rails'
+ gem 'selenium-webdriver'
gem 'capybara'
end
View
@@ -1,152 +1,146 @@
GEM
remote: https://rubygems.org/
specs:
- actionmailer (3.2.8)
- actionpack (= 3.2.8)
- mail (~> 2.4.4)
- actionpack (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- builder (~> 3.0.0)
+ actionmailer (4.0.0)
+ actionpack (= 4.0.0)
+ mail (~> 2.5.3)
+ actionpack (4.0.0)
+ activesupport (= 4.0.0)
+ builder (~> 3.1.0)
erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.0)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.1.3)
- activemodel (3.2.8)
- activesupport (= 3.2.8)
- builder (~> 3.0.0)
- activerecord (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activeresource (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- activesupport (3.2.8)
- i18n (~> 0.6)
- multi_json (~> 1.0)
- addressable (2.3.2)
- arel (3.0.2)
- builder (3.0.3)
- capybara (1.1.2)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ activemodel (4.0.0)
+ activesupport (= 4.0.0)
+ builder (~> 3.1.0)
+ activerecord (4.0.0)
+ activemodel (= 4.0.0)
+ activerecord-deprecated_finders (~> 1.0.2)
+ activesupport (= 4.0.0)
+ arel (~> 4.0.0)
+ activerecord-deprecated_finders (1.0.3)
+ activesupport (4.0.0)
+ i18n (~> 0.6, >= 0.6.4)
+ minitest (~> 4.2)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.37)
+ arel (4.0.0)
+ atomic (1.1.14)
+ builder (3.1.4)
+ capybara (2.1.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
- selenium-webdriver (~> 2.0)
- xpath (~> 0.1.4)
- childprocess (0.3.5)
- ffi (~> 1.0, >= 1.0.6)
- coffee-rails (3.2.2)
+ xpath (~> 2.0)
+ childprocess (0.3.9)
+ ffi (~> 1.0, >= 1.0.11)
+ coffee-rails (4.0.0)
coffee-script (>= 2.2.0)
- railties (~> 3.2.0)
+ railties (>= 4.0.0.beta, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.3.3)
- diff-lcs (1.1.3)
+ coffee-script-source (1.6.3)
+ diff-lcs (1.2.4)
erubis (2.7.0)
- execjs (1.4.0)
- multi_json (~> 1.0)
- ffi (1.1.4)
- hike (1.2.1)
- i18n (0.6.1)
- journey (1.0.4)
- jquery-rails (2.1.3)
- railties (>= 3.1.0, < 5.0)
- thor (~> 0.14)
- json (1.7.5)
- libwebsocket (0.1.5)
- addressable
- mail (2.4.4)
- i18n (>= 0.4.0)
+ execjs (2.0.1)
+ ffi (1.9.0)
+ hike (1.2.3)
+ i18n (0.6.5)
+ jquery-rails (3.0.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.8.0)
+ mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.19)
- multi_json (1.3.6)
- nokogiri (1.5.5)
+ mime-types (1.25)
+ mini_portile (0.5.1)
+ minitest (4.7.5)
+ multi_json (1.8.0)
+ nokogiri (1.6.0)
+ mini_portile (~> 0.5.0)
polyglot (0.3.3)
- rack (1.4.1)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-ssl (1.3.2)
- rack
+ rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
- rails (3.2.8)
- actionmailer (= 3.2.8)
- actionpack (= 3.2.8)
- activerecord (= 3.2.8)
- activeresource (= 3.2.8)
- activesupport (= 3.2.8)
- bundler (~> 1.0)
- railties (= 3.2.8)
- railties (3.2.8)
- actionpack (= 3.2.8)
- activesupport (= 3.2.8)
- rack-ssl (~> 1.3.2)
+ rails (4.0.0)
+ actionmailer (= 4.0.0)
+ actionpack (= 4.0.0)
+ activerecord (= 4.0.0)
+ activesupport (= 4.0.0)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.0.0)
+ sprockets-rails (~> 2.0.0)
+ railties (4.0.0)
+ actionpack (= 4.0.0)
+ activesupport (= 4.0.0)
rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (>= 0.14.6, < 2.0)
- rake (0.9.2.2)
- rdoc (3.12)
- json (~> 1.4)
- rspec (2.11.0)
- rspec-core (~> 2.11.0)
- rspec-expectations (~> 2.11.0)
- rspec-mocks (~> 2.11.0)
- rspec-core (2.11.1)
- rspec-expectations (2.11.3)
- diff-lcs (~> 1.1.3)
- rspec-mocks (2.11.2)
- rspec-rails (2.11.0)
+ thor (>= 0.18.1, < 2.0)
+ rake (10.1.0)
+ rspec-core (2.14.5)
+ rspec-expectations (2.14.2)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rspec-mocks (2.14.3)
+ rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
- rspec (~> 2.11.0)
+ rspec-core (~> 2.14.0)
+ rspec-expectations (~> 2.14.0)
+ rspec-mocks (~> 2.14.0)
rubyzip (0.9.9)
- sass (3.2.1)
- sass-rails (3.2.5)
- railties (~> 3.2.0)
+ sass (3.2.10)
+ sass-rails (4.0.0)
+ railties (>= 4.0.0.beta, < 5.0)
sass (>= 3.1.10)
- tilt (~> 1.3)
- selenium-webdriver (2.25.0)
+ sprockets-rails (~> 2.0.0)
+ selenium-webdriver (2.35.1)
childprocess (>= 0.2.5)
- libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
- rubyzip
- sprockets (2.1.3)
+ rubyzip (< 1.0.0)
+ websocket (~> 1.0.4)
+ sprockets (2.10.0)
hike (~> 1.2)
+ multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- sqlite3 (1.3.6)
- thor (0.16.0)
- tilt (1.3.3)
- treetop (1.4.10)
+ sprockets-rails (2.0.0)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
+ sqlite3 (1.3.8)
+ thor (0.18.1)
+ thread_safe (0.1.3)
+ atomic
+ tilt (1.4.1)
+ treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
- turbolinks (0.2.1)
- tzinfo (0.3.33)
- uglifier (1.3.0)
+ turbolinks (1.3.0)
+ coffee-rails
+ tzinfo (0.3.37)
+ uglifier (2.2.1)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
- xpath (0.1.4)
+ websocket (1.0.7)
+ xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
capybara
- coffee-rails (~> 3.2.1)
+ coffee-rails (~> 4.0.0)
jquery-rails
json
- rails (= 3.2.8)
+ rails (= 4.0.0)
rspec-rails
- sass-rails (~> 3.2.3)
+ sass-rails (~> 4.0.0)
+ selenium-webdriver
sqlite3
turbolinks
- uglifier (>= 1.0.3)
+ uglifier (>= 1.3.0)
View
@@ -1,40 +1,5 @@
-## Turbolinks test
-
-Well, by now, you've done all your arguing on Twitter. Is Turbolinks a good
-idea, or the Worst Thing Ever?
-
-### optimizing a bit early
-
-![don knuth](http://upload.wikimedia.org/wikipedia/commons/4/4f/KnuthAtOpenContentAlliance.jpg) ![tony hoare](http://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Sir_Tony_Hoare_IMG_5125.jpg/600px-Sir_Tony_Hoare_IMG_5125.jpg)
-
-See these guys? One of them said this:
-
-> "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil"
-
-Wisdom.
-
-But what makes optimization premature? When you don't know if you should do it
-or not. How do you know?
-
-### measure twice, cut once
-
-![measure twice](http://barnraisersllc.com/wp-content/uploads/2010/08/Measuring-Tapes1.jpg)
-
-Measuring. It's good for you. You can do it. If you measure things, you can be
-sure what's up.
-
-But like eating your veggies, nobody measures. Ever.
-
-### you're a scientist, dammit
-
-Computer **SCIENCE** is called science for a reason, yo. Be a scientist. Don't
-just argue about stuff on blogs. Measure things. Then report back.
-
-### this test sucks
-
-This probably isn't even a good test. I don't care. Tell me how it sucks. Let's
-figure it out. But having actual measurements beats complaining about shit on
-Twitter any day.
+This is a modivication of the original test with Rails 4.
+Also we are testing Pjax vs Turbolinks vs None
### all the assets branch
@@ -51,21 +16,32 @@ Done.
What I get:
-With 1000 pages:
+With 10 pages:
```
$ rspec
user system total real
- no turbolinks 21.990000 2.890000 25.150000 (581.822206)
-yes turbolinks 10.970000 0.910000 11.880000 (196.481247)
+ nothing 1.030000 0.170000 1.530000 ( 5.028314)
+turbolinks 0.140000 0.020000 0.160000 ( 0.984095)
+ pjax 0.100000 0.020000 0.120000 ( 0.876211)
```
With 100 pages:
```
$ rspec
user system total real
- no turbolinks 2.230000 0.300000 2.800000 ( 56.777195)
-yes turbolinks 1.130000 0.090000 1.220000 ( 19.173316)
+ nothing 3.600000 0.800000 4.720000 ( 26.237932)
+turbolinks 1.130000 0.120000 1.250000 ( 11.028930)
+ pjax 1.020000 0.120000 1.140000 ( 7.688372)
```
+With 1000 pages:
+
+```
+$ rspec
+ user system total real
+ nothing 28.410000 7.010000 35.750000 (256.809647)
+turbolinks 10.970000 1.120000 12.090000 (104.501979)
+ pjax 10.240000 1.250000 11.490000 ( 77.392627)
+```
@@ -1,17 +1,10 @@
-// This is a manifest file that'll be compiled into application.js, which will include all the files
-// listed below.
-//
-// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
-// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
-//
-// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
-// the compiled file.
-//
-// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
-// GO AFTER THE REQUIRES BELOW.
-//
//= require jquery
//= require jquery_ujs
-//= require_tree .
-
+//= require jquery.pjax
//= require turbolinks
+
+$(function(){
+ $(document).pjax('a[data-pjax]', 'body');
+});
+
+//= require_tree .
Oops, something went wrong.

0 comments on commit 204e862

Please sign in to comment.