phraseapp-ruby 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phraseapp-ruby.rb +19 -2
- data/lib/phraseapp-ruby/auth.rb +3 -4
- data/lib/phraseapp-ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66f19cceda82bde2fae86aadedbf6352f01006d1
|
4
|
+
data.tar.gz: 3ee0565bae45422dd10d03e7f8f35d57b21b2255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5456ee85d5fe98710ff39cc129b2b9bc6c14791c4f6168194e4101df00217663806cad4199456937e8810ffc920340b7ae6ce1d7b57bc7ebf5b0e6e93595649
|
7
|
+
data.tar.gz: 66cd330c773979efa5ff5962a1787d0b161a6f43815018a8285db40473f0160a80f4267d14750f5e67058c22bd5203f91610895f2b0fd6c0c0850f78f72c6c62
|
data/lib/phraseapp-ruby.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
#
|
2
|
+
|
3
|
+
# revision_docs:72ae3531d8460b33c6cb4a87636e7fcc66e37447
|
4
|
+
# revision_generator:ceb47e5be23d139da3a18a815c6da3ac70d0b412
|
4
5
|
require 'ostruct'
|
5
6
|
require 'net/https'
|
6
7
|
require 'uri'
|
@@ -1156,6 +1157,8 @@ module RequestParams
|
|
1156
1157
|
# Indicates whether the upload should not create upload tags.
|
1157
1158
|
# tags::
|
1158
1159
|
# List of tags separated by comma to be associated with the new keys contained in the upload.
|
1160
|
+
# update_descriptions::
|
1161
|
+
# Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
|
1159
1162
|
# update_translations::
|
1160
1163
|
# Indicates whether existing translations should be updated with the file content.
|
1161
1164
|
class UploadParams < ::OpenStruct
|
@@ -1214,6 +1217,16 @@ module RequestParams
|
|
1214
1217
|
super(val)
|
1215
1218
|
end
|
1216
1219
|
|
1220
|
+
def update_descriptions=(val)
|
1221
|
+
if val.is_a?(TrueClass)
|
1222
|
+
super(true)
|
1223
|
+
elsif val.is_a?(FalseClass)
|
1224
|
+
return
|
1225
|
+
else
|
1226
|
+
PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
|
1227
|
+
end
|
1228
|
+
end
|
1229
|
+
|
1217
1230
|
def update_translations=(val)
|
1218
1231
|
if val.is_a?(TrueClass)
|
1219
1232
|
super(true)
|
@@ -4896,6 +4909,10 @@ end
|
|
4896
4909
|
data_hash["tags"] = params.tags
|
4897
4910
|
end
|
4898
4911
|
|
4912
|
+
if params.update_descriptions != nil
|
4913
|
+
data_hash["update_descriptions"] = (params.update_descriptions == true)
|
4914
|
+
end
|
4915
|
+
|
4899
4916
|
if params.update_translations != nil
|
4900
4917
|
data_hash["update_translations"] = (params.update_translations == true)
|
4901
4918
|
end
|
data/lib/phraseapp-ruby/auth.rb
CHANGED
@@ -3,6 +3,8 @@ module PhraseApp
|
|
3
3
|
URL = "https://api.phraseapp.com"
|
4
4
|
|
5
5
|
module Auth
|
6
|
+
class ValidationError < StandardError
|
7
|
+
end
|
6
8
|
|
7
9
|
# See PhraseApp::Client for usage example
|
8
10
|
class Credentials < OpenStruct
|
@@ -17,7 +19,7 @@ module PhraseApp
|
|
17
19
|
|
18
20
|
def validate!
|
19
21
|
if self.username.to_s == "" && self.token.to_s == ""
|
20
|
-
raise ValidationError.new("either username or token must be given")
|
22
|
+
raise PhraseApp::Auth::ValidationError.new("either username or token must be given")
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
@@ -76,6 +78,3 @@ module PhraseApp
|
|
76
78
|
end
|
77
79
|
end
|
78
80
|
end
|
79
|
-
|
80
|
-
class ValidationError < StandardError
|
81
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phraseapp-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PhraseApp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: PhraseApp API client libary
|
14
14
|
email:
|