lingohub 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/lingohub/commands/resource.rb +10 -1
- data/lib/lingohub/models/project.rb +2 -2
- data/lib/lingohub/models/resource.rb +5 -0
- data/lib/lingohub/version.rb +1 -1
- metadata +85 -64
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e24ca3dad15ab7144f747c81d47a0b96a6c0fb19
|
4
|
+
data.tar.gz: ea0f67d8c8fa418042819c5b2c78ac41e79682cc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8e26bc6d7d31446ccfe1b79cf44ca64640c4b4fd7edc31a011878822c870dd6b10d50dceeb9a79a87a07cc5dd7be1e13ca752940e6fcadfc714be504c4c0a6d9
|
7
|
+
data.tar.gz: 6ada2e5290e2f675e0c7b91e688fabac84e44549017cba919aedf61ecb0613399711f5ec1af46335ff4efa4415cea4015348133d361364d5d2150ea5d4ddcb2d
|
@@ -43,6 +43,15 @@ module Lingohub::Command
|
|
43
43
|
@locale
|
44
44
|
end
|
45
45
|
|
46
|
+
def extract_strategy_from_args
|
47
|
+
return @strategy if defined? @strategy
|
48
|
+
@strategy = extract_option('--strategy', Lingohub::Models::Resource::STRATEGY_MASTER_LOCALE_STRUCTURE)
|
49
|
+
unless Lingohub::Models::Resource::STRATEGIES.include?(@strategy)
|
50
|
+
raise(CommandFailed, "You must specify a strategy after --strategy, possible values are: " + Lingohub::Models::Resource::STRATEGIES.join(", "))
|
51
|
+
end
|
52
|
+
@strategy
|
53
|
+
end
|
54
|
+
|
46
55
|
def extract_all_from_args
|
47
56
|
return @all if defined? @all
|
48
57
|
@all = extract_option('--all', true)
|
@@ -88,7 +97,7 @@ module Lingohub::Command
|
|
88
97
|
resources.each do |file_name|
|
89
98
|
begin
|
90
99
|
path = File.expand_path(file_name, Dir.pwd)
|
91
|
-
project.upload_resource(path, extract_locale_from_args)
|
100
|
+
project.upload_resource(path, extract_locale_from_args, extract_strategy_from_args)
|
92
101
|
display("#{file_name} uploaded")
|
93
102
|
rescue
|
94
103
|
display "Error uploading #{file_name}. Response: #{$!.message || $!.response}"
|
@@ -94,10 +94,10 @@ module Lingohub
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
def upload_resource(path, locale)
|
97
|
+
def upload_resource(path, locale, strategy)
|
98
98
|
raise "Path #{path} does not exists" unless File.exists?(path)
|
99
99
|
request = { :file => File.new(path, "rb") }
|
100
|
-
request.merge!({ :iso2_slug => locale }) if locale
|
100
|
+
request.merge!({ :iso2_slug => locale, :strategy => strategy }) if locale
|
101
101
|
@client.post(self.resources_url, request)
|
102
102
|
end
|
103
103
|
|
@@ -3,6 +3,11 @@ module Lingohub
|
|
3
3
|
class Resource
|
4
4
|
attr_accessor :locale
|
5
5
|
|
6
|
+
STRATEGY_UPDATE_AND_CREATE = 'update_and_create'
|
7
|
+
STRATEGY_MASTER_LOCALE_STRUCTURE = 'master_locale_structure'
|
8
|
+
STRATEGY_OVERRIDE ='override'
|
9
|
+
STRATEGIES = [STRATEGY_MASTER_LOCALE_STRUCTURE, STRATEGY_UPDATE_AND_CREATE, STRATEGY_OVERRIDE]
|
10
|
+
|
6
11
|
def initialize(client, locale, link)
|
7
12
|
@client = client
|
8
13
|
@locale = locale
|
data/lib/lingohub/version.rb
CHANGED
metadata
CHANGED
@@ -1,128 +1,156 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lingohub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- lingohub GmbH
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rest-client
|
16
|
-
|
17
|
-
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.6.7
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
18
21
|
requirements:
|
19
22
|
- - ~>
|
20
23
|
- !ruby/object:Gem::Version
|
21
24
|
version: 1.6.7
|
22
|
-
type: :runtime
|
23
25
|
prerelease: false
|
24
|
-
|
26
|
+
type: :runtime
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: launchy
|
27
|
-
|
28
|
-
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.5
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
29
35
|
requirements:
|
30
36
|
- - ~>
|
31
37
|
- !ruby/object:Gem::Version
|
32
38
|
version: 2.0.5
|
33
|
-
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
|
40
|
+
type: :runtime
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
42
|
name: stringex
|
38
|
-
|
39
|
-
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.3.2
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
40
49
|
requirements:
|
41
50
|
- - ~>
|
42
51
|
- !ruby/object:Gem::Version
|
43
52
|
version: 1.3.2
|
44
|
-
type: :runtime
|
45
53
|
prerelease: false
|
46
|
-
|
54
|
+
type: :runtime
|
47
55
|
- !ruby/object:Gem::Dependency
|
48
56
|
name: rake
|
49
|
-
|
50
|
-
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.9.2
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
51
63
|
requirements:
|
52
64
|
- - ~>
|
53
65
|
- !ruby/object:Gem::Version
|
54
66
|
version: 0.9.2
|
55
|
-
type: :development
|
56
67
|
prerelease: false
|
57
|
-
|
68
|
+
type: :development
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: rspec
|
60
|
-
|
61
|
-
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.8.0
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
62
77
|
requirements:
|
63
78
|
- - ~>
|
64
79
|
- !ruby/object:Gem::Version
|
65
80
|
version: 2.8.0
|
66
|
-
type: :development
|
67
81
|
prerelease: false
|
68
|
-
|
82
|
+
type: :development
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: fakefs
|
71
|
-
|
72
|
-
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.4.0
|
90
|
+
requirement: !ruby/object:Gem::Requirement
|
73
91
|
requirements:
|
74
92
|
- - ~>
|
75
93
|
- !ruby/object:Gem::Version
|
76
94
|
version: 0.4.0
|
77
|
-
type: :development
|
78
95
|
prerelease: false
|
79
|
-
|
96
|
+
type: :development
|
80
97
|
- !ruby/object:Gem::Dependency
|
81
98
|
name: taps
|
82
|
-
|
83
|
-
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.3.23
|
104
|
+
requirement: !ruby/object:Gem::Requirement
|
84
105
|
requirements:
|
85
106
|
- - ~>
|
86
107
|
- !ruby/object:Gem::Version
|
87
108
|
version: 0.3.23
|
88
|
-
type: :development
|
89
109
|
prerelease: false
|
90
|
-
|
110
|
+
type: :development
|
91
111
|
- !ruby/object:Gem::Dependency
|
92
112
|
name: webmock
|
93
|
-
|
94
|
-
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.8.0
|
118
|
+
requirement: !ruby/object:Gem::Requirement
|
95
119
|
requirements:
|
96
120
|
- - ~>
|
97
121
|
- !ruby/object:Gem::Version
|
98
122
|
version: 1.8.0
|
99
|
-
type: :development
|
100
123
|
prerelease: false
|
101
|
-
|
124
|
+
type: :development
|
102
125
|
- !ruby/object:Gem::Dependency
|
103
126
|
name: i18n
|
104
|
-
|
105
|
-
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.6.0
|
132
|
+
requirement: !ruby/object:Gem::Requirement
|
106
133
|
requirements:
|
107
134
|
- - ~>
|
108
135
|
- !ruby/object:Gem::Version
|
109
136
|
version: 0.6.0
|
110
|
-
type: :development
|
111
137
|
prerelease: false
|
112
|
-
|
138
|
+
type: :development
|
113
139
|
- !ruby/object:Gem::Dependency
|
114
140
|
name: vcr
|
115
|
-
|
116
|
-
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ~>
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 2.0.0
|
146
|
+
requirement: !ruby/object:Gem::Requirement
|
117
147
|
requirements:
|
118
148
|
- - ~>
|
119
149
|
- !ruby/object:Gem::Version
|
120
150
|
version: 2.0.0
|
121
|
-
type: :development
|
122
151
|
prerelease: false
|
123
|
-
|
124
|
-
description: Client library and command-line tool to translate Ruby based apps with
|
125
|
-
lingohub.
|
152
|
+
type: :development
|
153
|
+
description: Client library and command-line tool to translate Ruby based apps with lingohub.
|
126
154
|
email:
|
127
155
|
- team@lingohub.com
|
128
156
|
executables:
|
@@ -130,8 +158,11 @@ executables:
|
|
130
158
|
extensions: []
|
131
159
|
extra_rdoc_files: []
|
132
160
|
files:
|
161
|
+
- lib/lingohub.rb
|
133
162
|
- lib/lingohub/client.rb
|
134
163
|
- lib/lingohub/command.rb
|
164
|
+
- lib/lingohub/helpers.rb
|
165
|
+
- lib/lingohub/version.rb
|
135
166
|
- lib/lingohub/commands/auth.rb
|
136
167
|
- lib/lingohub/commands/base.rb
|
137
168
|
- lib/lingohub/commands/collaborator.rb
|
@@ -139,15 +170,12 @@ files:
|
|
139
170
|
- lib/lingohub/commands/project.rb
|
140
171
|
- lib/lingohub/commands/resource.rb
|
141
172
|
- lib/lingohub/commands/version.rb
|
142
|
-
- lib/lingohub/helpers.rb
|
143
173
|
- lib/lingohub/models/collaborator.rb
|
144
174
|
- lib/lingohub/models/project.rb
|
145
175
|
- lib/lingohub/models/projects.rb
|
146
176
|
- lib/lingohub/models/resource.rb
|
147
177
|
- lib/lingohub/models/user.rb
|
148
178
|
- lib/lingohub/rails3/railtie.rb
|
149
|
-
- lib/lingohub/version.rb
|
150
|
-
- lib/lingohub.rb
|
151
179
|
- lib/patches/rails3/i18n/i18n.rb
|
152
180
|
- lib/vendor/okjson.rb
|
153
181
|
- bin/lingohub
|
@@ -158,32 +186,25 @@ files:
|
|
158
186
|
- ROADMAP.md
|
159
187
|
homepage: https://lingohub.com
|
160
188
|
licenses: []
|
161
|
-
|
189
|
+
metadata: {}
|
190
|
+
post_install_message:
|
162
191
|
rdoc_options: []
|
163
192
|
require_paths:
|
164
193
|
- lib
|
165
194
|
required_ruby_version: !ruby/object:Gem::Requirement
|
166
|
-
none: false
|
167
195
|
requirements:
|
168
|
-
- -
|
196
|
+
- - '>='
|
169
197
|
- !ruby/object:Gem::Version
|
170
198
|
version: '0'
|
171
|
-
segments:
|
172
|
-
- 0
|
173
|
-
hash: 3097910735419801311
|
174
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
|
-
none: false
|
176
200
|
requirements:
|
177
|
-
- -
|
201
|
+
- - '>='
|
178
202
|
- !ruby/object:Gem::Version
|
179
203
|
version: '0'
|
180
|
-
segments:
|
181
|
-
- 0
|
182
|
-
hash: 3097910735419801311
|
183
204
|
requirements: []
|
184
|
-
rubyforge_project:
|
185
|
-
rubygems_version: 1.
|
186
|
-
signing_key:
|
187
|
-
specification_version:
|
205
|
+
rubyforge_project:
|
206
|
+
rubygems_version: 2.1.9
|
207
|
+
signing_key:
|
208
|
+
specification_version: 4
|
188
209
|
summary: Client library and command-line tool to translate Ruby based apps with lingohub.
|
189
210
|
test_files: []
|