ads-rails 0.2.3 → 4.0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +17 -20
- data/Rakefile +1 -14
- data/lib/ads-rails.rb +4 -7
- data/lib/ads/configuration.rb +13 -0
- data/lib/ads/rails.rb +2 -1
- data/lib/ads/rails/extensions/action_view/base.rb +34 -0
- data/lib/ads/rails/railtie.rb +4 -2
- data/lib/ads/rails/version.rb +1 -1
- data/lib/generators/ads/install/install_generator.rb +15 -0
- data/lib/generators/ads/install/templates/initializer.rb +8 -0
- data/test/dummy/Rakefile +1 -2
- data/test/dummy/app/assets/javascripts/application.js +2 -2
- data/test/dummy/app/assets/stylesheets/application.css +6 -4
- data/test/dummy/app/views/layouts/application.html.erb +9 -11
- data/test/dummy/bin/bundle +1 -0
- data/test/dummy/bin/rails +2 -1
- data/test/dummy/bin/rake +1 -0
- data/test/dummy/bin/setup +30 -0
- data/test/dummy/config.ru +1 -1
- data/test/dummy/config/application.rb +6 -1
- data/test/dummy/config/boot.rb +1 -1
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +14 -5
- data/test/dummy/config/environments/production.rb +18 -26
- data/test/dummy/config/environments/test.rb +10 -12
- data/test/dummy/config/initializers/ads.rb +8 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/mime_types.rb +1 -2
- data/test/dummy/config/initializers/session_store.rb +1 -1
- data/test/dummy/config/routes.rb +1 -1
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/log/test.log +60 -0
- data/test/dummy/public/404.html +58 -55
- data/test/dummy/public/422.html +58 -55
- data/test/dummy/public/500.html +57 -54
- data/test/generator_test.rb +5 -5
- data/test/test_helper.rb +5 -14
- data/test/view_test.rb +28 -0
- metadata +28 -60
- data/lib/ads/rails/action_view/base.rb +0 -40
- data/lib/generators/ads/install_generator.rb +0 -13
- data/lib/generators/ads/templates/ads.rb +0 -2
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/initializers/secret_token.rb +0 -13
- data/test/dummy/db/schema.rb +0 -16
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/include_tag_test.rb +0 -47
@@ -1,30 +1,28 @@
|
|
1
|
-
|
1
|
+
Rails.application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# Code is not reloaded between requests.
|
5
5
|
config.cache_classes = true
|
6
6
|
|
7
7
|
# Eager load code on boot. This eager loads most of Rails and
|
8
|
-
# your application in memory, allowing both
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
9
|
# and those relying on copy on write to perform better.
|
10
10
|
# Rake tasks automatically ignore this option for performance.
|
11
11
|
config.eager_load = true
|
12
12
|
|
13
13
|
# Full error reports are disabled and caching is turned on.
|
14
|
-
config.consider_all_requests_local
|
14
|
+
config.consider_all_requests_local = false
|
15
15
|
config.action_controller.perform_caching = true
|
16
16
|
|
17
17
|
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
18
|
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
-
# For large-scale production use, consider using a caching reverse proxy like
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
20
21
|
# config.action_dispatch.rack_cache = true
|
21
22
|
|
22
|
-
# Disable
|
23
|
-
|
24
|
-
|
25
|
-
else
|
26
|
-
config.serve_static_assets = false
|
27
|
-
end
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
28
26
|
|
29
27
|
# Compress JavaScripts and CSS.
|
30
28
|
config.assets.js_compressor = :uglifier
|
@@ -33,21 +31,22 @@ Dummy::Application.configure do
|
|
33
31
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
34
32
|
config.assets.compile = false
|
35
33
|
|
36
|
-
#
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
37
36
|
config.assets.digest = true
|
38
37
|
|
39
|
-
#
|
40
|
-
config.assets.version = '1.0'
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
41
39
|
|
42
40
|
# Specifies the header that your server uses for sending files.
|
43
|
-
# config.action_dispatch.x_sendfile_header =
|
44
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
45
43
|
|
46
44
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
47
45
|
# config.force_ssl = true
|
48
46
|
|
49
|
-
#
|
50
|
-
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
51
50
|
|
52
51
|
# Prepend all log lines with the following tags.
|
53
52
|
# config.log_tags = [ :subdomain, :uuid ]
|
@@ -59,26 +58,19 @@ Dummy::Application.configure do
|
|
59
58
|
# config.cache_store = :mem_cache_store
|
60
59
|
|
61
60
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
62
|
-
# config.action_controller.asset_host =
|
63
|
-
|
64
|
-
# Precompile additional assets.
|
65
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
66
|
-
# config.assets.precompile += %w( search.js )
|
61
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
67
62
|
|
68
63
|
# Ignore bad email addresses and do not raise email delivery errors.
|
69
64
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
70
65
|
# config.action_mailer.raise_delivery_errors = false
|
71
66
|
|
72
67
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
73
|
-
# the I18n.default_locale when a translation
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
74
69
|
config.i18n.fallbacks = true
|
75
70
|
|
76
71
|
# Send deprecation notices to registered listeners.
|
77
72
|
config.active_support.deprecation = :notify
|
78
73
|
|
79
|
-
# Disable automatic flushing of the log to improve performance.
|
80
|
-
# config.autoflush_log = false
|
81
|
-
|
82
74
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
83
75
|
config.log_formatter = ::Logger::Formatter.new
|
84
76
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
Rails.application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
@@ -12,16 +12,12 @@ Dummy::Application.configure do
|
|
12
12
|
# preloads Rails for running tests, you may have to set it to true.
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
|
-
# Configure static
|
16
|
-
|
17
|
-
|
18
|
-
else
|
19
|
-
config.serve_static_assets = false
|
20
|
-
end
|
21
|
-
config.static_cache_control = "public, max-age=3600"
|
15
|
+
# Configure static file server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_files = true
|
17
|
+
config.static_cache_control = 'public, max-age=3600'
|
22
18
|
|
23
19
|
# Show full error reports and disable caching.
|
24
|
-
config.consider_all_requests_local
|
20
|
+
config.consider_all_requests_local = true
|
25
21
|
config.action_controller.perform_caching = false
|
26
22
|
|
27
23
|
# Raise exceptions instead of rendering exception templates.
|
@@ -35,10 +31,12 @@ Dummy::Application.configure do
|
|
35
31
|
# ActionMailer::Base.deliveries array.
|
36
32
|
config.action_mailer.delivery_method = :test
|
37
33
|
|
34
|
+
# Randomize the order test cases are executed.
|
35
|
+
config.active_support.test_order = :random
|
36
|
+
|
38
37
|
# Print deprecation notices to the stderr.
|
39
38
|
config.active_support.deprecation = :stderr
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
end
|
40
|
+
# Raises error for missing translations
|
41
|
+
# config.action_view.raise_on_missing_translations = true
|
44
42
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Version of your assets, change this if you want to expire all your assets.
|
4
|
+
Rails.application.config.assets.version = '1.0'
|
5
|
+
|
6
|
+
# Add additional assets to the asset load path
|
7
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
+
|
9
|
+
# Precompile additional assets.
|
10
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
11
|
+
# Rails.application.config.assets.precompile += %w( search.js )
|
data/test/dummy/config/routes.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: 2c1c8d4cbaa726b21aa6483b7d556125f4897508e2b94f8b3ddaec675168382c9b3b6eb5a9359d2fade03f539c16ac1ef905891c2410f2fd00b83b76c1666feb
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 9dd531171128e7c3d11dd2c5c18c84ba43d29b677043002634a6f4d58bf2687a283b7b6dc6af741d63c3824f11fa1f858010d7c2509a932023f2ece0d3bfe6cf
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
|
File without changes
|
@@ -0,0 +1,60 @@
|
|
1
|
+
----------------------------
|
2
|
+
GeneratorsTest: test_install
|
3
|
+
----------------------------
|
4
|
+
------------------
|
5
|
+
ViewTest: test_tag
|
6
|
+
------------------
|
7
|
+
----------------------------
|
8
|
+
GeneratorsTest: test_install
|
9
|
+
----------------------------
|
10
|
+
------------------
|
11
|
+
ViewTest: test_tag
|
12
|
+
------------------
|
13
|
+
----------------------------
|
14
|
+
GeneratorsTest: test_install
|
15
|
+
----------------------------
|
16
|
+
------------------
|
17
|
+
ViewTest: test_tag
|
18
|
+
------------------
|
19
|
+
----------------------------
|
20
|
+
GeneratorsTest: test_install
|
21
|
+
----------------------------
|
22
|
+
------------------
|
23
|
+
ViewTest: test_tag
|
24
|
+
------------------
|
25
|
+
----------------------------
|
26
|
+
GeneratorsTest: test_install
|
27
|
+
----------------------------
|
28
|
+
------------------
|
29
|
+
ViewTest: test_tag
|
30
|
+
------------------
|
31
|
+
----------------------------
|
32
|
+
GeneratorsTest: test_install
|
33
|
+
----------------------------
|
34
|
+
------------------
|
35
|
+
ViewTest: test_tag
|
36
|
+
------------------
|
37
|
+
----------------------------
|
38
|
+
GeneratorsTest: test_install
|
39
|
+
----------------------------
|
40
|
+
------------------
|
41
|
+
ViewTest: test_tag
|
42
|
+
------------------
|
43
|
+
----------------------------
|
44
|
+
GeneratorsTest: test_install
|
45
|
+
----------------------------
|
46
|
+
------------------
|
47
|
+
ViewTest: test_tag
|
48
|
+
------------------
|
49
|
+
----------------------------
|
50
|
+
GeneratorsTest: test_install
|
51
|
+
----------------------------
|
52
|
+
------------------
|
53
|
+
ViewTest: test_tag
|
54
|
+
------------------
|
55
|
+
------------------
|
56
|
+
ViewTest: test_tag
|
57
|
+
------------------
|
58
|
+
----------------------------
|
59
|
+
GeneratorsTest: test_install
|
60
|
+
----------------------------
|
data/test/dummy/public/404.html
CHANGED
@@ -1,58 +1,61 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
<head>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
<
|
53
|
-
<
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
</
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
div.dialog {
|
15
|
+
width: 95%;
|
16
|
+
max-width: 33em;
|
17
|
+
margin: 4em auto 0;
|
18
|
+
}
|
19
|
+
div.dialog > div {
|
20
|
+
border: 1px solid #CCC;
|
21
|
+
border-right-color: #999;
|
22
|
+
border-left-color: #999;
|
23
|
+
border-bottom-color: #BBB;
|
24
|
+
border-top: #B00100 solid 4px;
|
25
|
+
border-top-left-radius: 9px;
|
26
|
+
border-top-right-radius: 9px;
|
27
|
+
background-color: white;
|
28
|
+
padding: 7px 12% 0;
|
29
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
30
|
+
}
|
31
|
+
h1 {
|
32
|
+
font-size: 100%;
|
33
|
+
color: #730E15;
|
34
|
+
line-height: 1.5em;
|
35
|
+
}
|
36
|
+
div.dialog > p {
|
37
|
+
margin: 0 0 1em;
|
38
|
+
padding: 1em;
|
39
|
+
background-color: #F7F7F7;
|
40
|
+
border: 1px solid #CCC;
|
41
|
+
border-right-color: #999;
|
42
|
+
border-left-color: #999;
|
43
|
+
border-bottom-color: #999;
|
44
|
+
border-bottom-left-radius: 4px;
|
45
|
+
border-bottom-right-radius: 4px;
|
46
|
+
border-top-color: #DADADA;
|
47
|
+
color: #666;
|
48
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
49
|
+
}
|
50
|
+
</style>
|
51
|
+
</head>
|
52
|
+
<body>
|
53
|
+
<div class="dialog">
|
54
|
+
<div>
|
55
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
56
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
57
|
+
</div>
|
58
|
+
<p>If you are the application owner check the logs for more information.</p>
|
59
|
+
</div>
|
60
|
+
</body>
|
58
61
|
</html>
|
data/test/dummy/public/422.html
CHANGED
@@ -1,58 +1,61 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
<head>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
<
|
53
|
-
<
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
</
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
div.dialog {
|
15
|
+
width: 95%;
|
16
|
+
max-width: 33em;
|
17
|
+
margin: 4em auto 0;
|
18
|
+
}
|
19
|
+
div.dialog > div {
|
20
|
+
border: 1px solid #CCC;
|
21
|
+
border-right-color: #999;
|
22
|
+
border-left-color: #999;
|
23
|
+
border-bottom-color: #BBB;
|
24
|
+
border-top: #B00100 solid 4px;
|
25
|
+
border-top-left-radius: 9px;
|
26
|
+
border-top-right-radius: 9px;
|
27
|
+
background-color: white;
|
28
|
+
padding: 7px 12% 0;
|
29
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
30
|
+
}
|
31
|
+
h1 {
|
32
|
+
font-size: 100%;
|
33
|
+
color: #730E15;
|
34
|
+
line-height: 1.5em;
|
35
|
+
}
|
36
|
+
div.dialog > p {
|
37
|
+
margin: 0 0 1em;
|
38
|
+
padding: 1em;
|
39
|
+
background-color: #F7F7F7;
|
40
|
+
border: 1px solid #CCC;
|
41
|
+
border-right-color: #999;
|
42
|
+
border-left-color: #999;
|
43
|
+
border-bottom-color: #999;
|
44
|
+
border-bottom-left-radius: 4px;
|
45
|
+
border-bottom-right-radius: 4px;
|
46
|
+
border-top-color: #DADADA;
|
47
|
+
color: #666;
|
48
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
49
|
+
}
|
50
|
+
</style>
|
51
|
+
</head>
|
52
|
+
<body>
|
53
|
+
<div class="dialog">
|
54
|
+
<div>
|
55
|
+
<h1>The change you wanted was rejected.</h1>
|
56
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
57
|
+
</div>
|
58
|
+
<p>If you are the application owner check the logs for more information.</p>
|
59
|
+
</div>
|
60
|
+
</body>
|
58
61
|
</html>
|