localeapp 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +6 -6
- data/lib/localeapp/updater.rb +6 -0
- data/lib/localeapp/version.rb +1 -1
- data/spec/localeapp/updater_spec.rb +25 -0
- metadata +38 -38
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -144,20 +144,20 @@ can be disabled in a similar way to polling and sending:
|
|
144
144
|
|
145
145
|
config.reloading_environments = []
|
146
146
|
|
147
|
-
|
147
|
+
## Inviting other developers and translators
|
148
148
|
|
149
149
|
You can invite other developers and translators via localeapp.com. Developers
|
150
150
|
have access to all the content and all the locales. Translators are restricted
|
151
151
|
to editing only the locales you give them access too.
|
152
152
|
|
153
|
-
|
153
|
+
## Adding a locale
|
154
154
|
|
155
155
|
If we find an unknown locale during an import we'll add it to your project.
|
156
156
|
You can also add a new locale to a project via localeapp.com. This will create
|
157
157
|
missing translations for every translation key. You will need to restart any
|
158
158
|
listeners completely to pick up the new locale.
|
159
159
|
|
160
|
-
|
160
|
+
## Syck, Psych, and creating YAML
|
161
161
|
|
162
162
|
Since ruby 1.9.3-p0 Psych has been the default YAML engine in Ruby. Psych is
|
163
163
|
based on libyaml and fixes a number of issues with the previous YAML library,
|
@@ -168,13 +168,13 @@ but it does write YAML differently to Psych so you will notice differences
|
|
168
168
|
between exporting directly from localeapp.com and doing localeapp pull on the
|
169
169
|
command line unless you're using 1.9.3+ or have installed Psych as a gem.
|
170
170
|
|
171
|
-
|
171
|
+
## Proxies
|
172
172
|
|
173
173
|
If you need to go through a proxy server, you can configure it with:
|
174
174
|
|
175
175
|
config.proxy = "http://my.proxy.com:8888"
|
176
176
|
|
177
|
-
|
177
|
+
## SSL Certificate verification
|
178
178
|
|
179
179
|
localeapp.com uses https everywhere but certificate validation is turned off by
|
180
180
|
default. This is because ruby doesn't know how to read the certs from the OSX
|
@@ -188,7 +188,7 @@ See [this article on Ruby Inside][1] for some more details.
|
|
188
188
|
|
189
189
|
[1]: http://www.rubyinside.com/how-to-cure-nethttps-risky-default-https-behavior-4010.html
|
190
190
|
|
191
|
-
|
191
|
+
## Support and feedback
|
192
192
|
|
193
193
|
You can contact us via the support link at the bottom of the page or emailing
|
194
194
|
support@localeapp.com
|
data/lib/localeapp/updater.rb
CHANGED
@@ -71,6 +71,8 @@ module Localeapp
|
|
71
71
|
raise "Could not write locale file, please make sure that #{target_dir} exists and is writeable"
|
72
72
|
end
|
73
73
|
|
74
|
+
permissions = File.stat(file_name).mode if File.exist?(file_name)
|
75
|
+
|
74
76
|
temp_file = Tempfile.new(File.basename(file_name), temp_dir)
|
75
77
|
yield temp_file
|
76
78
|
temp_file.close
|
@@ -79,6 +81,10 @@ module Localeapp
|
|
79
81
|
# so rename will work
|
80
82
|
FileUtils.mv(temp_file.path, "#{file_name}.tmp")
|
81
83
|
File.rename("#{file_name}.tmp", file_name)
|
84
|
+
|
85
|
+
# chmod the file to its previous permissions
|
86
|
+
# or set default permissions to 644
|
87
|
+
File.chmod(permissions ? permissions : 0644 , file_name)
|
82
88
|
end
|
83
89
|
end
|
84
90
|
end
|
data/lib/localeapp/version.rb
CHANGED
@@ -156,4 +156,29 @@ JA
|
|
156
156
|
File.read(File.join(@yml_dir, 'en.yml')).should match(/foo: ! 'bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar '/m)
|
157
157
|
end
|
158
158
|
end
|
159
|
+
|
160
|
+
it "doesn't change a yml file's permissions" do
|
161
|
+
filepath = File.join(@yml_dir, 'en.yml')
|
162
|
+
File.chmod(0777, filepath)
|
163
|
+
permissions = lambda { File.stat(filepath).mode.to_s(8) }
|
164
|
+
expect {
|
165
|
+
do_update(
|
166
|
+
'translations' => {
|
167
|
+
'en' => { 'foo' => 'bar'}
|
168
|
+
},
|
169
|
+
'locales' => ['en']
|
170
|
+
)
|
171
|
+
}.to_not change(permissions, :call)
|
172
|
+
end
|
173
|
+
|
174
|
+
it "creates new yml files chmodded with 644" do
|
175
|
+
do_update({
|
176
|
+
'translations' => {
|
177
|
+
'ja' => { 'foo' => 'bar'}
|
178
|
+
},
|
179
|
+
'locales' => ['ja']
|
180
|
+
})
|
181
|
+
mode = File.stat(File.join(@yml_dir, 'ja.yml')).mode # octal
|
182
|
+
mode.to_s(8)[3, 3].should == "644"
|
183
|
+
end
|
159
184
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: localeapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 2
|
10
|
+
version: 0.5.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christopher Dell
|
@@ -16,12 +16,13 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
19
|
+
date: 2012-09-12 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: i18n
|
23
|
+
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
26
|
none: false
|
26
27
|
requirements:
|
27
28
|
- - ">="
|
@@ -30,12 +31,12 @@ dependencies:
|
|
30
31
|
segments:
|
31
32
|
- 0
|
32
33
|
version: "0"
|
33
|
-
|
34
|
-
version_requirements: *id001
|
34
|
+
requirement: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: json
|
37
|
+
type: :runtime
|
37
38
|
prerelease: false
|
38
|
-
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
41
|
requirements:
|
41
42
|
- - ">="
|
@@ -44,12 +45,12 @@ dependencies:
|
|
44
45
|
segments:
|
45
46
|
- 0
|
46
47
|
version: "0"
|
47
|
-
|
48
|
-
version_requirements: *id002
|
48
|
+
requirement: *id002
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: rest-client
|
51
|
+
type: :runtime
|
51
52
|
prerelease: false
|
52
|
-
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
54
|
none: false
|
54
55
|
requirements:
|
55
56
|
- - ">="
|
@@ -58,12 +59,12 @@ dependencies:
|
|
58
59
|
segments:
|
59
60
|
- 0
|
60
61
|
version: "0"
|
61
|
-
|
62
|
-
version_requirements: *id003
|
62
|
+
requirement: *id003
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: ya2yaml
|
65
|
+
type: :runtime
|
65
66
|
prerelease: false
|
66
|
-
|
67
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
67
68
|
none: false
|
68
69
|
requirements:
|
69
70
|
- - ">="
|
@@ -72,12 +73,12 @@ dependencies:
|
|
72
73
|
segments:
|
73
74
|
- 0
|
74
75
|
version: "0"
|
75
|
-
|
76
|
-
version_requirements: *id004
|
76
|
+
requirement: *id004
|
77
77
|
- !ruby/object:Gem::Dependency
|
78
78
|
name: gli
|
79
|
+
type: :runtime
|
79
80
|
prerelease: false
|
80
|
-
|
81
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
81
82
|
none: false
|
82
83
|
requirements:
|
83
84
|
- - ">="
|
@@ -86,12 +87,12 @@ dependencies:
|
|
86
87
|
segments:
|
87
88
|
- 0
|
88
89
|
version: "0"
|
89
|
-
|
90
|
-
version_requirements: *id005
|
90
|
+
requirement: *id005
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rake
|
93
|
+
type: :development
|
93
94
|
prerelease: false
|
94
|
-
|
95
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
95
96
|
none: false
|
96
97
|
requirements:
|
97
98
|
- - ">="
|
@@ -100,12 +101,12 @@ dependencies:
|
|
100
101
|
segments:
|
101
102
|
- 0
|
102
103
|
version: "0"
|
103
|
-
|
104
|
-
version_requirements: *id006
|
104
|
+
requirement: *id006
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: rspec
|
107
|
+
type: :development
|
107
108
|
prerelease: false
|
108
|
-
|
109
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
109
110
|
none: false
|
110
111
|
requirements:
|
111
112
|
- - "="
|
@@ -116,12 +117,12 @@ dependencies:
|
|
116
117
|
- 11
|
117
118
|
- 0
|
118
119
|
version: 2.11.0
|
119
|
-
|
120
|
-
version_requirements: *id007
|
120
|
+
requirement: *id007
|
121
121
|
- !ruby/object:Gem::Dependency
|
122
122
|
name: yard
|
123
|
+
type: :development
|
123
124
|
prerelease: false
|
124
|
-
|
125
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
125
126
|
none: false
|
126
127
|
requirements:
|
127
128
|
- - "="
|
@@ -132,12 +133,12 @@ dependencies:
|
|
132
133
|
- 6
|
133
134
|
- 7
|
134
135
|
version: 0.6.7
|
135
|
-
|
136
|
-
version_requirements: *id008
|
136
|
+
requirement: *id008
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: RedCloth
|
139
|
+
type: :development
|
139
140
|
prerelease: false
|
140
|
-
|
141
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
141
142
|
none: false
|
142
143
|
requirements:
|
143
144
|
- - "="
|
@@ -148,12 +149,12 @@ dependencies:
|
|
148
149
|
- 2
|
149
150
|
- 9
|
150
151
|
version: 4.2.9
|
151
|
-
|
152
|
-
version_requirements: *id009
|
152
|
+
requirement: *id009
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: aruba
|
155
|
+
type: :development
|
155
156
|
prerelease: false
|
156
|
-
|
157
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
157
158
|
none: false
|
158
159
|
requirements:
|
159
160
|
- - "="
|
@@ -164,12 +165,12 @@ dependencies:
|
|
164
165
|
- 4
|
165
166
|
- 11
|
166
167
|
version: 0.4.11
|
167
|
-
|
168
|
-
version_requirements: *id010
|
168
|
+
requirement: *id010
|
169
169
|
- !ruby/object:Gem::Dependency
|
170
170
|
name: fakeweb
|
171
|
+
type: :development
|
171
172
|
prerelease: false
|
172
|
-
|
173
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
173
174
|
none: false
|
174
175
|
requirements:
|
175
176
|
- - "="
|
@@ -180,8 +181,7 @@ dependencies:
|
|
180
181
|
- 3
|
181
182
|
- 0
|
182
183
|
version: 1.3.0
|
183
|
-
|
184
|
-
version_requirements: *id011
|
184
|
+
requirement: *id011
|
185
185
|
description: Synchronizes i18n translation keys and content with localeapp.com so you don't have to manage translations by hand.
|
186
186
|
email:
|
187
187
|
- chris@tigrish.com
|
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
291
|
requirements: []
|
292
292
|
|
293
293
|
rubyforge_project: localeapp
|
294
|
-
rubygems_version: 1.8.
|
294
|
+
rubygems_version: 1.8.6
|
295
295
|
signing_key:
|
296
296
|
specification_version: 3
|
297
297
|
summary: Easy i18n translation management with localeapp.com
|