rubisc 0.2.2 → 0.2.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/xcodeproj-scan +13 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ee40c20cbed19c823fccbfcbb8da78f37fb264a
4
- data.tar.gz: ef18a6034a33a81f3f93376686d70c0fe74d1606
3
+ metadata.gz: eedf13ecdac2902231403b087e74470eea1fb6b6
4
+ data.tar.gz: cfc6111bef3c6b7dfa052b90f5645f2f3c8dfab2
5
5
  SHA512:
6
- metadata.gz: d73f675994146b97cfca7bd923740470cc25927703b749ce03f807db3a5ec8669f4c7e0c9834ddd705eef01c14d45919fe8fa6ea98f7cc534bc3c4499915a74a
7
- data.tar.gz: 0393271412115cfa812a26899bfa8351fc1ad18a05461f27d9244998bca195afe2ae873271344fea556a140ab4b64dc8088b05605eeae9b39c79bc9f3785b14a
6
+ metadata.gz: 1a2ca06f49c91ef5c553847e9b9425aea856ee8aa2e974ccc4e183388a9c1012025295356179e9488d71ac519e5702a5d8f23fe7b5b47ee5f580573db2a5b099
7
+ data.tar.gz: 70e35c5b27712635ead3ee7a887a98949af01cb0296fe3941974cf5a16afa84a42fe5031ebff71f1225b273406a1e5fcc59b6fd41627c419a1355cb932be2da6
@@ -3,12 +3,12 @@
3
3
  require File.join(File.dirname(__FILE__), '..', 'lib','fileutil')
4
4
 
5
5
  unless ARGV[0] and ARGV[1]
6
- puts "Usage: xcodeproj_scan <path_to_xcodeproj> <project_directory>"
7
- puts "Example: xcodeproj_scan /Users/rubisc/Proj/Proj.xcodeproj /Users/rubisc/Proj"
6
+ puts "Usage: xcodeproj_scan <path_to_xcodeproj> <project_directory> <file_extension>"
7
+ puts "Example: xcodeproj_scan /Users/rubisc/Proj/Proj.xcodeproj /Users/rubisc/Proj xib"
8
8
  exit
9
9
  end
10
10
  unless File.exist? ARGV[0]
11
- puts "#{ARGV[0]} does not exist."
11
+ puts "#{ARGV[0]} does not exist."
12
12
  puts "Please provide the path to .xcodeproj file."
13
13
  exit
14
14
  end
@@ -19,24 +19,29 @@ end
19
19
 
20
20
  pbxproj="#{ARGV[0]}/project.pbxproj"
21
21
  projdir=ARGV[1]
22
+ suffix=ARGV[2]
22
23
 
23
- def scan pbx,dir
24
+ def scan pbx,dir,suffix
24
25
  if dir!="." and dir!=".." and
25
26
  if File.directory?(dir)
26
27
  Dir.entries(dir).each do |sub|
27
28
  if sub!="." and sub!=".."
28
- scan pbx,"#{dir}/#{sub}"
29
+ scan pbx,"#{dir}/#{sub}",suffix
29
30
  end
30
31
  end
31
32
  else
32
33
  match =dir.match /\/([^\/]*$)/
33
34
  filename=match[1]
34
- return if ['.DS_Store','Contents.json','project.pbxproj'].include? filename or filename.match /.*\.(xcworkspacedata|xcuserstate|xcscheme|xcbkptlist|md)/
35
- puts "#{filename} not used" unless pbx.match filename
35
+ if suffix
36
+ return unless filename.match suffix
37
+ else
38
+ return if ['.DS_Store','Contents.json','project.pbxproj'].include? filename or filename.match /.*\.(xcworkspacedata|xcuserstate|xcscheme|xcbkptlist|md)/
39
+ end
40
+ puts "#{filename} not used" unless pbx.match /isa.*=.*PBXBuildFile[^\}]*#{filename}/
36
41
  end
37
42
  end
38
43
  end
39
44
 
40
45
  Rubisc::FileUtil::process_file pbxproj,false do |content|
41
- scan content,projdir
46
+ scan content,projdir,suffix
42
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubisc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - luqyluqe