vanity 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/CHANGELOG +28 -0
  2. data/Gemfile +1 -0
  3. data/README.rdoc +10 -3
  4. data/Rakefile +3 -3
  5. data/bin/b2json +16 -0
  6. data/bin/convert_to_should_syntax +16 -0
  7. data/bin/dw +16 -0
  8. data/bin/j2bson +16 -0
  9. data/bin/jekyll +16 -0
  10. data/bin/kramdown +16 -0
  11. data/bin/maruku +16 -0
  12. data/bin/marutex +16 -0
  13. data/bin/mongo_console +16 -0
  14. data/bin/passenger-config +16 -0
  15. data/bin/passenger-install-apache2-module +16 -0
  16. data/bin/passenger-install-nginx-module +16 -0
  17. data/bin/passenger-make-enterprisey +16 -0
  18. data/bin/passenger-memory-stats +16 -0
  19. data/bin/passenger-spawn-server +16 -0
  20. data/bin/passenger-status +16 -0
  21. data/bin/passenger-stress-test +16 -0
  22. data/bin/posix-spawn-benchmark +16 -0
  23. data/bin/rackup +16 -0
  24. data/bin/rails +16 -0
  25. data/bin/rake +16 -0
  26. data/bin/redcloth +16 -0
  27. data/bin/vanity +12 -65
  28. data/bin/yard +16 -0
  29. data/bin/yardoc +16 -0
  30. data/bin/yri +16 -0
  31. data/lib/generators/templates/vanity_migration.rb +53 -0
  32. data/lib/generators/vanity_generator.rb +15 -0
  33. data/lib/vanity/adapters/abstract_adapter.rb +5 -0
  34. data/lib/vanity/adapters/active_record_adapter.rb +10 -69
  35. data/lib/vanity/adapters/redis_adapter.rb +1 -1
  36. data/lib/vanity/frameworks/rails.rb +68 -7
  37. data/lib/vanity/images/x.gif +0 -0
  38. data/lib/vanity/playground.rb +0 -5
  39. data/lib/vanity/templates/vanity.css +1 -1
  40. data/lib/vanity/version.rb +1 -1
  41. data/test/adapters/redis_adapter_test.rb +1 -1
  42. data/test/experiment/ab_test.rb +0 -1
  43. data/test/myapp/log/production.log +522 -0
  44. data/test/myapp/log/test.log +304 -0
  45. data/test/passenger_test.rb +1 -1
  46. data/test/rails_helper_test.rb +8 -0
  47. data/test/rails_test.rb +23 -13
  48. data/test/test_helper.rb +23 -11
  49. metadata +40 -10
data/CHANGELOG CHANGED
@@ -1,3 +1,31 @@
1
+ == 1.7.0 (2011-08-27)
2
+
3
+ 1.7.0 adds support for ActionMailer, for example:
4
+
5
+ class UserMailer < ActionMailer::Base
6
+ def invite_email(user)
7
+ use_vanity_mailer user
8
+ mail :to => user.email, :subject => ab_test(:invite_subject)
9
+ end
10
+ end
11
+
12
+ See the documentation for more details.
13
+
14
+
15
+ With 1.7.0 and moving forward, if you need to setup a database schema
16
+ (relational databases only), please use the generator:
17
+
18
+ $ rails generate vanity
19
+ $ rake db:migrate
20
+
21
+
22
+ Rails generator for AR migrations (Zaid Zawaideh)
23
+
24
+ A/B testing in ActionMailer (Joseph Sofaer)
25
+
26
+ Fix hung passenger processes when using Redis client (Chris Griego)
27
+
28
+
1
29
  == 1.6.1 (2011-07-20)
2
30
 
3
31
  Fixed cookie domain setting.
data/Gemfile CHANGED
@@ -16,6 +16,7 @@ group :test do
16
16
  gem "bson_ext"
17
17
  gem "mysql"
18
18
  gem "passenger", "~>2.0"
19
+ gem "pg"
19
20
  gem "rails", "~>2.3.8"
20
21
  gem "rack"
21
22
  gem "shoulda"
data/README.rdoc CHANGED
@@ -21,10 +21,17 @@ http://farm3.static.flickr.com/2540/4099665871_497f274f68_o.jpg
21
21
  end
22
22
 
23
23
  == Rails 3 configuration
24
-
25
- gem 'vanity' # in Gemfile, either outside of a group or inside of a bundler group
26
24
 
27
- And:
25
+ Add to your Gemfile:
26
+
27
+ gem "vanity"
28
+
29
+ If using a relational database, run the generator and migrations to create the database schema:
30
+
31
+ $ rails generate vanity
32
+ $ rake db:migrate
33
+
34
+ Add to your application controller:
28
35
 
29
36
  class ApplicationController < ActionController::Base
30
37
  use_vanity :current_user
data/Rakefile CHANGED
@@ -70,14 +70,14 @@ task "test:setup" do
70
70
  end
71
71
 
72
72
  # These are all the adapters we're going to test with.
73
- ADAPTERS = %w{redis mongodb}
73
+ ADAPTERS = %w{redis mongodb mysql}
74
74
 
75
75
  desc "Test using different back-ends"
76
76
  task "test:adapters", :adapter do |t, args|
77
77
  adapters = args.adapter ? [args.adapter] : ADAPTERS
78
78
  adapters.each do |adapter|
79
79
  puts "** Testing #{adapter} adapter"
80
- sh "rake test ADAPTER=#{adapter} #{'--trace' if Rake.application.options.trace}"
80
+ sh "rake test DB=#{adapter} #{'--trace' if Rake.application.options.trace}"
81
81
  end
82
82
  end
83
83
 
@@ -115,7 +115,7 @@ end
115
115
  desc "Jekyll generates the main documentation (sans API)"
116
116
  task(:jekyll) { sh "jekyll", "doc", "html" }
117
117
  file "html/vanity.pdf"=>:jekyll do |t|
118
- pages = %w{index metrics ab_testing rails identity configuring contributing}.map{ |p| "html/#{p}.html" }
118
+ pages = %w{index metrics ab_testing rails email identity configuring contributing}.map{ |p| "html/#{p}.html" }
119
119
  args = %w{--disable-javascript --outline --title Vanity --header-html doc/_layouts/_header.html --print-media-type}
120
120
  args.concat %w{--margin-left 20 --margin-right 20 --margin-top 20 --margin-bottom 20 --header-spacing 5}
121
121
  args.concat pages << t.name
data/bin/b2json ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'b2json' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('bson', 'b2json')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'convert_to_should_syntax' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('shoulda', 'convert_to_should_syntax')
data/bin/dw ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'dw' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('directory_watcher', 'dw')
data/bin/j2bson ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'j2bson' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('bson', 'j2bson')
data/bin/jekyll ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'jekyll' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('jekyll', 'jekyll')
data/bin/kramdown ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'kramdown' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('kramdown', 'kramdown')
data/bin/maruku ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'maruku' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('maruku', 'maruku')
data/bin/marutex ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'marutex' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('maruku', 'marutex')
data/bin/mongo_console ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'mongo_console' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('mongo', 'mongo_console')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'passenger-config' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('passenger', 'passenger-config')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'passenger-install-apache2-module' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('passenger', 'passenger-install-apache2-module')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'passenger-install-nginx-module' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('passenger', 'passenger-install-nginx-module')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'passenger-make-enterprisey' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('passenger', 'passenger-make-enterprisey')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'passenger-memory-stats' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('passenger', 'passenger-memory-stats')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'passenger-spawn-server' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('passenger', 'passenger-spawn-server')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'passenger-status' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('passenger', 'passenger-status')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'passenger-stress-test' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('passenger', 'passenger-stress-test')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'posix-spawn-benchmark' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('posix-spawn', 'posix-spawn-benchmark')
data/bin/rackup ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rackup' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rack', 'rackup')
data/bin/rails ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rails' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rails', 'rails')