poeditor-cli 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/poeditor.rb +1 -1
- data/lib/poeditor/commands/command.rb +21 -0
- data/lib/poeditor/commands/help_command.rb +1 -1
- data/lib/poeditor/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: b1e94ab1bbde4b5939430b32d2c5cbd537dba392
|
4
|
+
data.tar.gz: 650ca885078ab7e074ffa4573d10e20c624cc856
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5c64af04bd704eb94f65f24e58fa477475b7c387c950d539b476692e600e209a37e77ae161ad8a874a96ef23c34c9ff6a5dccdda26251f023feeace86c23134
|
7
|
+
data.tar.gz: ea9df75df5d5f10fa3b7964864e2c1d77e3a2e94ac591c033c0ef5456334d2a443f1d722e2ee24065acf878bae9fb498d6a97115cc1249d108efe2aaca2cc870
|
data/README.md
CHANGED
@@ -9,10 +9,10 @@ Command line application for [POEditor](https://poeditor.com).
|
|
9
9
|
|
10
10
|
## Features
|
11
11
|
|
12
|
-
* Exporting translation files directly from POEditor to your project directory
|
13
|
-
* Mapping translation directory dynamically
|
14
|
-
* Replacing `%s` with `%@` for Apple strings
|
15
|
-
* We use it
|
12
|
+
* 📚 Exporting translation files directly from POEditor to your project directory
|
13
|
+
* 🎲 Mapping translation directory dynamically
|
14
|
+
* 🍎 Replacing `%s` with `%@` for Apple strings
|
15
|
+
* 📦 We use it in our products
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
|
data/lib/poeditor.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'net/http'
|
3
|
+
|
1
4
|
module POEditor
|
2
5
|
class Command
|
3
6
|
# The entry point of the CLI application
|
4
7
|
def self.run(argv)
|
5
8
|
UI.enabled = true
|
9
|
+
self.check_update
|
6
10
|
command = self.command_class(argv).new
|
7
11
|
begin
|
8
12
|
command.run(argv)
|
@@ -21,5 +25,22 @@ module POEditor
|
|
21
25
|
HelpCommand
|
22
26
|
end
|
23
27
|
end
|
28
|
+
|
29
|
+
def self.check_update
|
30
|
+
begin
|
31
|
+
uri = URI("https://api.github.com"\
|
32
|
+
"/repos/StyleShare/poeditor-cli/releases/latest")
|
33
|
+
data = JSON(Net::HTTP.get(uri))
|
34
|
+
latest = data["tag_name"]
|
35
|
+
if Gem::Version.new(VERSION) < Gem::Version.new(latest)
|
36
|
+
UI.puts %{\
|
37
|
+
poeditor-cli #{latest} is available. (You're using #{VERSION})
|
38
|
+
To update: `$ gem install poeditor-cli`
|
39
|
+
Changelog: https://github.com/StyleShare/poeditor-cli/releases\
|
40
|
+
}.green
|
41
|
+
end
|
42
|
+
rescue
|
43
|
+
end
|
44
|
+
end
|
24
45
|
end
|
25
46
|
end
|
data/lib/poeditor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poeditor-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Suyeol Jeon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|