ads-rails 0.0.1 → 0.0.2
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.
- data/README.rdoc +3 -1
- data/lib/ads/rails.rb +2 -1
- data/lib/ads/rails/action_view/base.rb +23 -0
- data/lib/ads/rails/railtie.rb +2 -2
- data/lib/ads/rails/version.rb +1 -1
- data/test/ads_rails_test.rb +1 -1
- data/test/dummy/log/development.log +189 -0
- data/test/dummy/log/test.log +6 -0
- metadata +5 -3
- data/lib/ads/rails/helpers.rb +0 -21
data/README.rdoc
CHANGED
@@ -15,4 +15,6 @@ Then bundle:
|
|
15
15
|
= Usage
|
16
16
|
|
17
17
|
In your layout add a line like this in your head:
|
18
|
-
= google_adsense_include_tag :client => 'client', :slot => 'slot', :width => 'width', :height => 'height'
|
18
|
+
= google_adsense_include_tag :client => 'client', :slot => 'slot', :width => 'width', :height => 'height'
|
19
|
+
|
20
|
+
(Will only show the include tag in production env)
|
data/lib/ads/rails.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Ads
|
2
|
+
module Rails
|
3
|
+
module ActionView
|
4
|
+
module Base
|
5
|
+
|
6
|
+
def google_adsense_include_tag(*args)
|
7
|
+
if ::Rails.env.production?
|
8
|
+
options = args.extract_options!
|
9
|
+
script = <<-SCRIPT.strip_heredoc
|
10
|
+
google_ad_client = '#{options[:client]}';
|
11
|
+
google_ad_slot = '#{options[:slot]}';
|
12
|
+
google_ad_width = #{options[:width]};
|
13
|
+
google_ad_height = #{options[:height]};
|
14
|
+
SCRIPT
|
15
|
+
content_tag(:script, "\n#{script}".html_safe, :type => 'text/javascript') +"\n"+
|
16
|
+
content_tag(:script, nil, :type => 'text/javascript', :src => 'http://pagead2.googlesyndication.com/pagead/show_ads.js')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/ads/rails/railtie.rb
CHANGED
data/lib/ads/rails/version.rb
CHANGED
data/test/ads_rails_test.rb
CHANGED
@@ -863,3 +863,192 @@ Served asset /jquery_ujs.js - 304 Not Modified (2ms)
|
|
863
863
|
|
864
864
|
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-03 16:15:55 -0300
|
865
865
|
Served asset /application.js - 304 Not Modified (7ms)
|
866
|
+
Connecting to database specified by database.yml
|
867
|
+
|
868
|
+
|
869
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:34:41 -0300
|
870
|
+
Processing by StaticsController#home as HTML
|
871
|
+
Rendered statics/home.html.erb within layouts/application (3.1ms)
|
872
|
+
Completed 200 OK in 86ms (Views: 85.1ms | ActiveRecord: 0.0ms)
|
873
|
+
|
874
|
+
|
875
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-17 18:34:41 -0300
|
876
|
+
Served asset /application.css - 200 OK (2ms)
|
877
|
+
|
878
|
+
|
879
|
+
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-04-17 18:34:41 -0300
|
880
|
+
Served asset /jquery.js - 200 OK (6ms)
|
881
|
+
|
882
|
+
|
883
|
+
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-17 18:34:41 -0300
|
884
|
+
Served asset /jquery_ujs.js - 200 OK (2ms)
|
885
|
+
|
886
|
+
|
887
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-17 18:34:41 -0300
|
888
|
+
Served asset /application.js - 200 OK (6ms)
|
889
|
+
|
890
|
+
|
891
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:35:23 -0300
|
892
|
+
Processing by StaticsController#home as HTML
|
893
|
+
Rendered statics/home.html.erb within layouts/application (0.1ms)
|
894
|
+
Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)
|
895
|
+
|
896
|
+
|
897
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-17 18:35:23 -0300
|
898
|
+
Served asset /application.css - 304 Not Modified (0ms)
|
899
|
+
|
900
|
+
|
901
|
+
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-04-17 18:35:23 -0300
|
902
|
+
Served asset /jquery.js - 304 Not Modified (0ms)
|
903
|
+
|
904
|
+
|
905
|
+
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-17 18:35:23 -0300
|
906
|
+
Served asset /jquery_ujs.js - 304 Not Modified (0ms)
|
907
|
+
|
908
|
+
|
909
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-17 18:35:23 -0300
|
910
|
+
Served asset /application.js - 304 Not Modified (0ms)
|
911
|
+
Connecting to database specified by database.yml
|
912
|
+
|
913
|
+
|
914
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:35:39 -0300
|
915
|
+
Processing by StaticsController#home as HTML
|
916
|
+
Rendered statics/home.html.erb within layouts/application (3.2ms)
|
917
|
+
Completed 200 OK in 53ms (Views: 52.6ms | ActiveRecord: 0.0ms)
|
918
|
+
|
919
|
+
|
920
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:36:09 -0300
|
921
|
+
Processing by StaticsController#home as HTML
|
922
|
+
Rendered statics/home.html.erb within layouts/application (0.2ms)
|
923
|
+
Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)
|
924
|
+
|
925
|
+
|
926
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:36:12 -0300
|
927
|
+
Processing by StaticsController#home as HTML
|
928
|
+
Rendered statics/home.html.erb within layouts/application (0.2ms)
|
929
|
+
Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms)
|
930
|
+
Connecting to database specified by database.yml
|
931
|
+
|
932
|
+
|
933
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:36:24 -0300
|
934
|
+
Processing by StaticsController#home as HTML
|
935
|
+
Rendered statics/home.html.erb within layouts/application (20.1ms)
|
936
|
+
Completed 500 Internal Server Error in 33ms
|
937
|
+
|
938
|
+
ActionView::Template::Error (undefined method `indent' for #<String:0x007fd38d506398>):
|
939
|
+
1: <%= google_adsense_include_tag :client => 'client', :slot => 'slot', :width => 'width', :height => 'height' %>
|
940
|
+
app/views/statics/home.html.erb:1:in `_app_views_statics_home_html_erb__3523656761263041212_70273292602900'
|
941
|
+
|
942
|
+
|
943
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (3.1ms)
|
944
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.7ms)
|
945
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (18.7ms)
|
946
|
+
|
947
|
+
|
948
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:37:21 -0300
|
949
|
+
Processing by StaticsController#home as HTML
|
950
|
+
Rendered statics/home.html.erb within layouts/application (0.9ms)
|
951
|
+
Completed 500 Internal Server Error in 3ms
|
952
|
+
|
953
|
+
ActionView::Template::Error (undefined method `indent' for #<String:0x007fd38a883bb8>):
|
954
|
+
1: <%= google_adsense_include_tag :client => 'client', :slot => 'slot', :width => 'width', :height => 'height' %>
|
955
|
+
app/views/statics/home.html.erb:1:in `_app_views_statics_home_html_erb__3523656761263041212_70273292602900'
|
956
|
+
|
957
|
+
|
958
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.3ms)
|
959
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.4ms)
|
960
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (11.6ms)
|
961
|
+
Connecting to database specified by database.yml
|
962
|
+
|
963
|
+
|
964
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:37:37 -0300
|
965
|
+
Processing by StaticsController#home as HTML
|
966
|
+
Rendered statics/home.html.erb within layouts/application (8.8ms)
|
967
|
+
Completed 500 Internal Server Error in 22ms
|
968
|
+
|
969
|
+
ActionView::Template::Error (undefined method `indent' for #<String:0x007ff8ce78f248>):
|
970
|
+
1: <%= google_adsense_include_tag :client => 'client', :slot => 'slot', :width => 'width', :height => 'height' %>
|
971
|
+
app/views/statics/home.html.erb:1:in `_app_views_statics_home_html_erb___4345885114792958661_70353294670920'
|
972
|
+
|
973
|
+
|
974
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.2ms)
|
975
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.6ms)
|
976
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (11.8ms)
|
977
|
+
|
978
|
+
|
979
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:37:54 -0300
|
980
|
+
Processing by StaticsController#home as HTML
|
981
|
+
Rendered statics/home.html.erb within layouts/application (0.9ms)
|
982
|
+
Completed 500 Internal Server Error in 3ms
|
983
|
+
|
984
|
+
ActionView::Template::Error (undefined method `indent' for #<String:0x007ff8c9cd27a0>):
|
985
|
+
1: <%= google_adsense_include_tag :client => 'client', :slot => 'slot', :width => 'width', :height => 'height' %>
|
986
|
+
app/views/statics/home.html.erb:1:in `_app_views_statics_home_html_erb___4345885114792958661_70353294670920'
|
987
|
+
|
988
|
+
|
989
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.2ms)
|
990
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.5ms)
|
991
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (12.1ms)
|
992
|
+
Connecting to database specified by database.yml
|
993
|
+
|
994
|
+
|
995
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:39:30 -0300
|
996
|
+
Processing by StaticsController#home as HTML
|
997
|
+
Rendered statics/home.html.erb within layouts/application (8.9ms)
|
998
|
+
Completed 500 Internal Server Error in 22ms
|
999
|
+
|
1000
|
+
ActionView::Template::Error (undefined method `indent' for #<String:0x007fa6dd0ed540>):
|
1001
|
+
1: <%= google_adsense_include_tag :client => 'client', :slot => 'slot', :width => 'width', :height => 'height' %>
|
1002
|
+
app/views/statics/home.html.erb:1:in `_app_views_statics_home_html_erb___3331059223424000021_70177328274200'
|
1003
|
+
|
1004
|
+
|
1005
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.3ms)
|
1006
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.6ms)
|
1007
|
+
Rendered /Users/Matt/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (12.0ms)
|
1008
|
+
Connecting to database specified by database.yml
|
1009
|
+
|
1010
|
+
|
1011
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:41:52 -0300
|
1012
|
+
Processing by StaticsController#home as HTML
|
1013
|
+
Rendered statics/home.html.erb within layouts/application (3.2ms)
|
1014
|
+
Completed 200 OK in 32ms (Views: 31.3ms | ActiveRecord: 0.0ms)
|
1015
|
+
Connecting to database specified by database.yml
|
1016
|
+
|
1017
|
+
|
1018
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:42:25 -0300
|
1019
|
+
Processing by StaticsController#home as HTML
|
1020
|
+
Rendered statics/home.html.erb within layouts/application (3.4ms)
|
1021
|
+
Completed 200 OK in 33ms (Views: 32.8ms | ActiveRecord: 0.0ms)
|
1022
|
+
Connecting to database specified by database.yml
|
1023
|
+
|
1024
|
+
|
1025
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:44:42 -0300
|
1026
|
+
Processing by StaticsController#home as HTML
|
1027
|
+
Rendered statics/home.html.erb within layouts/application (3.2ms)
|
1028
|
+
Completed 200 OK in 32ms (Views: 31.3ms | ActiveRecord: 0.0ms)
|
1029
|
+
Connecting to database specified by database.yml
|
1030
|
+
|
1031
|
+
|
1032
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:45:24 -0300
|
1033
|
+
Processing by StaticsController#home as HTML
|
1034
|
+
Rendered statics/home.html.erb within layouts/application (3.2ms)
|
1035
|
+
Completed 200 OK in 32ms (Views: 31.4ms | ActiveRecord: 0.0ms)
|
1036
|
+
|
1037
|
+
|
1038
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:45:26 -0300
|
1039
|
+
Processing by StaticsController#home as HTML
|
1040
|
+
Rendered statics/home.html.erb within layouts/application (0.3ms)
|
1041
|
+
Completed 200 OK in 5ms (Views: 5.3ms | ActiveRecord: 0.0ms)
|
1042
|
+
|
1043
|
+
|
1044
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:45:50 -0300
|
1045
|
+
Processing by StaticsController#home as HTML
|
1046
|
+
Rendered statics/home.html.erb within layouts/application (0.3ms)
|
1047
|
+
Completed 200 OK in 5ms (Views: 5.2ms | ActiveRecord: 0.0ms)
|
1048
|
+
Connecting to database specified by database.yml
|
1049
|
+
|
1050
|
+
|
1051
|
+
Started GET "/" for 127.0.0.1 at 2013-04-17 18:46:38 -0300
|
1052
|
+
Processing by StaticsController#home as HTML
|
1053
|
+
Rendered statics/home.html.erb within layouts/application (3.3ms)
|
1054
|
+
Completed 200 OK in 32ms (Views: 31.4ms | ActiveRecord: 0.0ms)
|
@@ -0,0 +1,6 @@
|
|
1
|
+
Connecting to database specified by database.yml
|
2
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
3
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4
|
+
Connecting to database specified by database.yml
|
5
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
6
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -50,7 +50,7 @@ executables: []
|
|
50
50
|
extensions: []
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
|
-
- lib/ads/rails/
|
53
|
+
- lib/ads/rails/action_view/base.rb
|
54
54
|
- lib/ads/rails/railtie.rb
|
55
55
|
- lib/ads/rails/version.rb
|
56
56
|
- lib/ads/rails.rb
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- test/dummy/config.ru
|
85
85
|
- test/dummy/db/development.sqlite3
|
86
86
|
- test/dummy/log/development.log
|
87
|
+
- test/dummy/log/test.log
|
87
88
|
- test/dummy/public/404.html
|
88
89
|
- test/dummy/public/422.html
|
89
90
|
- test/dummy/public/500.html
|
@@ -153,6 +154,7 @@ test_files:
|
|
153
154
|
- test/dummy/config.ru
|
154
155
|
- test/dummy/db/development.sqlite3
|
155
156
|
- test/dummy/log/development.log
|
157
|
+
- test/dummy/log/test.log
|
156
158
|
- test/dummy/public/404.html
|
157
159
|
- test/dummy/public/422.html
|
158
160
|
- test/dummy/public/500.html
|
data/lib/ads/rails/helpers.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
module Ads
|
2
|
-
module Rails
|
3
|
-
module Helpers
|
4
|
-
|
5
|
-
def google_adsense_include_tag(*args)
|
6
|
-
if ::Rails.env.production?
|
7
|
-
options = args.extract_options!
|
8
|
-
script = <<-SCRIPT
|
9
|
-
google_ad_client = '#{options[:client]}';
|
10
|
-
google_ad_slot = '#{options[:slot]}';
|
11
|
-
google_ad_width = #{options[:width]};
|
12
|
-
google_ad_height = #{options[:height]};
|
13
|
-
SCRIPT
|
14
|
-
content_tag(:script, script.html_safe, :type => 'text/javascript') +
|
15
|
-
content_tag(:script, nil, :type => 'text/javascript', :src => 'http://pagead2.googlesyndication.com/pagead/show_ads.js')
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|