copycat 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +1 -1
- data/README.md +53 -0
- data/Rakefile +3 -13
- data/app/assets/stylesheets/copycat/copycat.css +44 -0
- data/app/controllers/copycat_translations_controller.rb +45 -0
- data/app/models/copycat_translation.rb +27 -0
- data/app/views/copycat_translations/edit.html.erb +7 -0
- data/app/views/copycat_translations/index.html.erb +26 -0
- data/app/views/copycat_translations/readme.html.erb +41 -0
- data/app/views/copycat_translations/upload.html.erb +18 -0
- data/config/routes.rb +7 -0
- data/db/migrate/20120313191745_create_copycat_translations.rb +13 -0
- data/lib/copycat/engine.rb +4 -0
- data/lib/copycat/version.rb +1 -1
- data/lib/copycat.rb +91 -0
- data/{test → spec}/dummy/Rakefile +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/assets/stylesheets/copycat.css +44 -0
- data/{test → spec}/dummy/app/controllers/application_controller.rb +0 -0
- data/spec/dummy/app/controllers/site_controller.rb +5 -0
- data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +12 -0
- data/spec/dummy/app/views/site/index.html.erb +3 -0
- data/{test → spec}/dummy/config/application.rb +0 -11
- data/{test → spec}/dummy/config/boot.rb +0 -0
- data/{test → spec}/dummy/config/database.yml +0 -0
- data/{test → spec}/dummy/config/environment.rb +0 -0
- data/{test → spec}/dummy/config/environments/development.rb +1 -8
- data/{test → spec}/dummy/config/environments/production.rb +1 -8
- data/{test → spec}/dummy/config/environments/test.rb +6 -4
- data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/{test → spec}/dummy/config/initializers/inflections.rb +0 -5
- data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
- data/{test → spec}/dummy/config/initializers/secret_token.rb +1 -1
- data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
- data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +0 -0
- data/{test → spec}/dummy/config/locales/en.yml +3 -1
- data/spec/dummy/config/routes.rb +3 -0
- data/{test → spec}/dummy/config.ru +0 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20120313192639_create_copycat_translations.copycat_engine.rb +14 -0
- data/spec/dummy/db/schema.rb +23 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +113 -0
- data/spec/dummy/log/test.log +5715 -0
- data/{test → spec}/dummy/public/404.html +0 -0
- data/{test → spec}/dummy/public/422.html +0 -0
- data/{test → spec}/dummy/public/500.html +1 -0
- data/{test → spec}/dummy/public/favicon.ico +0 -0
- data/{test → spec}/dummy/script/rails +0 -0
- data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/D1A/DB0/sprockets%2F26d700197b8d25f954d56d8f31f2c8bc +0 -0
- data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/DDD/780/sprockets%2Fe7880b84c3ecb507fabc99b9ef6b70e3 +0 -0
- data/spec/factories/copycat_translations.rb +11 -0
- data/spec/integration/copycat_spec.rb +83 -0
- data/spec/lib/copycat_spec.rb +61 -0
- data/spec/models/copycat_translation_spec.rb +64 -0
- data/spec/spec_helper.rb +11 -0
- metadata +115 -89
- data/README.rdoc +0 -3
- data/test/copycat_test.rb +0 -7
- data/test/dummy/README.rdoc +0 -261
- data/test/dummy/app/assets/javascripts/application.js +0 -15
- data/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/config/routes.rb +0 -58
- data/test/test_helper.rb +0 -10
data/MIT-LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Copycat #
|
2
|
+
|
3
|
+
Copycat is a Rails engine that allows editing live website copy.
|
4
|
+
|
5
|
+
## How to use ##
|
6
|
+
|
7
|
+
Add ```copycat``` to your Gemfile and run bundle.
|
8
|
+
|
9
|
+
Copycat uses a database table to store the copy items, and so it is necessary to create that:
|
10
|
+
|
11
|
+
```
|
12
|
+
rake copycat_engine:install:migrations
|
13
|
+
rake db:migrate
|
14
|
+
```
|
15
|
+
|
16
|
+
In a view, use the Rails i18N.translate() method where you would like to display some editable copy:
|
17
|
+
|
18
|
+
|
19
|
+
```erb
|
20
|
+
<h1><%= t('site.index.header') %></h1>
|
21
|
+
```
|
22
|
+
|
23
|
+
Visit the page in your browser, and a Copycat translation will be created for the key. Then visit '/copycat_translations' in your browser and you can edit the value of that token.
|
24
|
+
|
25
|
+
## Rails i18N API ##
|
26
|
+
|
27
|
+
You can read about the Rails internationalization framework [here](http://guides.rubyonrails.org/i18n.html). Copycat
|
28
|
+
|
29
|
+
## Deploying ##
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
## Developing ##
|
34
|
+
|
35
|
+
As a Rails engine, Copycat is developed using a nested dummy Rails app. After cloning the repository and running bundler, the plugin must be installed in the dummy app:
|
36
|
+
|
37
|
+
```
|
38
|
+
bundle
|
39
|
+
cd spec/dummy
|
40
|
+
rake copycat_engine:install:migrations
|
41
|
+
rake db:create db:migrate db:test:prepare
|
42
|
+
cd ../..
|
43
|
+
```
|
44
|
+
|
45
|
+
Now you can run the test suite:
|
46
|
+
|
47
|
+
```
|
48
|
+
rspec spec/
|
49
|
+
```
|
50
|
+
|
51
|
+
## License ##
|
52
|
+
|
53
|
+
Copycat is released under the MIT license. See MIT-LICENSE file.
|
data/Rakefile
CHANGED
@@ -20,19 +20,9 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
20
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
25
25
|
|
26
26
|
Bundler::GemHelper.install_tasks
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
Rake::TestTask.new(:test) do |t|
|
31
|
-
t.libs << 'lib'
|
32
|
-
t.libs << 'test'
|
33
|
-
t.pattern = 'test/**/*_test.rb'
|
34
|
-
t.verbose = false
|
35
|
-
end
|
36
|
-
|
37
|
-
|
38
|
-
task :default => :test
|
28
|
+
task :default => :spec
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#copycat li, #copycat li h2 {
|
2
|
+
display: inline;
|
3
|
+
padding: 2em;
|
4
|
+
}
|
5
|
+
#copycat table, #copycat div.copycat-alert, #copycat div.copycat-notice, div#readme, div#upload {
|
6
|
+
width: 75%;
|
7
|
+
margin-left: 12.5%;
|
8
|
+
margin-right: 12.5%;
|
9
|
+
}
|
10
|
+
#copycat table, #copycat form, #copycat div.copycat-alert, #copycat div.copycat-notice, div#readme, div#upload {
|
11
|
+
padding-top: 2em;
|
12
|
+
}
|
13
|
+
#copycat table {
|
14
|
+
border-bottom: 1px #CCC dotted;
|
15
|
+
padding-bottom: 1em;
|
16
|
+
}
|
17
|
+
#copycat table th {
|
18
|
+
text-align: left;
|
19
|
+
padding-bottom: 1em;
|
20
|
+
}
|
21
|
+
#copycat table tr td {
|
22
|
+
padding-top: 1em;
|
23
|
+
padding-bottom: 1em;
|
24
|
+
border-top: 1px #CCC dotted;
|
25
|
+
}
|
26
|
+
#copycat table tr td.last {
|
27
|
+
border-bottom: none;
|
28
|
+
}
|
29
|
+
#copycat table tr td.key {
|
30
|
+
width: 20%;
|
31
|
+
margin-right: 5%;
|
32
|
+
}
|
33
|
+
#copycat table tr td.value {
|
34
|
+
width: 75%;
|
35
|
+
}
|
36
|
+
#copycat div.copycat-alert {
|
37
|
+
color: red;
|
38
|
+
font-weight: bold;
|
39
|
+
}
|
40
|
+
#copycat div.copycat-notice {
|
41
|
+
color: green;
|
42
|
+
font-weight: bold;
|
43
|
+
}
|
44
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class CopycatTranslationsController < ApplicationController
|
2
|
+
|
3
|
+
def index
|
4
|
+
@copycat_translations = CopycatTranslation.all
|
5
|
+
respond_to do |format|
|
6
|
+
format.html
|
7
|
+
format.yaml { send_data CopycatTranslation.export_yaml, :filename => "copycat_translations_#{Time.now.strftime("%Y_%m_%d_%H_%M_%S")}.yml" }
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def edit
|
12
|
+
@copycat_translation = CopycatTranslation.find_by_id(params["id"])
|
13
|
+
end
|
14
|
+
|
15
|
+
def update
|
16
|
+
cct = CopycatTranslation.find_by_id(params["id"])
|
17
|
+
cct.value = params["copycat_translation"]["value"]
|
18
|
+
if cct.save
|
19
|
+
#Copycat.clear_cache(params["copycat_translation"]["key"])
|
20
|
+
@copycat_translations = CopycatTranslation.all
|
21
|
+
redirect_to copycat_translations_path
|
22
|
+
else
|
23
|
+
@copycat_translation = cct
|
24
|
+
render :action => 'edit'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def readme
|
29
|
+
end
|
30
|
+
|
31
|
+
def upload
|
32
|
+
end
|
33
|
+
|
34
|
+
def import_yaml
|
35
|
+
begin
|
36
|
+
CopycatTranslation.import_yaml(params["file"].tempfile)
|
37
|
+
rescue StandardError => e
|
38
|
+
flash[:notice] = "There was an error processing your upload!"
|
39
|
+
render :action => 'upload', :status => 400
|
40
|
+
else
|
41
|
+
redirect_to copycat_translations_path, :notice => "YAML file uploaded successfully!"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class CopycatTranslation < ActiveRecord::Base
|
2
|
+
|
3
|
+
validates :key, :value, :presence => true
|
4
|
+
validates :key, :uniqueness => true
|
5
|
+
|
6
|
+
def self.import_yaml(yaml)
|
7
|
+
hash = YAML.load(yaml)
|
8
|
+
hash.each do |locale, data|
|
9
|
+
next unless locale == "en" # not handling non-english languages yet.
|
10
|
+
Copycat.hash_flatten(data).each do |key, value|
|
11
|
+
c = find_or_initialize_by_key(key)
|
12
|
+
c.value = value
|
13
|
+
c.save
|
14
|
+
#Copycat.clear_cache
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.export_yaml
|
20
|
+
yaml_hash = {}
|
21
|
+
all.each do |c|
|
22
|
+
yaml_hash = Copycat.hash_fatten(yaml_hash, c.key.split("."), c.value)
|
23
|
+
end
|
24
|
+
{"en" => yaml_hash}.to_yaml
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div id="copycat">
|
2
|
+
<ul>
|
3
|
+
<li><h2>Copycat</h2></li>
|
4
|
+
<% href = copycat_translations_path + ".yaml" %>
|
5
|
+
<li><a href=<%=href%>>Download</a></li>
|
6
|
+
<li><a href=<%= upload_copycat_translations_path %>>Upload</a></li>
|
7
|
+
<li><a href=<%= readme_copycat_translations_path %>>Readme</a></li>
|
8
|
+
</ul>
|
9
|
+
<div class="copycat-notice"> <%= notice %> </div>
|
10
|
+
<table>
|
11
|
+
<tr>
|
12
|
+
<th> Key </th>
|
13
|
+
<th> Value </th>
|
14
|
+
</tr>
|
15
|
+
<% @copycat_translations.each do |t| %>
|
16
|
+
<tr>
|
17
|
+
<td class="key">
|
18
|
+
<%= link_to t.key, edit_copycat_translation_path(t) %>
|
19
|
+
</td>
|
20
|
+
<td class="value">
|
21
|
+
<%= t.value %>
|
22
|
+
</td>
|
23
|
+
</tr>
|
24
|
+
<% end %>
|
25
|
+
</table>
|
26
|
+
</div>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<div id="copycat">
|
2
|
+
<ul>
|
3
|
+
<li><h2>Copycat</h2></li>
|
4
|
+
<% href = copycat_translations_path %>
|
5
|
+
<li><a href=<%=href%>>Back</a></li>
|
6
|
+
</ul>
|
7
|
+
|
8
|
+
<div id="readme">
|
9
|
+
|
10
|
+
<div class="section">
|
11
|
+
<h2> Copycat </h2>
|
12
|
+
<p>Copycat is a Ruby on Rails engine that allows you to edit live website copy.</p>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="section">
|
16
|
+
<h2> How to use </h2>
|
17
|
+
<p>The values you see here correspond to literal HTML copy text in different parts of the parent website. When you edit them, the text on the website will change. Use ctrl-f or command-f to search for text, then click the left hand side links to edit. </p>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="section">
|
21
|
+
<h2> Complicated stuff </h2>
|
22
|
+
<p> Copycat text is data--not code. By default, Copycat values are stored in your server's database, and not the code base that powers your website.</p>
|
23
|
+
<p> What this means is that you may have to download/upload Copycat data to transfer your copy edits between servers, or to safeguard them between database wipes. </p>
|
24
|
+
<p>Copycat accomplishes this by exporting (and being able to re-import) all of its data in a format called "YAML."</p>
|
25
|
+
<h4> Downloading </h4>
|
26
|
+
<p>You can get a YAML file of all your copy by clicking "Download" on the main Copycat page.</p>
|
27
|
+
<h4> Uploading </h4>
|
28
|
+
<p>You can upload copy to Copycat by clicking "Upload" on the main page and uploading a properly formatted YAML file. Uploading copy won't delete any entries from Copycat, but it may update them or create new ones. Use this feature to mass-update your copy from between servers -- e.g., make changes to copy on a test server, and then when you're satisfied, download the YAML file and upload it to your production site.</p>
|
29
|
+
<p>Downloading your copy as YAML and then immediately re-uploading it will leave your copy unchanged.</p>
|
30
|
+
<h4> Commiting your data to your codebase </h4>
|
31
|
+
<p>If you're pretty happy with your copy and don't expect to need to update it live anymore, or just want a bit more security, you can download your copy as YAML and include it as part of the Ruby on Rails application underneath your main website. You can then remove Copycat from the application entirely, and the website will still run exactly as before--it interfaces with Ruby on Rails's built-in mechanisms in a very unobtrusive way.
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="section">
|
35
|
+
<h2> About </h2>
|
36
|
+
<p>Copycat is a product of <a href="http://www.vermonster.com">Vermonster LLC</a>. Thanks for using!</p>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div id="copycat">
|
2
|
+
<ul>
|
3
|
+
<li><h2>Copycat</h2></li>
|
4
|
+
<% href = copycat_translations_path %>
|
5
|
+
<li><a href=<%=href%>>Back</a></li>
|
6
|
+
</ul>
|
7
|
+
<div id="upload">
|
8
|
+
<p>
|
9
|
+
Upload a YAML (.yml) file following <a href="http://guides.rubyonrails.org/i18n.html">I18n conventions</a>.
|
10
|
+
</p>
|
11
|
+
<%= form_tag 'import_yaml', :multipart => true do -%>
|
12
|
+
<%= file_field_tag "file" %>
|
13
|
+
<%= submit_tag "Upload" %>
|
14
|
+
<% end %>
|
15
|
+
<div class="copycat-alert"> <%= notice %> </div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
data/config/routes.rb
ADDED
data/lib/copycat/version.rb
CHANGED
data/lib/copycat.rb
CHANGED
@@ -1,2 +1,93 @@
|
|
1
|
+
require "copycat/engine"
|
2
|
+
|
3
|
+
=begin
|
4
|
+
from i18n gem, lib/i18n/backend/simple.rb
|
5
|
+
|
6
|
+
# Looks up a translation from the translations hash. Returns nil if
|
7
|
+
# eiher key is nil, or locale, scope or key do not exist as a key in the
|
8
|
+
# nested translations hash. Splits keys or scopes containing dots
|
9
|
+
# into multiple keys, i.e. <tt>currency.format</tt> is regarded the same as
|
10
|
+
# <tt>%w(currency format)</tt>.
|
11
|
+
def lookup(locale, key, scope = [], options = {})
|
12
|
+
init_translations unless initialized?
|
13
|
+
keys = I18n.normalize_keys(locale, key, scope, options[:separator])
|
14
|
+
|
15
|
+
keys.inject(translations) do |result, _key|
|
16
|
+
_key = _key.to_sym
|
17
|
+
return nil unless result.is_a?(Hash) && result.has_key?(_key)
|
18
|
+
result = result[_key]
|
19
|
+
result = resolve(locale, _key, result, options.merge(:scope => nil)) if result.is_a?(Symbol)
|
20
|
+
result
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
=end
|
25
|
+
module CopycatImplementation
|
26
|
+
def lookup(locale, key, scope = [], options = {})
|
27
|
+
cct = CopycatTranslation.find_by_key(key)
|
28
|
+
return cct.value if cct
|
29
|
+
value = super(locale, key, scope = [], options = {}) || key
|
30
|
+
CopycatTranslation.create(key: key, value: value)
|
31
|
+
value
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class I18n::Backend::Simple
|
36
|
+
include CopycatImplementation
|
37
|
+
end
|
38
|
+
|
1
39
|
module Copycat
|
40
|
+
|
41
|
+
# {"foo"=>{"a"=>"1", "b"=>"2"}} ----> {"foo.a"=>1, "foo.b"=>2}
|
42
|
+
def self.hash_flatten(hash)
|
43
|
+
result = {}
|
44
|
+
hash.each do |key, value|
|
45
|
+
if value.is_a? Hash
|
46
|
+
hash_flatten(value).each { |k,v| result["#{key}.#{k}"] = v }
|
47
|
+
else
|
48
|
+
result[key] = value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
result
|
52
|
+
end
|
53
|
+
|
54
|
+
# ({"a"=>{"b"=>{"e"=>"f"}}}, ["a","b","c"], "d") ----> {"a"=>{"b"=>{"c"=>"d", "e"=>"f"}}}
|
55
|
+
def self.hash_fatten(hash, keys, value)
|
56
|
+
if keys.length == 1
|
57
|
+
raise "duplicate key" if hash[keys.first]
|
58
|
+
hash[keys.first] = value
|
59
|
+
else
|
60
|
+
head = keys.first
|
61
|
+
rest = keys[1..-1]
|
62
|
+
hash[head] = hash_fatten(hash[head] || {}, rest, value)
|
63
|
+
end
|
64
|
+
hash
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
=begin
|
69
|
+
def self.cache
|
70
|
+
@cache ||= {}
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.t(key)
|
74
|
+
if cache[key]
|
75
|
+
cache[key].html_safe
|
76
|
+
else
|
77
|
+
copybar = CopycatTranslation.where("key = '#{key}'").limit(1).first
|
78
|
+
copybar = CopycatTranslation.create!(:key => key, :value => "Missing copy for #{key}") unless copybar
|
79
|
+
cache[key] = copybar.value
|
80
|
+
copybar.value.html_safe
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.clear_cache(key=nil)
|
85
|
+
if key
|
86
|
+
cache[key] = nil
|
87
|
+
else
|
88
|
+
@cache = {}
|
89
|
+
end
|
90
|
+
end
|
91
|
+
=end
|
92
|
+
|
2
93
|
end
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#copycat li, #copycat li h2 {
|
2
|
+
display: inline;
|
3
|
+
padding: 2em;
|
4
|
+
}
|
5
|
+
#copycat table, #copycat div.copycat-alert, #copycat div.copycat-notice, div#readme, div#upload {
|
6
|
+
width: 75%;
|
7
|
+
margin-left: 12.5%;
|
8
|
+
margin-right: 12.5%;
|
9
|
+
}
|
10
|
+
#copycat table, #copycat form, #copycat div.copycat-alert, #copycat div.copycat-notice, div#readme, div#upload {
|
11
|
+
padding-top: 2em;
|
12
|
+
}
|
13
|
+
#copycat table {
|
14
|
+
border-bottom: 1px #CCC dotted;
|
15
|
+
padding-bottom: 1em;
|
16
|
+
}
|
17
|
+
#copycat table th {
|
18
|
+
text-align: left;
|
19
|
+
padding-bottom: 1em;
|
20
|
+
}
|
21
|
+
#copycat table tr td {
|
22
|
+
padding-top: 1em;
|
23
|
+
padding-bottom: 1em;
|
24
|
+
border-top: 1px #CCC dotted;
|
25
|
+
}
|
26
|
+
#copycat table tr td.last {
|
27
|
+
border-bottom: none;
|
28
|
+
}
|
29
|
+
#copycat table tr td.key {
|
30
|
+
width: 20%;
|
31
|
+
margin-right: 5%;
|
32
|
+
}
|
33
|
+
#copycat table tr td.value {
|
34
|
+
width: 75%;
|
35
|
+
}
|
36
|
+
#copycat div.copycat-alert {
|
37
|
+
color: red;
|
38
|
+
font-weight: bold;
|
39
|
+
}
|
40
|
+
#copycat div.copycat-notice {
|
41
|
+
color: green;
|
42
|
+
font-weight: bold;
|
43
|
+
}
|
44
|
+
|
File without changes
|
File without changes
|
@@ -35,17 +35,6 @@ module Dummy
|
|
35
35
|
# Configure sensitive parameters which will be filtered from the log file.
|
36
36
|
config.filter_parameters += [:password]
|
37
37
|
|
38
|
-
# Use SQL instead of Active Record's schema dumper when creating the database.
|
39
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
40
|
-
# like if you have constraints or database-specific column types
|
41
|
-
# config.active_record.schema_format = :sql
|
42
|
-
|
43
|
-
# Enforce whitelist mode for mass assignment.
|
44
|
-
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
45
|
-
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
46
|
-
# parameters by using an attr_accessible or attr_protected declaration.
|
47
|
-
# config.active_record.whitelist_attributes = true
|
48
|
-
|
49
38
|
# Enable the asset pipeline
|
50
39
|
config.assets.enabled = true
|
51
40
|
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,7 +2,7 @@ Dummy::Application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
|
-
# every request.
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
@@ -22,13 +22,6 @@ Dummy::Application.configure do
|
|
22
22
|
# Only use best-standards-support built into browsers
|
23
23
|
config.action_dispatch.best_standards_support = :builtin
|
24
24
|
|
25
|
-
# Raise exception on mass assignment protection for Active Record models
|
26
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
-
|
28
|
-
# Log the query plan for queries taking more than this (works
|
29
|
-
# with SQLite, MySQL, and PostgreSQL)
|
30
|
-
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
-
|
32
25
|
# Do not compress assets
|
33
26
|
config.assets.compress = false
|
34
27
|
|
@@ -33,11 +33,8 @@ Dummy::Application.configure do
|
|
33
33
|
# See everything in the log (default is :info)
|
34
34
|
# config.log_level = :debug
|
35
35
|
|
36
|
-
# Prepend all log lines with the following tags
|
37
|
-
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
-
|
39
36
|
# Use a different logger for distributed setups
|
40
|
-
# config.logger =
|
37
|
+
# config.logger = SyslogLogger.new
|
41
38
|
|
42
39
|
# Use a different cache store in production
|
43
40
|
# config.cache_store = :mem_cache_store
|
@@ -60,8 +57,4 @@ Dummy::Application.configure do
|
|
60
57
|
|
61
58
|
# Send deprecation notices to registered listeners
|
62
59
|
config.active_support.deprecation = :notify
|
63
|
-
|
64
|
-
# Log the query plan for queries taking more than this (works
|
65
|
-
# with SQLite, MySQL, and PostgreSQL)
|
66
|
-
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
67
60
|
end
|
@@ -2,9 +2,9 @@ Dummy::Application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite.
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
6
|
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs.
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
10
|
# Configure static asset server for tests with Cache-Control for performance
|
@@ -29,8 +29,10 @@ Dummy::Application.configure do
|
|
29
29
|
# ActionMailer::Base.deliveries array.
|
30
30
|
config.action_mailer.delivery_method = :test
|
31
31
|
|
32
|
-
#
|
33
|
-
|
32
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
33
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
34
|
+
# like if you have constraints or database-specific column types
|
35
|
+
# config.active_record.schema_format = :sql
|
34
36
|
|
35
37
|
# Print deprecation notices to the stderr
|
36
38
|
config.active_support.deprecation = :stderr
|
File without changes
|
File without changes
|
@@ -4,4 +4,4 @@
|
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
Dummy::Application.config.secret_token = '
|
7
|
+
Dummy::Application.config.secret_token = '58a2a6a84d84c3e438f9ca2616323039174f7da3337e52de287033934caa5d32051779feec0aba01731cd4811d60150b208b856b706bee47f510c8a0648f1600'
|
File without changes
|
File without changes
|