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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e432a1963606a1f32b6a7a3376323acd148c3a8
4
- data.tar.gz: deabc02486e7fc7cd54746d0f15344b5077c228e
3
+ metadata.gz: ea0c8f716ddc79f79cc4e9fed68b8d33a5d3a607
4
+ data.tar.gz: 0606b804e70fbe444154e1b89a72aebcc73cd33a
5
5
  SHA512:
6
- metadata.gz: b50ae7ace46299a935ff0b3494bc5d1998c20ea260afa36bf7311de0a264e5c71d401c9a134daa6d010c623fe5ac2fff38310a586520c179f294ee13fcfd3830
7
- data.tar.gz: 0f5b619ba24fd744c61602b03e270136344b04e1b1ffefdbce547eaafe4784c9f23cfce6caa21b9b8f4165e6fb379483cf7ae23df298003db9b238ea48e5abd9
6
+ metadata.gz: 266e6ebae4240594625d062162cefcef70e93e322c6b4545799b14fe0342c15b0e6dfd14ea4a12cb5e1b52f9a0753fe19a5c97bad57529bbe1d0a35f90d96339
7
+ data.tar.gz: dd3aceaa8413b058622da29b58dfefa7999a26e1a2e7c61746fb65d5ddbd8efb920e166d2c56e8fd9f60390b8b7e8b3b1bc998e517c180241c56674be3db132f
@@ -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, :alias => "-s"
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 are invailed"
104
+ puts "The username or password is invalid"
105
105
  return
106
106
  else
107
- puts "Bad response. Close but no cigar. Response Code = " + response.code
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 "Recived list" if options[:verbose]
159
+ puts "Received list" if options[:verbose]
159
160
  currentMasterFiles = parsedResponse['master_files']
160
161
  else
161
- puts "couldn't fetch list of master files"
162
+ puts "Couldn't fetch list of master files"
162
163
  return
163
164
  end
164
165
  else
165
- puts "couldn't fetch list of master files"
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 "Updateing " + stringFilePath if options[:verbose]
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 responce code #{response.code}" if options[:verbose]
186
+ puts "Upload complete with response code #{response.code}" if options[:verbose]
186
187
  puts "" if options[:verbose]
187
188
  end
188
189
 
@@ -1,3 +1,3 @@
1
1
  module Getlocal
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getlocal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Briggs