moses-vanity 1.7.1 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -1
- data/.travis.yml +4 -2
- data/Appraisals +15 -0
- data/CHANGELOG +7 -0
- data/Gemfile +16 -19
- data/Gemfile.lock +110 -0
- data/README.rdoc +10 -9
- data/Rakefile +2 -1
- data/gemfiles/rails3.gemfile +20 -0
- data/gemfiles/rails3.gemfile.lock +135 -0
- data/gemfiles/rails31.gemfile +20 -0
- data/gemfiles/rails31.gemfile.lock +146 -0
- data/gemfiles/rails32.gemfile +20 -0
- data/gemfiles/rails32.gemfile.lock +144 -0
- data/lib/vanity/adapters/active_record_adapter.rb +6 -6
- data/lib/vanity/experiment/base.rb +4 -0
- data/lib/vanity/frameworks/rails.rb +11 -4
- data/lib/vanity/metric/active_record.rb +9 -1
- data/lib/vanity/playground.rb +2 -1
- data/lib/vanity/version.rb +1 -1
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +44 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +5 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +26 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/log/production.log +0 -0
- data/test/dummy/log/server.log +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/experiment/ab_test.rb +7 -3
- data/test/experiment/base_test.rb +3 -3
- data/test/metric/active_record_test.rb +46 -16
- data/test/passenger_test.rb +4 -2
- data/test/rails_helper_test.rb +4 -2
- data/test/rails_test.rb +116 -93
- data/test/test_helper.rb +32 -10
- metadata +61 -3
@@ -0,0 +1,144 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/dougcole/workspace/vanity
|
3
|
+
specs:
|
4
|
+
vanity (1.8.0)
|
5
|
+
redis (~> 2.0)
|
6
|
+
redis-namespace (~> 1.0.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
SystemTimer (1.2.3)
|
12
|
+
actionmailer (3.2.1)
|
13
|
+
actionpack (= 3.2.1)
|
14
|
+
mail (~> 2.4.0)
|
15
|
+
actionpack (3.2.1)
|
16
|
+
activemodel (= 3.2.1)
|
17
|
+
activesupport (= 3.2.1)
|
18
|
+
builder (~> 3.0.0)
|
19
|
+
erubis (~> 2.7.0)
|
20
|
+
journey (~> 1.0.1)
|
21
|
+
rack (~> 1.4.0)
|
22
|
+
rack-cache (~> 1.1)
|
23
|
+
rack-test (~> 0.6.1)
|
24
|
+
sprockets (~> 2.1.2)
|
25
|
+
activemodel (3.2.1)
|
26
|
+
activesupport (= 3.2.1)
|
27
|
+
builder (~> 3.0.0)
|
28
|
+
activerecord (3.2.1)
|
29
|
+
activemodel (= 3.2.1)
|
30
|
+
activesupport (= 3.2.1)
|
31
|
+
arel (~> 3.0.0)
|
32
|
+
tzinfo (~> 0.3.29)
|
33
|
+
activeresource (3.2.1)
|
34
|
+
activemodel (= 3.2.1)
|
35
|
+
activesupport (= 3.2.1)
|
36
|
+
activesupport (3.2.1)
|
37
|
+
i18n (~> 0.6)
|
38
|
+
multi_json (~> 1.0)
|
39
|
+
addressable (2.2.7)
|
40
|
+
appraisal (0.4.1)
|
41
|
+
bundler
|
42
|
+
rake
|
43
|
+
arel (3.0.2)
|
44
|
+
bson (1.6.0)
|
45
|
+
bson_ext (1.6.0)
|
46
|
+
bson (= 1.6.0)
|
47
|
+
builder (3.0.0)
|
48
|
+
crack (0.3.1)
|
49
|
+
daemon_controller (1.0.0)
|
50
|
+
erubis (2.7.0)
|
51
|
+
fastthread (1.0.7)
|
52
|
+
garb (0.9.1)
|
53
|
+
activesupport (>= 2.2.0)
|
54
|
+
crack (>= 0.1.6)
|
55
|
+
hike (1.2.1)
|
56
|
+
i18n (0.6.0)
|
57
|
+
journey (1.0.3)
|
58
|
+
json (1.6.5)
|
59
|
+
mail (2.4.1)
|
60
|
+
i18n (>= 0.4.0)
|
61
|
+
mime-types (~> 1.16)
|
62
|
+
treetop (~> 1.4.8)
|
63
|
+
metaclass (0.0.1)
|
64
|
+
mime-types (1.17.2)
|
65
|
+
mocha (0.10.5)
|
66
|
+
metaclass (~> 0.0.1)
|
67
|
+
mongo (1.6.0)
|
68
|
+
bson (= 1.6.0)
|
69
|
+
multi_json (1.1.0)
|
70
|
+
mysql (2.8.1)
|
71
|
+
passenger (3.0.11)
|
72
|
+
daemon_controller (>= 0.2.5)
|
73
|
+
fastthread (>= 1.0.1)
|
74
|
+
rack
|
75
|
+
rake (>= 0.8.1)
|
76
|
+
pg (0.13.2)
|
77
|
+
polyglot (0.3.3)
|
78
|
+
rack (1.4.1)
|
79
|
+
rack-cache (1.1)
|
80
|
+
rack (>= 0.4)
|
81
|
+
rack-ssl (1.3.2)
|
82
|
+
rack
|
83
|
+
rack-test (0.6.1)
|
84
|
+
rack (>= 1.0)
|
85
|
+
rails (3.2.1)
|
86
|
+
actionmailer (= 3.2.1)
|
87
|
+
actionpack (= 3.2.1)
|
88
|
+
activerecord (= 3.2.1)
|
89
|
+
activeresource (= 3.2.1)
|
90
|
+
activesupport (= 3.2.1)
|
91
|
+
bundler (~> 1.0)
|
92
|
+
railties (= 3.2.1)
|
93
|
+
railties (3.2.1)
|
94
|
+
actionpack (= 3.2.1)
|
95
|
+
activesupport (= 3.2.1)
|
96
|
+
rack-ssl (~> 1.3.2)
|
97
|
+
rake (>= 0.8.7)
|
98
|
+
rdoc (~> 3.4)
|
99
|
+
thor (~> 0.14.6)
|
100
|
+
rake (0.9.2.2)
|
101
|
+
rdoc (3.12)
|
102
|
+
json (~> 1.4)
|
103
|
+
redis (2.2.2)
|
104
|
+
redis-namespace (1.0.3)
|
105
|
+
redis (< 3.0.0)
|
106
|
+
shoulda (3.0.1)
|
107
|
+
shoulda-context (~> 1.0.0)
|
108
|
+
shoulda-matchers (~> 1.0.0)
|
109
|
+
shoulda-context (1.0.0)
|
110
|
+
shoulda-matchers (1.0.0)
|
111
|
+
sprockets (2.1.2)
|
112
|
+
hike (~> 1.2)
|
113
|
+
rack (~> 1.0)
|
114
|
+
tilt (~> 1.1, != 1.3.0)
|
115
|
+
thor (0.14.6)
|
116
|
+
tilt (1.3.3)
|
117
|
+
timecop (0.3.5)
|
118
|
+
treetop (1.4.10)
|
119
|
+
polyglot
|
120
|
+
polyglot (>= 0.3.1)
|
121
|
+
tzinfo (0.3.31)
|
122
|
+
webmock (1.8.0)
|
123
|
+
addressable (>= 2.2.7)
|
124
|
+
crack (>= 0.1.7)
|
125
|
+
|
126
|
+
PLATFORMS
|
127
|
+
ruby
|
128
|
+
|
129
|
+
DEPENDENCIES
|
130
|
+
SystemTimer (= 1.2.3)
|
131
|
+
appraisal
|
132
|
+
bson_ext
|
133
|
+
garb
|
134
|
+
mocha
|
135
|
+
mongo
|
136
|
+
mysql
|
137
|
+
passenger (~> 3.0)
|
138
|
+
pg
|
139
|
+
rack
|
140
|
+
rails (= 3.2.1)
|
141
|
+
shoulda
|
142
|
+
timecop
|
143
|
+
vanity!
|
144
|
+
webmock
|
@@ -17,12 +17,12 @@ module Vanity
|
|
17
17
|
|
18
18
|
# Schema model
|
19
19
|
class VanitySchema < VanityRecord
|
20
|
-
|
20
|
+
self.table_name = :vanity_schema
|
21
21
|
end
|
22
22
|
|
23
23
|
# Metric model
|
24
24
|
class VanityMetric < VanityRecord
|
25
|
-
|
25
|
+
self.table_name = :vanity_metrics
|
26
26
|
has_many :vanity_metric_values
|
27
27
|
|
28
28
|
def self.retrieve(metric)
|
@@ -32,13 +32,13 @@ module Vanity
|
|
32
32
|
|
33
33
|
# Metric value
|
34
34
|
class VanityMetricValue < VanityRecord
|
35
|
-
|
35
|
+
self.table_name = :vanity_metric_values
|
36
36
|
belongs_to :vanity_metric
|
37
37
|
end
|
38
38
|
|
39
39
|
# Experiment model
|
40
40
|
class VanityExperiment < VanityRecord
|
41
|
-
|
41
|
+
self.table_name = :vanity_experiments
|
42
42
|
has_many :vanity_conversions, :dependent => :destroy
|
43
43
|
|
44
44
|
# Finds or creates the experiment
|
@@ -54,13 +54,13 @@ module Vanity
|
|
54
54
|
|
55
55
|
# Conversion model
|
56
56
|
class VanityConversion < VanityRecord
|
57
|
-
|
57
|
+
self.table_name = :vanity_conversions
|
58
58
|
belongs_to :vanity_experiment
|
59
59
|
end
|
60
60
|
|
61
61
|
# Participant model
|
62
62
|
class VanityParticipant < VanityRecord
|
63
|
-
|
63
|
+
self.table_name = :vanity_participants
|
64
64
|
|
65
65
|
# Finds the participant by experiment and identity. If
|
66
66
|
# create is true then it will create the participant
|
@@ -49,7 +49,9 @@ module Vanity
|
|
49
49
|
cookies["vanity_id"] = { :value=>@vanity_identity, :expires=>1.month.from_now }
|
50
50
|
@vanity_identity
|
51
51
|
elsif response # everyday use
|
52
|
-
|
52
|
+
#conditional for Rails2 support
|
53
|
+
secure_random = defined?(SecureRandom) ? SecureRandom : ActiveSupport::SecureRandom
|
54
|
+
@vanity_identity = cookies["vanity_id"] || secure_random.hex(16)
|
53
55
|
cookie = { :value=>@vanity_identity, :expires=>1.month.from_now }
|
54
56
|
# Useful if application and admin console are on separate domains.
|
55
57
|
# This only works in Rails 3.x.
|
@@ -83,7 +85,8 @@ module Vanity
|
|
83
85
|
else
|
84
86
|
class << self
|
85
87
|
define_method :vanity_identity do
|
86
|
-
|
88
|
+
secure_random = defined?(SecureRandom) ? SecureRandom : ActiveSupport::SecureRandom
|
89
|
+
@vanity_identity = @vanity_identity || secure_random.hex(16)
|
87
90
|
end
|
88
91
|
end
|
89
92
|
end
|
@@ -189,7 +192,11 @@ module Vanity
|
|
189
192
|
|
190
193
|
if block
|
191
194
|
content = capture(value, &block)
|
192
|
-
block_called_from_erb?
|
195
|
+
if defined?(block_called_from_erb?) && block_called_from_erb?(block)
|
196
|
+
concat(content)
|
197
|
+
else
|
198
|
+
content
|
199
|
+
end
|
193
200
|
else
|
194
201
|
value
|
195
202
|
end
|
@@ -210,7 +217,7 @@ module Vanity
|
|
210
217
|
def vanity_js
|
211
218
|
return if @_vanity_experiments.nil?
|
212
219
|
javascript_tag do
|
213
|
-
render Vanity.template("
|
220
|
+
render :file => Vanity.template("_vanity.js.erb")
|
214
221
|
end
|
215
222
|
end
|
216
223
|
|
@@ -57,10 +57,18 @@ module Vanity
|
|
57
57
|
|
58
58
|
# This values method queries the database.
|
59
59
|
def values(sdate, edate)
|
60
|
+
begin
|
61
|
+
time = Time.now.in_time_zone
|
62
|
+
difference = time.to_date - Date.today
|
63
|
+
sdate = sdate + difference
|
64
|
+
edate = edate + difference
|
65
|
+
rescue NoMethodError #In Rails 2.3, if no time zone has been set this fails
|
66
|
+
end
|
60
67
|
query = { :conditions=> { @ar_timestamp_table => { @ar_timestamp => (sdate.to_time...(edate + 1).to_time) } },
|
61
68
|
:group=>"date(#{@ar_scoped.quoted_table_name}.#{@ar_scoped.connection.quote_column_name @ar_timestamp})" }
|
62
69
|
grouped = @ar_column ? @ar_scoped.send(@ar_aggregate, @ar_column, query) : @ar_scoped.count(query)
|
63
|
-
|
70
|
+
grouped = Hash[grouped.map {|k,v| [k.to_date, v] }]
|
71
|
+
(sdate..edate).inject([]) { |ordered, date| ordered << (grouped[date] || 0) }
|
64
72
|
end
|
65
73
|
|
66
74
|
# This track! method stores nothing, but calls the hooks.
|
data/lib/vanity/playground.rb
CHANGED
@@ -95,10 +95,11 @@ module Vanity
|
|
95
95
|
# an exception if it cannot load the experiment's definition.
|
96
96
|
#
|
97
97
|
# @see Vanity::Experiment
|
98
|
+
|
98
99
|
def experiment(name)
|
99
100
|
id = name.to_s.downcase.gsub(/\W/, "_").to_sym
|
100
101
|
warn "Deprecated: pleae call experiment method with experiment identifier (a Ruby symbol)" unless id == name
|
101
|
-
experiments[id.to_sym] or raise
|
102
|
+
experiments[id.to_sym] or raise NoExperimentError, "No experiment #{id}"
|
102
103
|
end
|
103
104
|
|
104
105
|
|
data/lib/vanity/version.rb
CHANGED
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
5
|
+
require 'rake'
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require "active_model/railtie"
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_view/railtie"
|
7
|
+
require "action_mailer/railtie"
|
8
|
+
|
9
|
+
Bundler.require
|
10
|
+
|
11
|
+
module Dummy
|
12
|
+
class Application < Rails::Application
|
13
|
+
# Settings in config/environments/* take precedence over those specified here.
|
14
|
+
# Application configuration should go into files in config/initializers
|
15
|
+
# -- all .rb files in that directory are automatically loaded.
|
16
|
+
|
17
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
18
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
19
|
+
|
20
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
21
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
22
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
23
|
+
|
24
|
+
# Activate observers that should always be running.
|
25
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
26
|
+
|
27
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
28
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
29
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
30
|
+
|
31
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
32
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
33
|
+
# config.i18n.default_locale = :de
|
34
|
+
|
35
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
36
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
37
|
+
|
38
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
39
|
+
config.encoding = "utf-8"
|
40
|
+
|
41
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
42
|
+
config.filter_parameters += [:password]
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the webserver when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
5
|
+
# Code is not reloaded between requests
|
6
|
+
config.cache_classes = true
|
7
|
+
|
8
|
+
# Full error reports are disabled and caching is turned on
|
9
|
+
config.consider_all_requests_local = false
|
10
|
+
config.action_controller.perform_caching = true
|
11
|
+
|
12
|
+
# Specifies the header that your server uses for sending files
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
14
|
+
|
15
|
+
# For nginx:
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
17
|
+
|
18
|
+
# If you have no front-end server that supports something like X-Sendfile,
|
19
|
+
# just comment this out and Rails will serve the files
|
20
|
+
|
21
|
+
# See everything in the log (default is :info)
|
22
|
+
# config.log_level = :debug
|
23
|
+
|
24
|
+
# Use a different logger for distributed setups
|
25
|
+
# config.logger = SyslogLogger.new
|
26
|
+
|
27
|
+
# Use a different cache store in production
|
28
|
+
# config.cache_store = :mem_cache_store
|
29
|
+
|
30
|
+
# Disable Rails's static asset server
|
31
|
+
# In production, Apache or nginx will already do this
|
32
|
+
config.serve_static_assets = false
|
33
|
+
|
34
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
35
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
36
|
+
|
37
|
+
# Disable delivery errors, bad email addresses will be ignored
|
38
|
+
# config.action_mailer.raise_delivery_errors = false
|
39
|
+
|
40
|
+
# Enable threaded mode
|
41
|
+
# config.threadsafe!
|
42
|
+
|
43
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
44
|
+
# the I18n.default_locale when a translation can not be found)
|
45
|
+
config.i18n.fallbacks = true
|
46
|
+
|
47
|
+
# Send deprecation notices to registered listeners
|
48
|
+
config.active_support.deprecation = :notify
|
49
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
19
|
+
|
20
|
+
# Disable request forgery protection in test environment
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
22
|
+
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
25
|
+
# ActionMailer::Base.deliveries array.
|
26
|
+
config.action_mailer.delivery_method = :test
|
27
|
+
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
+
# like if you have constraints or database-specific column types
|
31
|
+
# config.active_record.schema_format = :sql
|
32
|
+
|
33
|
+
# Print deprecation notices to the stderr
|
34
|
+
config.active_support.deprecation = :stderr
|
35
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
Dummy::Application.config.secret_token = '33ccbc9a29f3b02e87c08904505b1c9a3a1e97dd01f02e598e65ee9e7b96fff2ca4a6d0dd7c4a8d3682d8c64f84d372661e141264e70697dc576c722c72d80d0'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# Dummy::Application.config.session_store :active_record_store
|
@@ -0,0 +1,58 @@
|
|
1
|
+
Dummy::Application.routes.draw do
|
2
|
+
# The priority is based upon order of creation:
|
3
|
+
# first created -> highest priority.
|
4
|
+
|
5
|
+
# Sample of regular route:
|
6
|
+
# match 'products/:id' => 'catalog#view'
|
7
|
+
# Keep in mind you can assign values other than :controller and :action
|
8
|
+
|
9
|
+
# Sample of named route:
|
10
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
11
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
12
|
+
|
13
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
14
|
+
# resources :products
|
15
|
+
|
16
|
+
# Sample resource route with options:
|
17
|
+
# resources :products do
|
18
|
+
# member do
|
19
|
+
# get 'short'
|
20
|
+
# post 'toggle'
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# collection do
|
24
|
+
# get 'sold'
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
|
28
|
+
# Sample resource route with sub-resources:
|
29
|
+
# resources :products do
|
30
|
+
# resources :comments, :sales
|
31
|
+
# resource :seller
|
32
|
+
# end
|
33
|
+
|
34
|
+
# Sample resource route with more complex sub-resources
|
35
|
+
# resources :products do
|
36
|
+
# resources :comments
|
37
|
+
# resources :sales do
|
38
|
+
# get 'recent', :on => :collection
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
|
42
|
+
# Sample resource route within a namespace:
|
43
|
+
# namespace :admin do
|
44
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
45
|
+
# # (app/controllers/admin/products_controller.rb)
|
46
|
+
# resources :products
|
47
|
+
# end
|
48
|
+
|
49
|
+
# You can have the root of your site routed with "root"
|
50
|
+
# just remember to delete public/index.html.
|
51
|
+
# root :to => "welcome#index"
|
52
|
+
|
53
|
+
# See how all your routes lay out with "rake routes"
|
54
|
+
|
55
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
56
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
57
|
+
match ':controller(/:action(/:id(.:format)))'
|
58
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|