getlocal 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/lib/getlocal/cli.rb +11 -10
- data/lib/getlocal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea0c8f716ddc79f79cc4e9fed68b8d33a5d3a607
|
4
|
+
data.tar.gz: 0606b804e70fbe444154e1b89a72aebcc73cd33a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 266e6ebae4240594625d062162cefcef70e93e322c6b4545799b14fe0342c15b0e6dfd14ea4a12cb5e1b52f9a0753fe19a5c97bad57529bbe1d0a35f90d96339
|
7
|
+
data.tar.gz: dd3aceaa8413b058622da29b58dfefa7999a26e1a2e7c61746fb65d5ddbd8efb920e166d2c56e8fd9f60390b8b7e8b3b1bc998e517c180241c56674be3db132f
|
data/lib/getlocal/cli.rb
CHANGED
@@ -19,7 +19,7 @@ module Getlocal
|
|
19
19
|
method_option :user, :required => true, :aliases => "-u"
|
20
20
|
method_option :password, :aliases => "-p"
|
21
21
|
method_option :timeout, :type => :numeric, :default => 600, :aliases => "-t"
|
22
|
-
method_option :sleep, :type => :numeric, :default => 0, :
|
22
|
+
method_option :sleep, :type => :numeric, :default => 0, :aliases => "-s"
|
23
23
|
desc "fetch [PROJECT]", "Used to fetch the latest localisations"
|
24
24
|
def fetch(project)
|
25
25
|
|
@@ -101,22 +101,23 @@ module Getlocal
|
|
101
101
|
puts destFolder + " folder not found. Couldn't import " + destFile if options[:verbose]
|
102
102
|
end
|
103
103
|
elsif response.code == 401
|
104
|
-
puts "The username or password
|
104
|
+
puts "The username or password is invalid"
|
105
105
|
return
|
106
106
|
else
|
107
|
-
puts "Bad response. Close but no cigar.
|
107
|
+
puts "Bad response. Close but no cigar."
|
108
|
+
puts "Error #{response.code} - #{response.body}"
|
108
109
|
puts "Sorry couldn't get #{lang} translations this time."
|
109
110
|
end
|
110
111
|
ensure
|
111
112
|
tempfile.close
|
113
|
+
#Sleep so we don't hit the rate limiting on GetLocalization's API
|
114
|
+
sleep(sleepTime)
|
112
115
|
end
|
113
116
|
puts "" if options[:verbose]
|
114
117
|
end
|
115
118
|
puts "" if options[:verbose]
|
116
119
|
puts "" if options[:verbose]
|
117
120
|
end
|
118
|
-
#Sleep so we don't hit the rate limiting on GetLocalization's API
|
119
|
-
sleep(sleepTime)
|
120
121
|
end
|
121
122
|
|
122
123
|
method_option :user, :required => true, :aliases => "-u"
|
@@ -155,14 +156,14 @@ module Getlocal
|
|
155
156
|
if response.code == 200 then
|
156
157
|
parsedResponse = JSON.parse(response.body)
|
157
158
|
if parsedResponse['success'] == "1"
|
158
|
-
puts "
|
159
|
+
puts "Received list" if options[:verbose]
|
159
160
|
currentMasterFiles = parsedResponse['master_files']
|
160
161
|
else
|
161
|
-
puts "
|
162
|
+
puts "Couldn't fetch list of master files"
|
162
163
|
return
|
163
164
|
end
|
164
165
|
else
|
165
|
-
puts "
|
166
|
+
puts "Couldn't fetch list of master files"
|
166
167
|
return
|
167
168
|
end
|
168
169
|
|
@@ -174,7 +175,7 @@ module Getlocal
|
|
174
175
|
|
175
176
|
if alreadyExists
|
176
177
|
# Update master
|
177
|
-
puts "
|
178
|
+
puts "Updating " + stringFilePath if options[:verbose]
|
178
179
|
response = HTTMultiParty.post("https://api.getlocalization.com/#{project}/api/update-master/", :basic_auth => auth, :query => body)
|
179
180
|
else
|
180
181
|
#Upload new master
|
@@ -182,7 +183,7 @@ module Getlocal
|
|
182
183
|
response = HTTMultiParty.post("https://api.getlocalization.com/#{project}/api/create-master/ios/en/", :basic_auth => auth, :query => body)
|
183
184
|
end
|
184
185
|
|
185
|
-
puts "Upload complete with
|
186
|
+
puts "Upload complete with response code #{response.code}" if options[:verbose]
|
186
187
|
puts "" if options[:verbose]
|
187
188
|
end
|
188
189
|
|
data/lib/getlocal/version.rb
CHANGED