copycat 0.0.2 → 0.0.3
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.md +3 -3
- data/app/assets/stylesheets/{copycat/copycat.css → copycat_engine.css} +16 -9
- data/app/controllers/copycat_translations_controller.rb +4 -0
- data/app/models/copycat_translation.rb +1 -2
- data/app/views/copycat_translations/_copycat_header.html.erb +9 -0
- data/app/views/copycat_translations/index.html.erb +0 -9
- data/app/views/copycat_translations/readme.html.erb +23 -34
- data/app/views/copycat_translations/upload.html.erb +1 -8
- data/app/views/layouts/copycat.html.erb +15 -0
- data/db/migrate/20120313191745_create_copycat_translations.rb +5 -2
- data/lib/copycat/version.rb +1 -1
- data/lib/copycat.rb +14 -5
- data/lib/tasks/copycat_tasks.rake +26 -4
- data/spec/dummy/config/initializers/copycat.rb +2 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/{20120313192639_create_copycat_translations.copycat_engine.rb → 20120316153248_create_copycat_translations.copycat_engine.rb} +5 -2
- data/spec/dummy/db/schema.rb +3 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +561 -0
- data/spec/dummy/log/test.log +5316 -0
- data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/D09/190/sprockets%2Fb2bddd007999a56d8b20c92301ea1983 +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/DBD/220/sprockets%2F0cbff5c1a349439c1c444cbb4a57acc4 +0 -0
- data/spec/dummy/tmp/cache/assets/DDD/780/sprockets%2Fe7880b84c3ecb507fabc99b9ef6b70e3 +0 -0
- data/spec/dummy/{app/assets/stylesheets/copycat.css → tmp/cache/assets/DF8/310/sprockets%2Fccb12c4009c2f876d51dee8bae4c64ec} +0 -0
- data/spec/integration/copycat_spec.rb +26 -1
- data/spec/lib/copycat_spec.rb +2 -2
- metadata +17 -9
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,11 +1,18 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
feature "use #t" do
|
4
6
|
|
7
|
+
it "the dummy app has a translation for site.index.header but not site.index.intro" do
|
8
|
+
I18n.t('site.index.header').should == 'The Header'
|
9
|
+
I18n.t('site.index.intro').should == "translation missing: en.site.index.intro"
|
10
|
+
end
|
11
|
+
|
5
12
|
it "uses i18n.t" do
|
6
13
|
visit root_path
|
7
14
|
page.should have_content 'The Header'
|
8
|
-
page.should have_content '
|
15
|
+
page.should have_content 'Intro' #ActionView::Helpers::TranslationHelper#translate wrapper
|
9
16
|
end
|
10
17
|
|
11
18
|
it "creates a copycat_translation if the yaml has an entry" do
|
@@ -32,6 +39,9 @@ end
|
|
32
39
|
require 'tempfile'
|
33
40
|
|
34
41
|
feature "downloading and uploading yaml files" do
|
42
|
+
before do
|
43
|
+
page.driver.browser.basic_authorize COPYCAT_USERNAME, COPYCAT_PASSWORD
|
44
|
+
end
|
35
45
|
|
36
46
|
it "round-trips the YAML" do
|
37
47
|
Factory(:copycat_translation, :key => "a.foo1", :value => "bar1")
|
@@ -63,6 +73,21 @@ feature "downloading and uploading yaml files" do
|
|
63
73
|
assert CopycatTranslation.find_by_key(2).value == "bar5"
|
64
74
|
end
|
65
75
|
|
76
|
+
it "round-trips the yaml with complicated text" do
|
77
|
+
Factory(:copycat_translation, :key => "a.foo", :value => "“hello world“ üokåa®fgsdf;::fs;kdf")
|
78
|
+
visit "/copycat_translations.yaml"
|
79
|
+
CopycatTranslation.destroy_all
|
80
|
+
yaml = page.text
|
81
|
+
file = Tempfile.new 'copycat'
|
82
|
+
file.write yaml
|
83
|
+
file.close
|
84
|
+
visit upload_copycat_translations_path
|
85
|
+
attach_file "file", file.path
|
86
|
+
click_button "Upload"
|
87
|
+
file.unlink
|
88
|
+
assert CopycatTranslation.find_by_key("a.foo").value == "“hello world“ üokåa®fgsdf;::fs;kdf"
|
89
|
+
end
|
90
|
+
|
66
91
|
it "gives 400 on bad upload" do
|
67
92
|
visit "/copycat_translations.yaml"
|
68
93
|
|
data/spec/lib/copycat_spec.rb
CHANGED
@@ -7,7 +7,7 @@ describe Copycat do
|
|
7
7
|
b.class_eval do
|
8
8
|
module SimpleImplementation
|
9
9
|
def lookup(*args)
|
10
|
-
|
10
|
+
"translation missing"
|
11
11
|
end
|
12
12
|
end
|
13
13
|
include SimpleImplementation
|
@@ -27,7 +27,7 @@ describe Copycat do
|
|
27
27
|
|
28
28
|
describe ".lookup" do
|
29
29
|
it "returns simple lookup if copycat_translation missing" do
|
30
|
-
base.lookup(nil,
|
30
|
+
base.lookup(nil, '').should == "translation missing"
|
31
31
|
end
|
32
32
|
it "returns copycat_translation if present" do
|
33
33
|
cct = FactoryGirl.create(:copycat_translation)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: copycat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &2151799440 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 3.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2151799440
|
26
26
|
description: Edit live website copy.
|
27
27
|
email:
|
28
28
|
- info@vermonster.com
|
@@ -30,13 +30,15 @@ executables: []
|
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
|
-
- app/assets/stylesheets/
|
33
|
+
- app/assets/stylesheets/copycat_engine.css
|
34
34
|
- app/controllers/copycat_translations_controller.rb
|
35
35
|
- app/models/copycat_translation.rb
|
36
|
+
- app/views/copycat_translations/_copycat_header.html.erb
|
36
37
|
- app/views/copycat_translations/edit.html.erb
|
37
38
|
- app/views/copycat_translations/index.html.erb
|
38
39
|
- app/views/copycat_translations/readme.html.erb
|
39
40
|
- app/views/copycat_translations/upload.html.erb
|
41
|
+
- app/views/layouts/copycat.html.erb
|
40
42
|
- config/routes.rb
|
41
43
|
- db/migrate/20120313191745_create_copycat_translations.rb
|
42
44
|
- lib/copycat/engine.rb
|
@@ -48,7 +50,6 @@ files:
|
|
48
50
|
- README.md
|
49
51
|
- spec/dummy/app/assets/javascripts/application.js
|
50
52
|
- spec/dummy/app/assets/stylesheets/application.css
|
51
|
-
- spec/dummy/app/assets/stylesheets/copycat.css
|
52
53
|
- spec/dummy/app/controllers/application_controller.rb
|
53
54
|
- spec/dummy/app/controllers/site_controller.rb
|
54
55
|
- spec/dummy/app/helpers/application_helper.rb
|
@@ -62,6 +63,7 @@ files:
|
|
62
63
|
- spec/dummy/config/environments/production.rb
|
63
64
|
- spec/dummy/config/environments/test.rb
|
64
65
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
66
|
+
- spec/dummy/config/initializers/copycat.rb
|
65
67
|
- spec/dummy/config/initializers/inflections.rb
|
66
68
|
- spec/dummy/config/initializers/mime_types.rb
|
67
69
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -71,7 +73,7 @@ files:
|
|
71
73
|
- spec/dummy/config/routes.rb
|
72
74
|
- spec/dummy/config.ru
|
73
75
|
- spec/dummy/db/development.sqlite3
|
74
|
-
- spec/dummy/db/migrate/
|
76
|
+
- spec/dummy/db/migrate/20120316153248_create_copycat_translations.copycat_engine.rb
|
75
77
|
- spec/dummy/db/schema.rb
|
76
78
|
- spec/dummy/db/test.sqlite3
|
77
79
|
- spec/dummy/log/development.log
|
@@ -83,10 +85,13 @@ files:
|
|
83
85
|
- spec/dummy/Rakefile
|
84
86
|
- spec/dummy/script/rails
|
85
87
|
- spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
88
|
+
- spec/dummy/tmp/cache/assets/D09/190/sprockets%2Fb2bddd007999a56d8b20c92301ea1983
|
86
89
|
- spec/dummy/tmp/cache/assets/D1A/DB0/sprockets%2F26d700197b8d25f954d56d8f31f2c8bc
|
87
90
|
- spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
88
91
|
- spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
92
|
+
- spec/dummy/tmp/cache/assets/DBD/220/sprockets%2F0cbff5c1a349439c1c444cbb4a57acc4
|
89
93
|
- spec/dummy/tmp/cache/assets/DDD/780/sprockets%2Fe7880b84c3ecb507fabc99b9ef6b70e3
|
94
|
+
- spec/dummy/tmp/cache/assets/DF8/310/sprockets%2Fccb12c4009c2f876d51dee8bae4c64ec
|
90
95
|
- spec/factories/copycat_translations.rb
|
91
96
|
- spec/integration/copycat_spec.rb
|
92
97
|
- spec/lib/copycat_spec.rb
|
@@ -119,7 +124,6 @@ summary: Rails engine for editing live website copy.
|
|
119
124
|
test_files:
|
120
125
|
- spec/dummy/app/assets/javascripts/application.js
|
121
126
|
- spec/dummy/app/assets/stylesheets/application.css
|
122
|
-
- spec/dummy/app/assets/stylesheets/copycat.css
|
123
127
|
- spec/dummy/app/controllers/application_controller.rb
|
124
128
|
- spec/dummy/app/controllers/site_controller.rb
|
125
129
|
- spec/dummy/app/helpers/application_helper.rb
|
@@ -133,6 +137,7 @@ test_files:
|
|
133
137
|
- spec/dummy/config/environments/production.rb
|
134
138
|
- spec/dummy/config/environments/test.rb
|
135
139
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
140
|
+
- spec/dummy/config/initializers/copycat.rb
|
136
141
|
- spec/dummy/config/initializers/inflections.rb
|
137
142
|
- spec/dummy/config/initializers/mime_types.rb
|
138
143
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -142,7 +147,7 @@ test_files:
|
|
142
147
|
- spec/dummy/config/routes.rb
|
143
148
|
- spec/dummy/config.ru
|
144
149
|
- spec/dummy/db/development.sqlite3
|
145
|
-
- spec/dummy/db/migrate/
|
150
|
+
- spec/dummy/db/migrate/20120316153248_create_copycat_translations.copycat_engine.rb
|
146
151
|
- spec/dummy/db/schema.rb
|
147
152
|
- spec/dummy/db/test.sqlite3
|
148
153
|
- spec/dummy/log/development.log
|
@@ -154,10 +159,13 @@ test_files:
|
|
154
159
|
- spec/dummy/Rakefile
|
155
160
|
- spec/dummy/script/rails
|
156
161
|
- spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
162
|
+
- spec/dummy/tmp/cache/assets/D09/190/sprockets%2Fb2bddd007999a56d8b20c92301ea1983
|
157
163
|
- spec/dummy/tmp/cache/assets/D1A/DB0/sprockets%2F26d700197b8d25f954d56d8f31f2c8bc
|
158
164
|
- spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
159
165
|
- spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
166
|
+
- spec/dummy/tmp/cache/assets/DBD/220/sprockets%2F0cbff5c1a349439c1c444cbb4a57acc4
|
160
167
|
- spec/dummy/tmp/cache/assets/DDD/780/sprockets%2Fe7880b84c3ecb507fabc99b9ef6b70e3
|
168
|
+
- spec/dummy/tmp/cache/assets/DF8/310/sprockets%2Fccb12c4009c2f876d51dee8bae4c64ec
|
161
169
|
- spec/factories/copycat_translations.rb
|
162
170
|
- spec/integration/copycat_spec.rb
|
163
171
|
- spec/lib/copycat_spec.rb
|