ads-rails 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/lib/ads/rails/action_view/base.rb +6 -8
- data/lib/ads/rails/version.rb +1 -1
- data/test/dummy/log/test.log +13 -0
- data/test/include_tag_test.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6d0f1ea9b9cf2d98de998c96c7bc067ede2a5eb
|
4
|
+
data.tar.gz: bd3590f80b3df8bc83dea55648e4ad5a385214ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51c79f5d902a01fe0e7beed9338e9ea7a2c351f3068c425f1218f9917858023059941dbb458420138556a098f942bd420fb7927d833260e29f7218350a772b32
|
7
|
+
data.tar.gz: a136d30c1b8cf4db5c8f1cd90f61a39163a685ea9f7f092b9bbfed58f96c689ddc4b942342ee9b50490f8dac53fa7ccf1e8d4b10166fbb750f78c11e79d60ca1
|
data/README.rdoc
CHANGED
@@ -17,7 +17,7 @@ Then bundle:
|
|
17
17
|
In your view add a line like this wherever you like:
|
18
18
|
<%= google_adsense_include_tag client: 'client', slot: 'slot', width: 'width', height: 'height' %>
|
19
19
|
|
20
|
-
(Will only show the include tag in production
|
20
|
+
(Will only show the include tag in production unless renderer has been set)
|
21
21
|
|
22
22
|
= Configuration
|
23
23
|
|
@@ -5,7 +5,9 @@ module Ads
|
|
5
5
|
|
6
6
|
def google_adsense_include_tag(*args)
|
7
7
|
options = args.extract_options!
|
8
|
-
if
|
8
|
+
if ::Rails.application.config.ads.renderer.is_a? Proc
|
9
|
+
instance_exec(options, &::Rails.application.config.ads.renderer)
|
10
|
+
elsif ::Rails.env.production?
|
9
11
|
script = <<-SCRIPT
|
10
12
|
google_ad_client = '#{options[:client]}';
|
11
13
|
google_ad_slot = '#{options[:slot]}';
|
@@ -13,13 +15,9 @@ module Ads
|
|
13
15
|
google_ad_height = #{options[:height]};
|
14
16
|
SCRIPT
|
15
17
|
content_tag(:script, script.html_safe, type: 'text/javascript') +
|
16
|
-
content_tag(:script, nil, type: 'text/javascript', src:
|
17
|
-
|
18
|
-
|
19
|
-
instance_exec(options, &::Rails.application.config.ads.renderer)
|
20
|
-
else
|
21
|
-
content_tag(:div, nil, style: "width:#{options[:width]}px;height:#{options[:height]}px;background:#c8c8c8;")
|
22
|
-
end
|
18
|
+
content_tag(:script, nil, type: 'text/javascript', src: "#{request.protocol}pagead2.googlesyndication.com/pagead/show_ads.js")
|
19
|
+
else
|
20
|
+
content_tag(:div, nil, style: "width:#{options[:width]}px;height:#{options[:height]}px;background:#c8c8c8;")
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
data/lib/ads/rails/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -20,3 +20,16 @@ Processing by PagesController#index as HTML
|
|
20
20
|
Rendered pages/index.html.erb within layouts/application (1.1ms)
|
21
21
|
Completed 200 OK in 86ms (Views: 85.9ms | ActiveRecord: 0.0ms)
|
22
22
|
[1m[35m (0.1ms)[0m rollback transaction
|
23
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
24
|
+
[1m[35m (0.2ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
25
|
+
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
26
|
+
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
27
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
28
|
+
--------------------------------------------
|
29
|
+
IncludeTagTest: test_should_show_include_tag
|
30
|
+
--------------------------------------------
|
31
|
+
Started GET "/" for 127.0.0.1 at 2013-10-21 08:58:45 -0200
|
32
|
+
Processing by PagesController#index as HTML
|
33
|
+
Rendered pages/index.html.erb within layouts/application (21.1ms)
|
34
|
+
Completed 200 OK in 66ms (Views: 65.3ms | ActiveRecord: 0.0ms)
|
35
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
data/test/include_tag_test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ads-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattways
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|