replace_class 1.0.2 → 1.0.3
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/replace_class.rb +14 -2
- data/replace_class.gemspec +2 -2
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc6ac194a07f92ec17bd5075113f3f4e51a6f580
|
4
|
+
data.tar.gz: 21a105ed9785145115887a88d29fd4bd90d2617e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1064c37fffce2bf5697f5e06077b37fe8aae75398fdcb7b0451eb463598ad396b942c7cd4778d38723171cdb858fc8cc6a01dd61719e503d37b21a987cb4768a
|
7
|
+
data.tar.gz: c43798e38c05c08690e42d9a24543169dca289eae815d8a5667421f01fdf52b442a5c24cf10928f50765925e07831b103c92323e1165be57a730e2ec3ebbeeda
|
data/lib/replace_class.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
#!/usr/bin/ruby -w
|
2
2
|
|
3
|
-
require 'pathname'
|
4
3
|
require 'optparse'
|
5
4
|
|
6
5
|
# option parse
|
@@ -35,6 +34,14 @@ if !@options.has_key?(:source) || !@options.has_key?(:dest)
|
|
35
34
|
exit false
|
36
35
|
end
|
37
36
|
|
37
|
+
# check project file when no path
|
38
|
+
if ARGV.empty? then
|
39
|
+
if Dir["*.xcodeproj"].empty? then
|
40
|
+
puts "current directory have not a filename end with 'xcodeproj'"
|
41
|
+
exit false
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
38
45
|
# define
|
39
46
|
@valid_file_type = [".h", ".m", ".pbxproj",".swift"]
|
40
47
|
@ignore_dir = ["Pods", "DerivedData"]
|
@@ -117,6 +124,11 @@ def checkDir(dir)
|
|
117
124
|
end
|
118
125
|
|
119
126
|
# perform
|
120
|
-
|
127
|
+
if ARGV.empty? then
|
128
|
+
src_root = File.expand_path('../', __FILE__)
|
129
|
+
else
|
130
|
+
src_root File.expand_path(ARGV.last)
|
131
|
+
end
|
132
|
+
|
121
133
|
checkDir(src_root)
|
122
134
|
|
data/replace_class.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "replace_class"
|
6
|
-
s.version = "1.0.
|
6
|
+
s.version = "1.0.3"
|
7
7
|
|
8
8
|
s.require_paths = ["lib"]
|
9
9
|
s.authors = ["MickeyHub"]
|
@@ -14,5 +14,5 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.licenses = ["MIT"]
|
15
15
|
s.summary = "An Neat Script to Replace Class Name Globally for Xcode"
|
16
16
|
s.description = "easy way to replace class name in xcode using ruby"
|
17
|
-
s.executables =
|
17
|
+
s.executables = s.files.grep(%(^bin/))
|
18
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: replace_class
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MickeyHub
|
@@ -13,8 +13,7 @@ dependencies: []
|
|
13
13
|
description: easy way to replace class name in xcode using ruby
|
14
14
|
email:
|
15
15
|
- 791331313@qq.com
|
16
|
-
executables:
|
17
|
-
- replace_class
|
16
|
+
executables: []
|
18
17
|
extensions: []
|
19
18
|
extra_rdoc_files: []
|
20
19
|
files:
|