xsort 1.4.2 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6190d37e0725742cb21f23eb17300b81919b676f64dab492d15097afe808ffca
4
- data.tar.gz: 42c1c57ead6ac1f8a6935a4355b374f3cb838087da0725bcc6677f9dc023c1b1
3
+ metadata.gz: 8798ebf3ececa61884bab0ede207df073f0d9f1d468ab2b015c905515dfdf5e2
4
+ data.tar.gz: d7b4f06a3167eb2c19a0d37708e29a27ac28423885036acacf183becfd2ce8cb
5
5
  SHA512:
6
- metadata.gz: 18a2f2149f7f0c23524eea0c6c9f288594e2d4300ab6fb0ad083b21de932dda809b56bacc733f74e96dde7c04c2aa9181479c84dcc2860583101879095e9bf48
7
- data.tar.gz: 2a6c38d99c519f458c9d982364bed67835f80fec907f212240fe2082d18ab0d4cc0b5574fc7db603a0dce10fabef161687a3dd405678cbdfba2549400d3b52c5
6
+ metadata.gz: 8e0a3a05204b7548fae03ba61932fe9d99bab3965117d32d01350eaeeda37c5e1cfe42c00edeb75a4977de8f2c7f3c982eaee441e08c9943d88b6c93f6801b37
7
+ data.tar.gz: 9d243c11b665d211d186d68b4c77f2a05d6e6ba8911788994047565b093e8e1279756525b49c815847b8e4b55ec3c3c68f9d2bcd6ae5451f222f774773453faa
@@ -0,0 +1,41 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ main ]
13
+ pull_request:
14
+ branches: [ main ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.3', '2.6']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
+ # uses: ruby/setup-ruby@v1
30
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34
+ - name: install bundler
35
+ run: gem install bundler
36
+ - name: bundle install
37
+ run: bundle install
38
+ - name: Run tests
39
+ run: bundle exec rspec
40
+ - name: Build gem
41
+ run: gem build xsort.gemspec
data/.gitignore CHANGED
@@ -9,6 +9,49 @@
9
9
  # rspec failure tracking
10
10
  *.rspec_status
11
11
  *.gem
12
- *.lock
13
12
  output.pbxproj
14
- .vscode/
13
+ .vscode/
14
+ Gemfile.lock
15
+
16
+ # Xcode
17
+ #
18
+ # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
19
+
20
+ ## Build generated
21
+ build/
22
+ DerivedData/
23
+
24
+ ## Various settings
25
+ *.pbxuser
26
+ !default.pbxuser
27
+ *.mode1v3
28
+ !default.mode1v3
29
+ *.mode2v3
30
+ !default.mode2v3
31
+ *.perspectivev3
32
+ !default.perspectivev3
33
+ xcuserdata/
34
+
35
+ ## Other
36
+ *.moved-aside
37
+ *.xccheckout
38
+ *.xcscmblueprint
39
+ *.xcuserstate
40
+
41
+ ## Obj-C/Swift specific
42
+ *.hmap
43
+ *.ipa
44
+ *.dSYM.zip
45
+ *.dSYM
46
+
47
+ ## Playgrounds
48
+ timeline.xctimeline
49
+ playground.xcworkspace
50
+
51
+ # Swift Package Manager
52
+ #
53
+ # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
54
+ # Packages/
55
+ # Package.pins
56
+ # Package.resolved
57
+ .build/
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ language: ruby
3
3
  rvm:
4
4
  - 2.3.7
5
5
  before_install:
6
- - gem install bundler -v 1.16.0
6
+ - gem install bundler
7
7
  - bundle install
8
8
 
9
9
  jobs:
File without changes
data/README.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  <img src="https://github.com/keisukeYamagishi/xsort/blob/master/doc/xsort.png" width="40%" height="40%">
4
4
 
5
-
6
- [![](https://img.shields.io/badge/twitter-brew__0__O-blue.svg)](https://twitter.com/brew_0_O)
5
+ [![](https://img.shields.io/badge/HP-shichimitoucarashi-00acee)](https://shichimitoucarashi.com/)
7
6
  [![](https://img.shields.io/badge/Language-Ruby-red.svg)](https://www.ruby-lang.org/ja/)
8
7
  [![](https://img.shields.io/apm/l/vim-mode.svg)](https://github.com/keisukeYamagishi/xsort/blob/master/LICENSE)
9
8
 
@@ -35,22 +34,16 @@ Download and install xsort with the following.
35
34
 
36
35
  ```
37
36
  $ mkdir gitrepo
38
-
39
37
  $ cd gitrepo
40
-
41
38
  $ git clone git@github.com:keisukeYamagishi/xsort.git
42
-
43
39
  ```
44
40
 
45
41
  ***Via https***: For those checking out sources as read-only, HTTPS works best:
46
42
 
47
43
  ```
48
44
  $ mkdir gitrepo
49
-
50
45
  $ cd gitrepo
51
-
52
46
  $ git clone https://github.com/keisukeYamagishi/xsort.git
53
-
54
47
  ```
55
48
 
56
49
  ## Usage
@@ -66,7 +59,6 @@ option:
66
59
  -r: Just only extracting output.pbxproj will not write to pbxproj of Xcode project so safty
67
60
 
68
61
  King Regards!
69
-
70
62
  ```
71
63
 
72
64
  # Hot fix ***********************
@@ -103,6 +95,8 @@ xsort ./XcodeApps.xcodeproj
103
95
 
104
96
  ## Use it
105
97
 
98
+ ***⚠️You should make a backup before you use it.⚠️***
99
+
106
100
  ```
107
101
  xsort ./XcodeApps.xcodeproj 
108
102
  ```
@@ -164,7 +158,6 @@ xsort ../App/App.xcodeproj -r
164
158
 
165
159
  ```
166
160
  ->> ./xsort -v
167
-
168
161
  Version: 1.4.0
169
162
  ```
170
163
 
data/bin/xsort CHANGED
@@ -29,8 +29,17 @@ def execute(option)
29
29
  puts "Version: #{Xsort::VERSION}"
30
30
  elsif option.path.index("project.pbxproj")
31
31
  # excute Xsort
32
- xsort = Xsort::Sortproj.new(option.path)
33
- xsort.sort(option.stdout,option.notOverwrite)
32
+ begin
33
+ Xsort::Sortproj.sort(option.path,option.stdout,option.notOverwrite)
34
+ rescue IOError => ioerr
35
+ puts "(*_*).oO Oh no Exception!"
36
+ puts "(*_*).oO reason: \e[31m#{ioerr.message}\e[0m"
37
+ rescue SystemCallError => sysCallErr
38
+ puts "\e[31m(*_*).oO Oh no Exception!\e[0m"
39
+ puts "\e[31m(*_*).oO Failuer! reason: \n#{sysCallErr.message}\e[0m"
40
+ else
41
+ puts "\e[36mXsort Successful (☝ ՞ਊ ՞)☝!!!\e[0m"
42
+ end
34
43
  else
35
44
  puts "(*_*).oO not pbxproj file"
36
45
  puts "(☝ ՞ਊ ՞)☝!!!must select pbxproj file(☝ ՞ਊ ՞)☝!!!"
data/lib/xsort/option.rb CHANGED
@@ -9,8 +9,9 @@
9
9
  #
10
10
  #===------------------------------------------------------------------(☝ ՞ਊ ՞)☝/
11
11
 
12
+ ##
12
13
  class Option
13
-
14
+ attr_accessor :options, :path, :stdout, :notOverwrite
14
15
  def initialize(argv)
15
16
  @stdout = false
16
17
  argvs = Array.new
@@ -24,7 +25,6 @@ class Option
24
25
  @path = ""
25
26
  argvs.each{|argv|
26
27
  if !argv.index(".xcodeproj")
27
-
28
28
  if argv == "-o"
29
29
  @stdout = true
30
30
  elsif argv == "-r"
@@ -45,23 +45,5 @@ class Option
45
45
  pbxproj << "/project.pbxproj"
46
46
  return pbxproj
47
47
  end
48
-
49
- end
50
-
51
- def options
52
- @options
53
- end
54
-
55
- def path
56
- @path
57
- end
58
-
59
- def stdout
60
- @stdout
61
48
  end
62
-
63
- def notOverwrite
64
- @notOverwrite
65
- end
66
-
67
49
  end
@@ -11,19 +11,21 @@
11
11
 
12
12
  module Xsort
13
13
  class Sortproj
14
-
15
- def initialize (path)
16
- @path = path
17
- end
18
-
19
- def sort (stdout,notOverwrite)
20
- puts @path
21
- pbxproj = Xcodeproj::Pbxproj::PbxObject::Pbxproj.new(@path,stdout)
22
- pbxproj.parse
23
- sort = Xcodeproj::Pbxproj::PbxObject::PbxSort.new(pbxproj.pbxGroups)
24
- pbxObject = sort.psort
25
- write = Xcodeproj::Pbxproj::PbxObject::PbxWrite.new(@path,pbxObject,stdout,notOverwrite)
26
- write.overWrite
14
+ include Xcodeproj::Pbxproj::PbxObject
15
+ def self.sort (path, stdout, notOverwrite)
16
+ puts path
17
+ begin
18
+ pbxproj = Pbxproj.new(path)
19
+ pbxproj.parse
20
+ sort = PbxSort.new(pbxproj.pbxGroups)
21
+ pbxObject = sort.psort
22
+ write = PbxWrite.new(path,pbxObject,stdout,notOverwrite)
23
+ write.overWrite
24
+ rescue IOError => error
25
+ raise error
26
+ rescue SystemCallError => error
27
+ raise error
28
+ end
27
29
  end
28
30
  end
29
- end
31
+ end
data/lib/xsort/version.rb CHANGED
@@ -10,5 +10,5 @@
10
10
  #===------------------------------------------------------------------(☝ ՞ਊ ՞)☝/
11
11
 
12
12
  module Xsort
13
- VERSION = "1.4.2"
13
+ VERSION = "1.4.3"
14
14
  end
@@ -12,9 +12,7 @@
12
12
  module Xcodeproj
13
13
  module Pbxproj
14
14
  module PbxObject
15
-
16
15
  class PbxWrite
17
-
18
16
  def initialize(path,pbx, stdout,write)
19
17
  @pbx = pbx
20
18
  @stdout = stdout
@@ -29,7 +27,6 @@ module Xcodeproj
29
27
  isPbxGroup = false
30
28
  pbxValue = ""
31
29
  num = 0
32
- isSuccess = true
33
30
  begin
34
31
  File.open(@path, "r") do |pbx|
35
32
  pbx.each_line do |pbx_line|
@@ -48,7 +45,6 @@ module Xcodeproj
48
45
  if pbx_line.index("/* Begin PBXGroup section */")
49
46
  isPbxGroup = true
50
47
  end
51
-
52
48
  pbxValue << pbx_line
53
49
  end
54
50
  end
@@ -59,16 +55,10 @@ module Xcodeproj
59
55
 
60
56
  writeFile(pbxValue)
61
57
 
62
- rescue IOError => ioerr
63
- isSuccess = false
64
- puts "Error \e[31m#{ioerr.message}\e[0m"
65
- rescue SystemCallError => sysCallErr
66
- isSuccess = false
67
- puts "Failuer! reason: \n\e[31m#{sysCallErr.message}\e[0m"
68
- puts "The entered path is invalid."
69
- end
70
- if isSuccess == true
71
- puts "\e[36mXsort Successful (☝ ՞ਊ ՞)☝!!!\e[0m"
58
+ rescue IOError => error
59
+ raise error
60
+ rescue SystemCallError => error
61
+ raise error
72
62
  end
73
63
  end
74
64
 
@@ -13,26 +13,11 @@ module Xcodeproj
13
13
  module Pbxproj
14
14
  module PbxObject
15
15
  class PbxGroup
16
-
16
+ attr_accessor :pbxBase, :children
17
17
  def initialize
18
18
  @pbxBase = ""
19
19
  @children = Array.new
20
20
  end
21
-
22
- def pbxBase
23
- @pbxBase
24
- end
25
-
26
- def setPbxBase(base)
27
- @pbxBase = base
28
- end
29
-
30
- def setChildren(pbx)
31
- @children.push(pbx)
32
- end
33
- def children
34
- @children
35
- end
36
21
  end
37
22
  end
38
23
  end
@@ -42,20 +27,11 @@ module Xcodeproj
42
27
  module Pbxproj
43
28
  module PbxObject
44
29
  class PbxChild
45
-
30
+ attr_accessor :name, :childPbx
46
31
  def initialize(name, childPbx)
47
32
  @name = name
48
33
  @childPbx = childPbx
49
34
  end
50
-
51
- def name
52
- @name
53
- end
54
-
55
- def childPbx
56
- @childPbx
57
- end
58
-
59
35
  end
60
36
  end
61
37
  end
@@ -65,10 +41,8 @@ module Xcodeproj
65
41
  module Pbxproj
66
42
  module PbxObject
67
43
  class Pbxproj
68
-
69
- def initialize(path, stdout)
44
+ def initialize(path)
70
45
  @path = path
71
- @stdout = stdout
72
46
  @pbxGroups = Array.new
73
47
  end
74
48
 
@@ -82,11 +56,6 @@ module Xcodeproj
82
56
  begin
83
57
  File.open(@path, "r") do |pbx|
84
58
  pbx.each_line do |pbx_line|
85
-
86
- if @stdout == true
87
- puts pbx_line
88
- end
89
-
90
59
  if pbx_line.index("/* End PBXGroup section */")
91
60
  isPbxGroup = false
92
61
  end
@@ -101,7 +70,7 @@ module Xcodeproj
101
70
  if isPbxChild == true
102
71
  name = Emurate.emurates(pbx_line)
103
72
  @child = Xcodeproj::Pbxproj::PbxObject::PbxChild.new(name,pbx_line)
104
- @group.setChildren(@child)
73
+ @group.children.push(@child)
105
74
  end
106
75
 
107
76
  # Children
@@ -121,7 +90,7 @@ module Xcodeproj
121
90
 
122
91
  if pbx_line.index("};")
123
92
  isPbxOneValue = false
124
- @group.setPbxBase(pbxValue)
93
+ @group.pbxBase = pbxValue
125
94
  @pbxGroups.push(@group)
126
95
  pbxValue = ""
127
96
  end
@@ -132,11 +101,10 @@ module Xcodeproj
132
101
  end
133
102
  end
134
103
  end
135
- rescue IOError => ioerr
136
- puts "Error #{ioerr.message}"
137
- rescue SystemCallError => sysCallErr
138
- puts "Failuer: reason #{sysCallErr.message}"
139
- puts "The entered path is invalid."
104
+ rescue IOError => error
105
+ raise error
106
+ rescue SystemCallError => error
107
+ raise error
140
108
  end
141
109
  end
142
110
 
data/xsort.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.16"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "rspec", "~> 3.0"
26
+ spec.add_development_dependency "bundler"
27
+ spec.add_development_dependency "rake"
28
+ spec.add_development_dependency "rspec"
29
29
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsort
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - keisuke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-16 00:00:00.000000000 Z
11
+ date: 2022-03-20 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
- version: '1.16'
19
+ version: '0'
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
- version: '1.16'
26
+ version: '0'
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
- version: '10.0'
33
+ version: '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
- version: '10.0'
40
+ version: '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
- version: '3.0'
47
+ version: '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
- version: '3.0'
54
+ version: '0'
55
55
  description: Sort the file tree next to Xcode by file name.
56
56
  email:
57
57
  - jam330157@gmail.com
@@ -60,13 +60,13 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - ".github/workflows/ruby.yml"
63
64
  - ".gitignore"
64
65
  - ".rspec"
65
66
  - ".travis.yml"
66
67
  - CODE_OF_CONDUCT.md
67
68
  - Gemfile
68
- - Gemfile.lock
69
- - LICENSE.txt
69
+ - LICENSE
70
70
  - README.md
71
71
  - Rakefile
72
72
  - bin/xsort
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: 2.5.2.3
100
100
  requirements: []
101
- rubygems_version: 3.0.3
101
+ rubygems_version: 3.0.3.1
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Sort by file.
data/Gemfile.lock DELETED
@@ -1,35 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- xsort (1.4.1)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- diff-lcs (1.3)
10
- rake (10.5.0)
11
- rspec (3.8.0)
12
- rspec-core (~> 3.8.0)
13
- rspec-expectations (~> 3.8.0)
14
- rspec-mocks (~> 3.8.0)
15
- rspec-core (3.8.0)
16
- rspec-support (~> 3.8.0)
17
- rspec-expectations (3.8.3)
18
- diff-lcs (>= 1.2.0, < 2.0)
19
- rspec-support (~> 3.8.0)
20
- rspec-mocks (3.8.0)
21
- diff-lcs (>= 1.2.0, < 2.0)
22
- rspec-support (~> 3.8.0)
23
- rspec-support (3.8.0)
24
-
25
- PLATFORMS
26
- ruby
27
-
28
- DEPENDENCIES
29
- bundler (~> 1.16)
30
- rake (~> 10.0)
31
- rspec (~> 3.0)
32
- xsort!
33
-
34
- BUNDLED WITH
35
- 1.17.2