lingohub 0.6.0 → 0.7.0
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/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/lingohub/commands/auth.rb +1 -1
- data/lib/lingohub/commands/base.rb +1 -32
- data/lib/lingohub/models/project.rb +1 -1
- data/lib/lingohub/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e120beb1aae7f2679e0fc7403357579c9b077bfad7dd7346cc1ac2727405ff23
|
4
|
+
data.tar.gz: d85ea619fed1f1d1b4d9aa2ede5c8fa8b0666a9b8e976cc9b644302619b76b15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df76167cb4d5b9c16908806aa7342707717da80ade757c754d57481267203f989ee493270339e743953bf7d11174cde670316108c791b0e9b64ff17662c533c2
|
7
|
+
data.tar.gz: 78686562a4e83423113c9443b24c30093e18d1904e15fecdf1dbe752deeca42de943f242e1675025ea755820e55d10c30c98eecb4c87cdb9d838df897c889338
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,7 @@ module Lingohub::Command
|
|
20
20
|
def project_title(force=true)
|
21
21
|
project_title = extract_project_title_from_args
|
22
22
|
unless project_title
|
23
|
-
project_title =
|
23
|
+
project_title = extract_project_title_from_dir_name ||
|
24
24
|
raise(CommandFailed, "No project specified.\nRun this command from project folder or set it adding --project <title>") if force
|
25
25
|
@autodetected_project_name = true
|
26
26
|
end
|
@@ -38,42 +38,11 @@ module Lingohub::Command
|
|
38
38
|
File.basename(dir)
|
39
39
|
end
|
40
40
|
|
41
|
-
def extract_project_title_from_git
|
42
|
-
dir = Dir.pwd
|
43
|
-
return unless remotes = git_remotes(dir)
|
44
|
-
|
45
|
-
if remote = extract_option('--remote')
|
46
|
-
remotes[remote]
|
47
|
-
elsif remote = extract_app_from_git_config
|
48
|
-
remotes[remote]
|
49
|
-
else
|
50
|
-
apps = remotes.values.uniq
|
51
|
-
return apps.first if apps.size == 1
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
41
|
def extract_app_from_git_config
|
56
42
|
remote = git("config heroku.remote")
|
57
43
|
remote == "" ? nil : remote
|
58
44
|
end
|
59
45
|
|
60
|
-
def git_remotes(base_dir=Dir.pwd)
|
61
|
-
remotes = { }
|
62
|
-
original_dir = Dir.pwd
|
63
|
-
Dir.chdir(base_dir)
|
64
|
-
|
65
|
-
# TODO
|
66
|
-
# git("remote -v").split("\n").each do |remote|
|
67
|
-
# name, url, method = remote.split(/\s/)
|
68
|
-
# if url =~ /^git@#{heroku.host}:([\w\d-]+)\.git$/
|
69
|
-
# remotes[name] = $1
|
70
|
-
# end
|
71
|
-
# end
|
72
|
-
|
73
|
-
Dir.chdir(original_dir)
|
74
|
-
remotes
|
75
|
-
end
|
76
|
-
|
77
46
|
def extract_option(options, default=true)
|
78
47
|
values = options.is_a?(Array) ? options : [options]
|
79
48
|
return unless opt_index = args.select { |a| values.include? a }.first
|
@@ -51,7 +51,7 @@ module Lingohub
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def upload_resource(file, locale, strategy_parameters = {}, path)
|
54
|
-
raise "Path #{file} does not exists" unless File.
|
54
|
+
raise "Path #{file} does not exists" unless File.exist?(file)
|
55
55
|
request = { :file => File.new(file, "rb") }
|
56
56
|
request.merge!({ :iso2_slug => locale }) if locale
|
57
57
|
request.merge!({ :path => path }) if path
|
data/lib/lingohub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lingohub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lingohub GmbH
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -99,7 +99,7 @@ files:
|
|
99
99
|
homepage: https://lingohub.com
|
100
100
|
licenses: []
|
101
101
|
metadata: {}
|
102
|
-
post_install_message:
|
102
|
+
post_install_message:
|
103
103
|
rdoc_options: []
|
104
104
|
require_paths:
|
105
105
|
- lib
|
@@ -114,9 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
|
118
|
-
|
119
|
-
signing_key:
|
117
|
+
rubygems_version: 3.2.3
|
118
|
+
signing_key:
|
120
119
|
specification_version: 4
|
121
120
|
summary: Client library and command-line tool to translate Ruby based apps with lingohub.
|
122
121
|
test_files: []
|