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
data/test/dummy/README.rdoc
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
== README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
25
|
-
|
26
|
-
|
27
|
-
Please feel free to use a different markup language if you do not plan to run
|
28
|
-
<tt>rake doc:app</tt>.
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# SQLite version 3.x
|
2
|
-
# gem install sqlite3
|
3
|
-
#
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
-
# gem 'sqlite3'
|
6
|
-
development:
|
7
|
-
adapter: sqlite3
|
8
|
-
database: db/development.sqlite3
|
9
|
-
pool: 5
|
10
|
-
timeout: 5000
|
11
|
-
|
12
|
-
# Warning: The database defined as "test" will be erased and
|
13
|
-
# re-generated from your development database when you run "rake".
|
14
|
-
# Do not set this db to the same as development or production.
|
15
|
-
test:
|
16
|
-
adapter: sqlite3
|
17
|
-
database: ":memory:"
|
18
|
-
pool: 5
|
19
|
-
timeout: 5000
|
20
|
-
|
21
|
-
production:
|
22
|
-
adapter: sqlite3
|
23
|
-
database: db/production.sqlite3
|
24
|
-
pool: 5
|
25
|
-
timeout: 5000
|
@@ -1,13 +0,0 @@
|
|
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 your secret_key_base is kept private
|
11
|
-
# if you're sharing your code publicly.
|
12
|
-
Dummy::Application.config.secret_token = '3761e5818ce76ffc66003c18a54f10ea508328bda385c5de7987bdd89e1bb990ba0545c71a3015102055064b9a6ed06d46424758b3bb60ff243eaea584a5657f'
|
13
|
-
Dummy::Application.config.secret_key_base = '3761e5818ce76ffc66003c18a54f10ea508328bda385c5de7987bdd89e1bb990ba0545c71a3015102055064b9a6ed06d46424758b3bb60ff243eaea584a5657f'
|
data/test/dummy/db/schema.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# This file is auto-generated from the current state of the database. Instead
|
3
|
-
# of editing this file, please use the migrations feature of Active Record to
|
4
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
-
#
|
6
|
-
# Note that this schema.rb definition is the authoritative source for your
|
7
|
-
# database schema. If you need to create the application database on another
|
8
|
-
# system, you should be using db:schema:load, not running all the migrations
|
9
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
-
#
|
12
|
-
# It's strongly recommended that you check this file into your version control system.
|
13
|
-
|
14
|
-
ActiveRecord::Schema.define(version: 0) do
|
15
|
-
|
16
|
-
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/include_tag_test.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class IncludeTagTest < ActionView::TestCase
|
4
|
-
|
5
|
-
setup do
|
6
|
-
self.request = OpenStruct.new(protocol: 'http://')
|
7
|
-
end
|
8
|
-
|
9
|
-
test 'adsense code' do
|
10
|
-
Ads.config.renderer = nil
|
11
|
-
with_env 'production' do
|
12
|
-
tag = google_adsense_include_tag(client: 'pub-1234', width: 728)
|
13
|
-
assert tag.include?("google_ad_client = 'pub-1234';\ngoogle_ad_width = 728;")
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
test 'renderer' do
|
18
|
-
Ads.config.renderer = lambda { |options|
|
19
|
-
tag(
|
20
|
-
:img,
|
21
|
-
src: "http://placehold.it/#{options[:width]}x#{options[:height]}&text=Adsense"
|
22
|
-
)
|
23
|
-
}
|
24
|
-
with_env 'development' do
|
25
|
-
tag = google_adsense_include_tag(width: 728, height:90)
|
26
|
-
assert tag.include?('src="http://placehold.it/728x90&text=Adsense"')
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
test 'gray div' do
|
31
|
-
Ads.config.renderer = nil
|
32
|
-
with_env 'development' do
|
33
|
-
tag = google_adsense_include_tag(width: 728, height:90)
|
34
|
-
assert tag.include?('style="width:728px;height:90px;background:#c8c8c8;"')
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
private
|
39
|
-
|
40
|
-
def with_env(value)
|
41
|
-
old_env = Rails.env
|
42
|
-
Rails.env = value
|
43
|
-
yield
|
44
|
-
Rails.env = old_env
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|