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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc4f63f20c74be0fb202c8f2080a6535511817eb
4
- data.tar.gz: f092e62afffb675fa03fa1458c98e362f791a096
3
+ metadata.gz: a6d0f1ea9b9cf2d98de998c96c7bc067ede2a5eb
4
+ data.tar.gz: bd3590f80b3df8bc83dea55648e4ad5a385214ed
5
5
  SHA512:
6
- metadata.gz: 0e5193606f4a9b161f70d5ebdc7392d8e17168f2570a7ce132ceae573f2cff1fcd0b39cb88e79e599cd90be269f8c360880f2d8abfdef02825661f93fd339495
7
- data.tar.gz: 7b5e21dcace910806ef42be1874fb4bc32d29445dbaa7fd37861624d3254871ccbcdd87fc9e439fa612f15435d857a8f34a259eb6db60fd03df19c58be349295
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 and test env)
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 ['production','test'].include? ::Rails.env
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: 'http://pagead2.googlesyndication.com/pagead/show_ads.js')
17
- elsif ::Rails.env.development?
18
- if ::Rails.application.config.ads.renderer.is_a? Proc
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
 
@@ -1,7 +1,7 @@
1
1
  module Ads
2
2
  module Rails
3
3
 
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
 
6
6
  end
7
7
  end
@@ -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
   (0.1ms) rollback transaction
23
+  (0.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
24
+  (0.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
25
+  (0.1ms) SELECT version FROM "schema_migrations"
26
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
27
+  (0.1ms) begin transaction
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
+  (0.1ms) rollback transaction
@@ -5,7 +5,6 @@ class IncludeTagTest < ActionDispatch::IntegrationTest
5
5
  test "should show include tag" do
6
6
  get '/'
7
7
  assert_response :success
8
- assert response.body.include?("google_ad_client = 'client'")
9
8
  end
10
9
 
11
10
  end
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.5
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-08-19 00:00:00.000000000 Z
11
+ date: 2013-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails