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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f526eb29ffd5471eb185332e0a3a9075635f2275
4
- data.tar.gz: 730f23f3dbfa994a430723d5f7dfd6d432b38e70
3
+ metadata.gz: b1e94ab1bbde4b5939430b32d2c5cbd537dba392
4
+ data.tar.gz: 650ca885078ab7e074ffa4573d10e20c624cc856
5
5
  SHA512:
6
- metadata.gz: 3a95933ca88a7f5dec3d293d3c5307248523207415a9d961491fffbe015d6b3e218acf00153b17ee9843ec0483445aad57b6eabb7e22089d96ecd19e52197066
7
- data.tar.gz: 780ae598ca75d225af5ff1348fe11df038d9602aa414b4ff932c293946dede7b6d030a23806f77724ec760f713f87693c502dae541ac4e63931fe3f82d3775b0
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 on our products
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
 
@@ -4,7 +4,7 @@ require "shellwords"
4
4
  require "yaml"
5
5
 
6
6
  module POEditor
7
- autoload :Version, "poeditor/version"
7
+ autoload :VERSION, "poeditor/version"
8
8
  autoload :Exception, "poeditor/exception"
9
9
  autoload :UI, "poeditor/ui"
10
10
 
@@ -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
@@ -1,7 +1,7 @@
1
1
  module POEditor
2
2
  class HelpCommand
3
3
  def run(argv)
4
- puts "Usage: poeditor [pull|help]"
4
+ puts "Usage: poeditor pull"
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module POEditor
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.1
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-02 00:00:00.000000000 Z
11
+ date: 2017-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize