phrase 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.
- data/lib/phrase/tool.rb +2 -14
- data/phrase.gemspec +1 -1
- metadata +4 -4
data/lib/phrase/tool.rb
CHANGED
|
@@ -112,8 +112,8 @@ module PhraseGem
|
|
|
112
112
|
if proceed_with_upload
|
|
113
113
|
puts "Uploading #{file}..."
|
|
114
114
|
params = {
|
|
115
|
-
'auth_token'=>config.secret,
|
|
116
|
-
'filename'=> file,
|
|
115
|
+
'auth_token' => config.secret,
|
|
116
|
+
'filename' => file,
|
|
117
117
|
'file_content' => File.read(file)
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -123,7 +123,6 @@ module PhraseGem
|
|
|
123
123
|
request.set_form_data(params)
|
|
124
124
|
res = http.request(request)
|
|
125
125
|
|
|
126
|
-
dump_summary_to_file(res, file)
|
|
127
126
|
unless res.code.to_s =~ /^[23]/
|
|
128
127
|
print_server_error(res, file)
|
|
129
128
|
end
|
|
@@ -255,17 +254,6 @@ USAGE
|
|
|
255
254
|
puts "Dir.pwd: #{Dir.pwd}"
|
|
256
255
|
end
|
|
257
256
|
|
|
258
|
-
def dump_summary_to_file(res, upload_file)
|
|
259
|
-
::FileUtils.mkdir_p("phrase/uploads/")
|
|
260
|
-
timestamp = Time.now.strftime("%Y%m%m-%H%M%S")
|
|
261
|
-
file_name = "#{File.basename(upload_file)}-#{timestamp}"
|
|
262
|
-
summary_file = "phrase/uploads/#{file_name}.json"
|
|
263
|
-
File.open(summary_file, "w") do |file|
|
|
264
|
-
file.write(res.body)
|
|
265
|
-
end
|
|
266
|
-
puts "Summary saved in #{summary_file}"
|
|
267
|
-
end
|
|
268
|
-
|
|
269
257
|
def http_client(config)
|
|
270
258
|
http = Net::HTTP.new(config.api_host, config.api_port)
|
|
271
259
|
http.use_ssl = true if config.api_use_ssl == "1"
|
data/phrase.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: phrase
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,11 +9,11 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-06-
|
|
12
|
+
date: 2012-06-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &70240843846700 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ~>
|
|
@@ -21,7 +21,7 @@ dependencies:
|
|
|
21
21
|
version: '3.0'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements: *
|
|
24
|
+
version_requirements: *70240843846700
|
|
25
25
|
description: phrase allows you to edit translations inline, on the page itself. More
|
|
26
26
|
information at phraseapp.com
|
|
27
27
|
email:
|