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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29a01c79309a2859ba3060dd919ffa7c9c132db85a257fb336dda4e9608402ee
4
- data.tar.gz: 68761d33a07ef20216e3893eb520a7fdf4f57e3b4ce2d26dfa45baef4700dce6
3
+ metadata.gz: c8a6813998f3505f0d331e04c263dbd774d930dfccb8427cbdb5e2d63cd0f95c
4
+ data.tar.gz: 9cd068595fc87fae2848a60edffec01b643d19a979e68a04af41394178f5cbff
5
5
  SHA512:
6
- metadata.gz: ef03aff3690f25b20f21ca61bd7ceca2d345f8578a67cd43ac303d94c5871438e3492d42760fb785be4b8503ca48fd16516ef069c7a88b95c9ef8685c96df5f0
7
- data.tar.gz: 4eeaae1535ae00260f31543c1228e677fc8f0afe24ca929ec5b71bef0c62313c95e829ed95321d966cb91a07e260069fa9303dcd37904bbcd781696741a85cd8
6
+ metadata.gz: 867831964a673527b7ad61b1630ed26b1c8f0de6f83b63215925b40b8a192f9fee62b956e7dcd6742858e1d44fedd97653b0ac9ee1848c95a9bf017e1e207141
7
+ data.tar.gz: 54176108087fee9abd768f5f8c3bceca020947e4fa32d0d71313996a317176d4f5e2f171162f3d7cd4b36c86e5397b6d14a51bca52acd670d084336c3c9e8e12
@@ -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 !Dir.exists?(content_dir_path)
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 !Dir.exists?(content_dir_path)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pixab
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
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.0
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-12 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2