sharing_tags 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +19 -0
- data/.rspec +4 -0
- data/.travis.yml +15 -0
- data/Gemfile +13 -0
- data/Guardfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +112 -0
- data/Rakefile +14 -0
- data/app/assets/fonts/socicon-webfont.eot +0 -0
- data/app/assets/fonts/socicon-webfont.svg +112 -0
- data/app/assets/fonts/socicon-webfont.ttf +0 -0
- data/app/assets/fonts/socicon-webfont.woff +0 -0
- data/app/assets/fonts/socicon-webfont.woff2 +0 -0
- data/app/assets/javascripts/sharing_tags/links.js.coffee +11 -0
- data/app/assets/javascripts/sharing_tags/share.coffee +48 -0
- data/app/views/sharing_tags/_open_graphs.html.slim +21 -0
- data/app/views/sharing_tags/_schema_tags.html.slim +8 -0
- data/app/views/sharing_tags/_twitter_card.html.slim +20 -0
- data/app/views/sharing_tags/meta_tags.html.slim +16 -0
- data/bin/rspec +16 -0
- data/lib/generators/sharing_tags/install/install_generator.rb +18 -0
- data/lib/generators/sharing_tags/install/templates/initializer.rb +18 -0
- data/lib/generators/sharing_tags.rb +18 -0
- data/lib/sharing_tags/action_controller/filters.rb +13 -0
- data/lib/sharing_tags/action_controller/helpers.rb +7 -0
- data/lib/sharing_tags/action_view/helpers.rb +57 -0
- data/lib/sharing_tags/config.rb +33 -0
- data/lib/sharing_tags/configuration.rb +80 -0
- data/lib/sharing_tags/context.rb +96 -0
- data/lib/sharing_tags/engine.rb +6 -0
- data/lib/sharing_tags/network/facebook.rb +14 -0
- data/lib/sharing_tags/network.rb +102 -0
- data/lib/sharing_tags/railtie.rb +29 -0
- data/lib/sharing_tags/version.rb +3 -0
- data/lib/sharing_tags.rb +37 -0
- data/sharing_tags.gemspec +37 -0
- data/spec/controllers/main_controller_spec.rb +105 -0
- data/spec/dummy/.gitignore +16 -0
- data/spec/dummy/Gemfile +40 -0
- data/spec/dummy/Gemfile.lock +125 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/main_controller.rb +25 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/main/index.html.slim +16 -0
- data/spec/dummy/app/views/main/photo.html.slim +1 -0
- data/spec/dummy/app/views/main/profile.html.slim +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +8 -0
- data/spec/dummy/bin/rake +8 -0
- data/spec/dummy/bin/spring +18 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +4 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +38 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/sharing_tags.rb +62 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +61 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/seeds.rb +7 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/lib/tasks/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/vendor/assets/javascripts/.keep +0 -0
- data/spec/dummy/vendor/assets/stylesheets/.keep +0 -0
- data/spec/generators/install_generator_spec.rb +50 -0
- data/spec/helpers/share_link_helper_spec.rb +185 -0
- data/spec/models/configuration_spec.rb +180 -0
- data/spec/models/context_spec.rb +28 -0
- data/spec/models/network_spec.rb +6 -0
- data/spec/models/running_in_context_spec.rb +57 -0
- data/spec/spec_helper.rb +41 -0
- data/spec/support/generator_support.rb +11 -0
- data/spec/views/facebook_meta_tags_erb_spec.rb +60 -0
- data/spec/views/meta_tags_erb_spec.rb +67 -0
- metadata +409 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
RSpec.describe MainController, :type => :controller do
|
2
|
+
render_views
|
3
|
+
|
4
|
+
before do
|
5
|
+
controller.append_view_path 'app/views'
|
6
|
+
|
7
|
+
SharingTags.configure do
|
8
|
+
|
9
|
+
# Activate default social network. Others available are:
|
10
|
+
# :vkontakte,
|
11
|
+
#networks :twitter, :facebook, :google
|
12
|
+
|
13
|
+
share_url_params(utm_source: "some_source", utm_campaign: "some_campaign")
|
14
|
+
|
15
|
+
title "Sharing title for all networks"
|
16
|
+
description "Change me at /path"
|
17
|
+
image { image_url("http://test.host/images/social/default.jpg") }
|
18
|
+
|
19
|
+
facebook do
|
20
|
+
title "Facebook title"
|
21
|
+
end
|
22
|
+
|
23
|
+
google do
|
24
|
+
description "Google description"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
let(:sharing_tags) { controller.view_context.sharing_tags }
|
30
|
+
|
31
|
+
describe "GET index" do
|
32
|
+
before do
|
33
|
+
get :index
|
34
|
+
end
|
35
|
+
|
36
|
+
it "expect render meta_tags" do
|
37
|
+
expect(response.status).to eq(200)
|
38
|
+
expect(response).to render_template(:index)
|
39
|
+
expect(response).to render_template('sharing_tags/meta_tags')
|
40
|
+
end
|
41
|
+
|
42
|
+
it "expect update default data for facebook" do
|
43
|
+
sharing_tags.facebook.tap do |facebook|
|
44
|
+
expect(facebook.title).to eq("Facebook title")
|
45
|
+
expect(facebook.description).to eq("Change me at /path")
|
46
|
+
expect(facebook.image).to eq("http://test.host/images/social/default.jpg")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
it "expect default data for google" do
|
51
|
+
sharing_tags.google.tap do |google|
|
52
|
+
expect(google.title).to eq("Sharing title for all networks")
|
53
|
+
expect(google.description).to eq("Google description")
|
54
|
+
expect(google.image).to eq("http://test.host/images/social/default.jpg")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
it "expect default data for twitter" do
|
59
|
+
sharing_tags.twitter.tap do |twitter|
|
60
|
+
expect(twitter.title).to eq("Sharing title for all networks")
|
61
|
+
expect(twitter.description).to eq("Change me at /path")
|
62
|
+
expect(twitter.image).to eq("http://test.host/images/social/default.jpg")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
#
|
68
|
+
# describe "GET photo" do
|
69
|
+
# it "expect render meta_tags" do
|
70
|
+
# get :photo
|
71
|
+
# expect(response.status).to eq(200)
|
72
|
+
# expect(response).to render_template(:photo)
|
73
|
+
# expect(response).to render_template('sharing_tags/meta_tags')
|
74
|
+
#
|
75
|
+
# sharing_tags.facebook.tap do |facebook|
|
76
|
+
# expect(facebook.title).to eq("Facebook title")
|
77
|
+
# end
|
78
|
+
# end
|
79
|
+
# end
|
80
|
+
#
|
81
|
+
# describe "GET photo" do
|
82
|
+
# it "expect render meta_tags" do
|
83
|
+
# get :profile
|
84
|
+
# expect(response.status).to eq(200)
|
85
|
+
# expect(response).to render_template(:profile)
|
86
|
+
# expect(response).to render_template('sharing_tags/meta_tags')
|
87
|
+
# end
|
88
|
+
# end
|
89
|
+
|
90
|
+
describe "GET profile with switching context" do
|
91
|
+
before do
|
92
|
+
get :profile
|
93
|
+
end
|
94
|
+
|
95
|
+
it "expect render meta_tags" do
|
96
|
+
expect(response.status).to eq(200)
|
97
|
+
expect(response).to render_template(:profile)
|
98
|
+
expect(response).to render_template('sharing_tags/meta_tags')
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe "Clear current context for each request to default" do
|
103
|
+
pending "clear context to default"
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore the default SQLite database.
|
11
|
+
/db/*.sqlite3
|
12
|
+
/db/*.sqlite3-journal
|
13
|
+
|
14
|
+
# Ignore all logfiles and tempfiles.
|
15
|
+
/log/*.log
|
16
|
+
/tmp
|
data/spec/dummy/Gemfile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
|
4
|
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
5
|
+
gem 'rails', '4.1.4'
|
6
|
+
# Use sqlite3 as the database for Active Record
|
7
|
+
gem 'sqlite3'
|
8
|
+
# Use SCSS for stylesheets
|
9
|
+
gem 'sass-rails', '~> 4.0.3'
|
10
|
+
# Use Uglifier as compressor for JavaScript assets
|
11
|
+
gem 'uglifier', '>= 1.3.0'
|
12
|
+
# Use CoffeeScript for .js.coffee assets and views
|
13
|
+
gem 'coffee-rails', '~> 4.0.0'
|
14
|
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
15
|
+
# gem 'therubyracer', platforms: :ruby
|
16
|
+
|
17
|
+
# Use jquery as the JavaScript library
|
18
|
+
gem 'jquery-rails'
|
19
|
+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
20
|
+
gem 'turbolinks'
|
21
|
+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
22
|
+
gem 'jbuilder', '~> 2.0'
|
23
|
+
# bundle exec rake doc:rails generates the API under doc/api.
|
24
|
+
gem 'sdoc', '~> 0.4.0', group: :doc
|
25
|
+
|
26
|
+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
27
|
+
gem 'spring', group: :development
|
28
|
+
|
29
|
+
# Use ActiveModel has_secure_password
|
30
|
+
# gem 'bcrypt', '~> 3.1.7'
|
31
|
+
|
32
|
+
# Use unicorn as the app server
|
33
|
+
# gem 'unicorn'
|
34
|
+
|
35
|
+
# Use Capistrano for deployment
|
36
|
+
# gem 'capistrano-rails', group: :development
|
37
|
+
|
38
|
+
# Use debugger
|
39
|
+
# gem 'debugger', group: [:development, :test]
|
40
|
+
|
@@ -0,0 +1,125 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (4.1.4)
|
5
|
+
actionpack (= 4.1.4)
|
6
|
+
actionview (= 4.1.4)
|
7
|
+
mail (~> 2.5.4)
|
8
|
+
actionpack (4.1.4)
|
9
|
+
actionview (= 4.1.4)
|
10
|
+
activesupport (= 4.1.4)
|
11
|
+
rack (~> 1.5.2)
|
12
|
+
rack-test (~> 0.6.2)
|
13
|
+
actionview (4.1.4)
|
14
|
+
activesupport (= 4.1.4)
|
15
|
+
builder (~> 3.1)
|
16
|
+
erubis (~> 2.7.0)
|
17
|
+
activemodel (4.1.4)
|
18
|
+
activesupport (= 4.1.4)
|
19
|
+
builder (~> 3.1)
|
20
|
+
activerecord (4.1.4)
|
21
|
+
activemodel (= 4.1.4)
|
22
|
+
activesupport (= 4.1.4)
|
23
|
+
arel (~> 5.0.0)
|
24
|
+
activesupport (4.1.4)
|
25
|
+
i18n (~> 0.6, >= 0.6.9)
|
26
|
+
json (~> 1.7, >= 1.7.7)
|
27
|
+
minitest (~> 5.1)
|
28
|
+
thread_safe (~> 0.1)
|
29
|
+
tzinfo (~> 1.1)
|
30
|
+
arel (5.0.1.20140414130214)
|
31
|
+
builder (3.2.2)
|
32
|
+
coffee-rails (4.0.1)
|
33
|
+
coffee-script (>= 2.2.0)
|
34
|
+
railties (>= 4.0.0, < 5.0)
|
35
|
+
coffee-script (2.3.0)
|
36
|
+
coffee-script-source
|
37
|
+
execjs
|
38
|
+
coffee-script-source (1.8.0)
|
39
|
+
erubis (2.7.0)
|
40
|
+
execjs (2.2.2)
|
41
|
+
hike (1.2.3)
|
42
|
+
i18n (0.6.11)
|
43
|
+
jbuilder (2.2.4)
|
44
|
+
activesupport (>= 3.0.0, < 5)
|
45
|
+
multi_json (~> 1.2)
|
46
|
+
jquery-rails (3.1.2)
|
47
|
+
railties (>= 3.0, < 5.0)
|
48
|
+
thor (>= 0.14, < 2.0)
|
49
|
+
json (1.8.1)
|
50
|
+
mail (2.5.4)
|
51
|
+
mime-types (~> 1.16)
|
52
|
+
treetop (~> 1.4.8)
|
53
|
+
mime-types (1.25.1)
|
54
|
+
minitest (5.4.2)
|
55
|
+
multi_json (1.10.1)
|
56
|
+
polyglot (0.3.5)
|
57
|
+
rack (1.5.2)
|
58
|
+
rack-test (0.6.2)
|
59
|
+
rack (>= 1.0)
|
60
|
+
rails (4.1.4)
|
61
|
+
actionmailer (= 4.1.4)
|
62
|
+
actionpack (= 4.1.4)
|
63
|
+
actionview (= 4.1.4)
|
64
|
+
activemodel (= 4.1.4)
|
65
|
+
activerecord (= 4.1.4)
|
66
|
+
activesupport (= 4.1.4)
|
67
|
+
bundler (>= 1.3.0, < 2.0)
|
68
|
+
railties (= 4.1.4)
|
69
|
+
sprockets-rails (~> 2.0)
|
70
|
+
railties (4.1.4)
|
71
|
+
actionpack (= 4.1.4)
|
72
|
+
activesupport (= 4.1.4)
|
73
|
+
rake (>= 0.8.7)
|
74
|
+
thor (>= 0.18.1, < 2.0)
|
75
|
+
rake (10.3.2)
|
76
|
+
rdoc (4.1.2)
|
77
|
+
json (~> 1.4)
|
78
|
+
sass (3.2.19)
|
79
|
+
sass-rails (4.0.3)
|
80
|
+
railties (>= 4.0.0, < 5.0)
|
81
|
+
sass (~> 3.2.0)
|
82
|
+
sprockets (~> 2.8, <= 2.11.0)
|
83
|
+
sprockets-rails (~> 2.0)
|
84
|
+
sdoc (0.4.1)
|
85
|
+
json (~> 1.7, >= 1.7.7)
|
86
|
+
rdoc (~> 4.0)
|
87
|
+
spring (1.1.3)
|
88
|
+
sprockets (2.11.0)
|
89
|
+
hike (~> 1.2)
|
90
|
+
multi_json (~> 1.0)
|
91
|
+
rack (~> 1.0)
|
92
|
+
tilt (~> 1.1, != 1.3.0)
|
93
|
+
sprockets-rails (2.2.0)
|
94
|
+
actionpack (>= 3.0)
|
95
|
+
activesupport (>= 3.0)
|
96
|
+
sprockets (>= 2.8, < 4.0)
|
97
|
+
sqlite3 (1.3.9)
|
98
|
+
thor (0.19.1)
|
99
|
+
thread_safe (0.3.4)
|
100
|
+
tilt (1.4.1)
|
101
|
+
treetop (1.4.15)
|
102
|
+
polyglot
|
103
|
+
polyglot (>= 0.3.1)
|
104
|
+
turbolinks (2.4.0)
|
105
|
+
coffee-rails
|
106
|
+
tzinfo (1.2.2)
|
107
|
+
thread_safe (~> 0.1)
|
108
|
+
uglifier (2.5.3)
|
109
|
+
execjs (>= 0.3.0)
|
110
|
+
json (>= 1.8.0)
|
111
|
+
|
112
|
+
PLATFORMS
|
113
|
+
ruby
|
114
|
+
|
115
|
+
DEPENDENCIES
|
116
|
+
coffee-rails (~> 4.0.0)
|
117
|
+
jbuilder (~> 2.0)
|
118
|
+
jquery-rails
|
119
|
+
rails (= 4.1.4)
|
120
|
+
sass-rails (~> 4.0.3)
|
121
|
+
sdoc (~> 0.4.0)
|
122
|
+
spring
|
123
|
+
sqlite3
|
124
|
+
turbolinks
|
125
|
+
uglifier (>= 1.3.0)
|
@@ -0,0 +1,28 @@
|
|
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>.
|
data/spec/dummy/Rakefile
ADDED
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class MainController < ApplicationController
|
2
|
+
|
3
|
+
def index
|
4
|
+
end
|
5
|
+
|
6
|
+
def photo
|
7
|
+
@photo = ::Hashie::Mash.new(photo: "best_photo")
|
8
|
+
sharing_tags.switch_context_to(:photo, @photo)
|
9
|
+
|
10
|
+
# view_context.sharing_tags.switch_context_to(:gallery, @photo)
|
11
|
+
# sharing_tags(:photo, @photo)
|
12
|
+
|
13
|
+
# sharing_tags.switch_context_to(:photo, p1: @photo, p2: @object2)
|
14
|
+
# sharing_tags.switch_context_to(:photo, @photo )
|
15
|
+
# sharing_tags(:photo, @photo, title: "Default title", facebook: {title: "Facebook Title"}) # ?
|
16
|
+
# render sharing_tags.to_s # render meta tags
|
17
|
+
end
|
18
|
+
|
19
|
+
def profile
|
20
|
+
@user = ::Hashie::Mash.new(birthday: Date.parse("1969-12-28"), name: "Linus")
|
21
|
+
sharing_tags.switch_context_to(:profile, @user)
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
6
|
+
<%= javascript_include_tag 'application' %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
<%= render_sharing_tags %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<%= yield %>
|
13
|
+
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
h1 Index Action
|
2
|
+
|
3
|
+
/- sharing_tags.google.tap do |google|
|
4
|
+
/ h2 Google
|
5
|
+
/ table
|
6
|
+
/ tr
|
7
|
+
/ td Title
|
8
|
+
/ td= google.title
|
9
|
+
/ tr
|
10
|
+
/ td Description
|
11
|
+
/ td= google.description
|
12
|
+
/ tr
|
13
|
+
/ td Share url
|
14
|
+
/ td= google.share_url
|
15
|
+
/
|
16
|
+
/== sharing_tags.inspect
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 Photo Action
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 Profile action
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads spring without using Bundler, in order to be fast
|
4
|
+
# It gets overwritten when you run the `spring binstub` command
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require "rubygems"
|
8
|
+
require "bundler"
|
9
|
+
|
10
|
+
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
|
11
|
+
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
|
12
|
+
ENV["GEM_HOME"] = ""
|
13
|
+
Gem.paths = ENV
|
14
|
+
|
15
|
+
gem "spring", match[1]
|
16
|
+
require "spring/binstub"
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
|
9
|
+
module Dummy
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
16
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
17
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
18
|
+
|
19
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
20
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
21
|
+
# config.i18n.default_locale = :de
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
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
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
|
30
|
+
# Adds additional error checking when serving assets at runtime.
|
31
|
+
# Checks for improperly declared sprockets dependencies.
|
32
|
+
# Raises helpful error messages.
|
33
|
+
config.assets.raise_runtime_errors = true
|
34
|
+
|
35
|
+
# Raises error for missing translations
|
36
|
+
# config.action_view.raise_on_missing_translations = true
|
37
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Compress JavaScripts and CSS.
|
23
|
+
config.assets.js_compressor = :uglifier
|
24
|
+
# config.assets.css_compressor = :sass
|
25
|
+
|
26
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
27
|
+
config.assets.compile = false
|
28
|
+
|
29
|
+
# Generate digests for assets URLs.
|
30
|
+
config.assets.digest = true
|
31
|
+
|
32
|
+
# `config.assets.precompile` has moved to config/initializers/assets.rb
|
33
|
+
|
34
|
+
# Specifies the header that your server uses for sending files.
|
35
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
36
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
37
|
+
|
38
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
39
|
+
# config.force_ssl = true
|
40
|
+
|
41
|
+
# Set to :debug to see everything in the log.
|
42
|
+
config.log_level = :info
|
43
|
+
|
44
|
+
# Prepend all log lines with the following tags.
|
45
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
46
|
+
|
47
|
+
# Use a different logger for distributed setups.
|
48
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
49
|
+
|
50
|
+
# Use a different cache store in production.
|
51
|
+
# config.cache_store = :mem_cache_store
|
52
|
+
|
53
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
54
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
55
|
+
|
56
|
+
# Precompile additional assets.
|
57
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
58
|
+
# config.assets.precompile += %w( search.js )
|
59
|
+
|
60
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
61
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
62
|
+
# config.action_mailer.raise_delivery_errors = false
|
63
|
+
|
64
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
65
|
+
# the I18n.default_locale when a translation cannot be found).
|
66
|
+
config.i18n.fallbacks = true
|
67
|
+
|
68
|
+
# Send deprecation notices to registered listeners.
|
69
|
+
config.active_support.deprecation = :notify
|
70
|
+
|
71
|
+
# Disable automatic flushing of the log to improve performance.
|
72
|
+
# config.autoflush_log = false
|
73
|
+
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
|
77
|
+
# Do not dump schema after migrations.
|
78
|
+
config.active_record.dump_schema_after_migration = false
|
79
|
+
end
|