Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding basic split example and readme

  • Loading branch information...
commit 053592dac4d3f39a8c437000b9f6dce5824d3c14 1 parent f43ff64
@semanticart authored
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 Jeffrey Chupp
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
17 Readme.mdown
@@ -0,0 +1,17 @@
+# Example of using split in a rails 3 app
+
+This example app shows how easily you can integrate the a/b testing framework [Split](https://github.com/andrew/split) into your Rails based projects.
+
+## Note on Patches/Pull Requests
+
+ * Fork the project.
+ * Make your feature addition or bug fix.
+ * Add tests for it. This is important so I don't break it in a
+ future version unintentionally.
+ * Commit, do not mess with rakefile, version, or history.
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
+ * Send me a pull request. Bonus points for topic branches.
+
+## Copyright
+
+Copyright (c) 2011 Jeffrey Chupp. See LICENSE for details.
View
4 app/controllers/home_controller.rb
@@ -0,0 +1,4 @@
+class HomeController < ApplicationController
+ def index
+ end
+end
View
5 app/controllers/users_controller.rb
@@ -0,0 +1,5 @@
+class UsersController < ApplicationController
+ def new
+ finished('copy_for_signup_link')
+ end
+end
View
2  app/helpers/home_helper.rb
@@ -0,0 +1,2 @@
+module HomeHelper
+end
View
2  app/helpers/users_helper.rb
@@ -0,0 +1,2 @@
+module UsersHelper
+end
View
1  app/views/home/index.erb
@@ -0,0 +1 @@
+<p><a href='/users/new'><%= ab_test("copy_for_signup_link", "Sign up now!", "Click here to sign up") %></a></p>
View
5 app/views/layouts/application.html.erb
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>SplitRailsExample</title>
+ <title>Split Rails Example</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
@@ -10,5 +10,8 @@
<%= yield %>
+ <div id="footer">
+ <p>Powered by <a href="http://github.com/andrew/split">Split</a> v<%=Split::VERSION %></p>
+ </div>
</body>
</html>
View
3  app/views/users/new.erb
@@ -0,0 +1,3 @@
+<h1>Finished Experiment!</h1>
+
+<p><a href='/split'>See the results</a></p>
View
58 config/routes.rb
@@ -1,58 +1,8 @@
+require 'split/dashboard'
SplitRailsExample::Application.routes.draw do
- # The priority is based upon order of creation:
- # first created -> highest priority.
+ mount Split::Dashboard => "/split"
- # Sample of regular route:
- # match 'products/:id' => 'catalog#view'
- # Keep in mind you can assign values other than :controller and :action
+ resources :users
- # Sample of named route:
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
-
- # Sample resource route with options:
- # resources :products do
- # member do
- # get 'short'
- # post 'toggle'
- # end
- #
- # collection do
- # get 'sold'
- # end
- # end
-
- # Sample resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Sample resource route with more complex sub-resources
- # resources :products do
- # resources :comments
- # resources :sales do
- # get 'recent', :on => :collection
- # end
- # end
-
- # Sample resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
- # You can have the root of your site routed with "root"
- # just remember to delete public/index.html.
- # root :to => "welcome#index"
-
- # See how all your routes lay out with "rake routes"
-
- # This is a legacy wild controller route that's not recommended for RESTful applications.
- # Note: This route will make all actions in every controller accessible via GET requests.
- # match ':controller(/:action(/:id(.:format)))'
+ root :to => "home#index"
end
View
8 test/functional/home_controller_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class HomeControllerTest < ActionController::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
View
8 test/functional/users_controller_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class UsersControllerTest < ActionController::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
View
4 test/unit/helpers/home_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class HomeHelperTest < ActionView::TestCase
+end
View
4 test/unit/helpers/users_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class UsersHelperTest < ActionView::TestCase
+end
Please sign in to comment.
Something went wrong with that request. Please try again.