pixab 1.3.0 → 1.3.1
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/lib/LocalizationPlatform.rb +3 -2
- data/lib/Utilities.rb +13 -1
- data/lib/pixab/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8a6813998f3505f0d331e04c263dbd774d930dfccb8427cbdb5e2d63cd0f95c
|
4
|
+
data.tar.gz: 9cd068595fc87fae2848a60edffec01b643d19a979e68a04af41394178f5cbff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 867831964a673527b7ad61b1630ed26b1c8f0de6f83b63215925b40b8a192f9fee62b956e7dcd6742858e1d44fedd97653b0ac9ee1848c95a9bf017e1e207141
|
7
|
+
data.tar.gz: 54176108087fee9abd768f5f8c3bceca020947e4fa32d0d71313996a317176d4f5e2f171162f3d7cd4b36c86e5397b6d14a51bca52acd670d084336c3c9e8e12
|
data/lib/LocalizationPlatform.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# encoding: UTF-8
|
3
3
|
|
4
4
|
require "fileutils"
|
5
|
+
require_relative './Utilities.rb'
|
5
6
|
|
6
7
|
module Pixab
|
7
8
|
|
@@ -54,7 +55,7 @@ module Pixab
|
|
54
55
|
|
55
56
|
localized_info_category.each do |locale, localized_infos|
|
56
57
|
content_dir_path = dir_name(locale)
|
57
|
-
if !
|
58
|
+
if !Utilities.dir_exist(content_dir_path)
|
58
59
|
FileUtils.mkdir_p content_dir_path
|
59
60
|
end
|
60
61
|
content_file_path = "#{content_dir_path}/#{File_name}"
|
@@ -118,7 +119,7 @@ module Pixab
|
|
118
119
|
end
|
119
120
|
|
120
121
|
content_dir_path = dir_name(locale)
|
121
|
-
if !
|
122
|
+
if !Utilities.dir_exist(content_dir_path)
|
122
123
|
FileUtils.mkdir_p content_dir_path
|
123
124
|
end
|
124
125
|
content_file_path = "#{content_dir_path}/#{File_name}"
|
data/lib/Utilities.rb
CHANGED
@@ -11,7 +11,6 @@ module Pixab
|
|
11
11
|
|
12
12
|
class << Utilities
|
13
13
|
|
14
|
-
|
15
14
|
def is_shell_execute_success(success = nil)
|
16
15
|
is_success = success.nil? ? $?.to_i == 0 : success
|
17
16
|
return is_success
|
@@ -80,5 +79,18 @@ module Pixab
|
|
80
79
|
end
|
81
80
|
|
82
81
|
end
|
82
|
+
|
83
|
+
class << Utilities
|
84
|
+
|
85
|
+
# 判断目录是否存在,已适配2.4以后的版本
|
86
|
+
def dir_exist(path)
|
87
|
+
if Dir.respond_to?(:exist?)
|
88
|
+
return Dir.exist?(path)
|
89
|
+
else
|
90
|
+
return Dir.exists?(path)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
83
95
|
|
84
96
|
end
|
data/lib/pixab/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pixab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 廖再润
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored2
|