xsort 1.1.2 → 1.2.0

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
  SHA1:
3
- metadata.gz: 71fab6aedfa35e0c20941c42bde65bd3f62b0e3f
4
- data.tar.gz: 97490c7261219084072fec5d63de153c60e6bd71
3
+ metadata.gz: 6a59b41f626586bfbb0b2f82f1462259fbb71486
4
+ data.tar.gz: cf4181b0f63e6fe24660c1ae5dd1836b865c63ca
5
5
  SHA512:
6
- metadata.gz: c55fdbbd78e278081e1c8c20f33ce7b5e39925cb78fdc54e24a1f9bc73fa589c305edd7d72b79c84d7f8959352b46c80ee5f9e0cf6bb2a8f107d721c50a832b6
7
- data.tar.gz: c8c86c46319dca98a4976b6ec2846cc4ceb0ac6290b3f859d12d143a7c35d890fd334bfc74ef7b927e55fda52f7f460af4352216ee814b71d4d7660a1e98b326
6
+ metadata.gz: 9aeca55f4adcc5f6393ee27e1d68ece7d56c4906b52cb7e677aa7eb7444d283cd519236409269b5df53bf595821a2f1ebe6cd7762b169a5d332c6f53166a5022
7
+ data.tar.gz: 1e729d9971dd93e39612ad422b9e74360d2fd8d16c8f61dc8c1049279c7dac790faaaf988b18cb7302187e20a67af63fb6f7eff10ae8364857f478afdb75f266
data/.gitignore CHANGED
@@ -5,6 +5,6 @@
5
5
  /pkg/
6
6
  /spec/reports/
7
7
  /tmp/
8
-
8
+ .DS_Store
9
9
  # rspec failure tracking
10
10
  .rspec_status
data/README.md CHANGED
@@ -74,7 +74,7 @@ xsort ./XcodeApps.xcodeproj
74
74
 
75
75
  ***You can sort them like the following image***
76
76
 
77
- <img src="https://github.com/keisukeYamagishi/xsort/blob/feature/add_doc/doc/result.png" width="50%" height="50%">
77
+ <img src="https://github.com/keisukeYamagishi/xsort/blob/master/doc/result.png" width="50%" height="50%">
78
78
 
79
79
 
80
80
 
@@ -1,3 +1,3 @@
1
1
  module Xsort
2
- VERSION = "1.1.2"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -1,3 +1,5 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/Pbxproj")
2
+
1
3
  module Xcodeproj
2
4
  module Pbxproj
3
5
  module PbxObject
@@ -10,6 +12,8 @@ module Xcodeproj
10
12
  def psort
11
13
 
12
14
  sorteds = Array.new
15
+ productPbx = ""
16
+
13
17
  @pbxs.each{ |pbx|
14
18
  # puts "parent PBX"
15
19
  # puts pbx.parentName
@@ -28,19 +32,24 @@ module Xcodeproj
28
32
  child = Array.new
29
33
  sort.each {|pbx|
30
34
 
31
- child.push(pbx.childPbx)
35
+ if pbx.name == "Products"
36
+ productPbx = pbx.childPbx
37
+ else
38
+ child.push(pbx.childPbx)
39
+ end
40
+ # child.push(pbx.childPbx)
32
41
  # puts pbx.uuid
33
42
  # puts pbx.name
34
43
  # ->> puts pbx.childPbx
35
44
  }
45
+
46
+ if productPbx.length != 0
47
+ child.push(productPbx)
48
+ productPbx = ""
49
+ end
50
+
36
51
  sorteds.push(childrenSort(pbx.pbxBase,child))
37
- # pbx.children.each {|pbx|
38
- #
39
- #
40
- # # puts pbx.uuid
41
- # # puts pbx.name
42
- # puts pbx.childPbx
43
- # }
52
+
44
53
  }
45
54
  return sorteds
46
55
  end
@@ -50,24 +59,24 @@ module Xcodeproj
50
59
  pbxSplit = children.split("\n")
51
60
  isPbxChild = false
52
61
  num = 0
53
- pbxSplit.each{|pbx_line|
62
+ pbxSplit.each{|pbxLine|
54
63
 
55
- if pbx_line.index(");")
64
+ if pbxLine.index(");")
56
65
  isPbxChild = false
57
66
  end
58
67
 
59
68
  if isPbxChild == true
60
- pbx_line = sort[num]
69
+ pbxLine = sort[num]
61
70
  num += 1
62
71
  else
63
- pbx_line << "\n"
72
+ pbxLine << "\n"
64
73
  end
65
74
 
66
75
  # Children
67
- if pbx_line.index("children = (")
76
+ if pbxLine.index("children = (")
68
77
  isPbxChild = true
69
78
  end
70
- pbx << pbx_line
79
+ pbx << pbxLine
71
80
  }
72
81
  return pbx
73
82
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsort
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - keisuke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-10 00:00:00.000000000 Z
11
+ date: 2018-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.16'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.16'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  description: Sort the file tree next to Xcode by file name.
@@ -60,9 +60,9 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
64
- - .rspec
65
- - .travis.yml
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
66
  - CODE_OF_CONDUCT.md
67
67
  - Gemfile
68
68
  - LICENSE.txt
@@ -87,17 +87,17 @@ require_paths:
87
87
  - lib
88
88
  required_ruby_version: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - '>='
90
+ - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
99
  rubyforge_project:
100
- rubygems_version: 2.0.14.1
100
+ rubygems_version: 2.4.5
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: Sort by file.