synx 0.0.61 → 0.1.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 +4 -4
- data/README.md +5 -6
- data/lib/synx/project.rb +6 -8
- data/lib/synx/version.rb +1 -1
- data/lib/synx/xcodeproj_ext/project/object/pbx_group.rb +15 -0
- data/spec/synx/expected_group_structure.yml +14 -13
- data/spec/synx/project_spec.rb +5 -3
- data/synx.gemspec +1 -1
- metadata +23 -23
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 10c43f35ee30b2df933b75f0c688bce5a444ec92
         | 
| 4 | 
            +
              data.tar.gz: 4ef3bb91d86404cf63fed5e99c11c836a3c30b2b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 57fe510721e42fac4126f9fe4c4389ad2a9823614a0a771a480d4f7eaec542d15a00119cd44a568e47b71f83a1f0e5ebab88434e49c534e04576bb635aa38569
         | 
| 7 | 
            +
              data.tar.gz: 80e8a96b519869da76d2be8bf5eb81f11d80d145b9524cd6148385484626d6cb14b54568d8387614d503aebd079014dfe0e7afc4fa882dc2348c08b456ea23ce
         | 
    
        data/README.md
    CHANGED
    
    | @@ -22,14 +22,13 @@ A command-line tool that reorganizes your Xcode project folder to match your Xco | |
| 22 22 | 
             
            ## Usage
         | 
| 23 23 |  | 
| 24 24 | 
             
            ### Basic
         | 
| 25 | 
            -
             | 
| 26 | 
            -
            **WARNING: Make sure that your project is backed up through source control before doing anything**
         | 
| 25 | 
            +
            :warning: **WARNING: Make sure that your project is backed up through source control before doing anything** :warning:
         | 
| 27 26 |  | 
| 28 27 | 
             
            Execute the command on your project to have it reorganize the files on the file system:
         | 
| 29 28 |  | 
| 30 29 | 
             
                 $ synx path/to/my/project.xcodeproj
         | 
| 31 30 |  | 
| 32 | 
            -
            It may have confused  | 
| 31 | 
            +
            It may have confused CocoaPods. If you use them, execute this command:
         | 
| 33 32 |  | 
| 34 33 | 
             
                $ pod install
         | 
| 35 34 |  | 
| @@ -40,18 +39,18 @@ You're good to go! | |
| 40 39 | 
             
            Synx supports the following options:
         | 
| 41 40 |  | 
| 42 41 | 
             
            ```
         | 
| 43 | 
            -
              --prune, -p                   remove source files and image resources that are not referenced by the the  | 
| 42 | 
            +
              --prune, -p                   remove source files and image resources that are not referenced by the the Xcode project
         | 
| 44 43 | 
             
              --no-color                    removes all color from the output
         | 
| 45 44 | 
             
              --no-default-exclusions       doesn't use the default exclusions of /Libraries, /Frameworks, and /Products
         | 
| 46 45 | 
             
              --quiet, -q                   silence all output
         | 
| 47 46 | 
             
              --exclusion, -e EXCLUSION     ignore an Xcode group while syncing
         | 
| 48 47 | 
             
            ```
         | 
| 49 48 |  | 
| 50 | 
            -
             | 
| 49 | 
            +
            For example, OCMock could have been organized using this command:
         | 
| 51 50 |  | 
| 52 51 | 
             
                $ synx -p -e "/OCMock/Core Mocks" -e /OCMockTests Source/OCMock.xcodeproj/
         | 
| 53 52 |  | 
| 54 | 
            -
            if they wanted to  | 
| 53 | 
            +
            if they had wanted not to sync the `/OCMock/Core Mocks` and `/OCMockTests` groups, and also remove (`-p`) any image/source files found by synx that weren't referenced by any groups in Xcode.
         | 
| 55 54 |  | 
| 56 55 | 
             
            ## Contributing
         | 
| 57 56 |  | 
    
        data/lib/synx/project.rb
    CHANGED
    
    | @@ -21,6 +21,7 @@ module Synx | |
| 21 21 | 
             
                  Synx::Tabber.puts "\n\n"
         | 
| 22 22 | 
             
                  Synx::Tabber.puts "Syncing files that are not included in Xcode project..".bold.white
         | 
| 23 23 | 
             
                  main_group.all_groups.each(&:move_entries_not_in_xcodeproj)
         | 
| 24 | 
            +
                  main_group.sort_by_name
         | 
| 24 25 | 
             
                  transplant_work_project
         | 
| 25 26 | 
             
                  Synx::Tabber.decrease
         | 
| 26 27 | 
             
                  save
         | 
| @@ -67,7 +68,7 @@ module Synx | |
| 67 68 | 
             
                end
         | 
| 68 69 |  | 
| 69 70 | 
             
                def work_root_pathname
         | 
| 70 | 
            -
                  if @work_root_pathname | 
| 71 | 
            +
                  if @work_root_pathname
         | 
| 71 72 | 
             
                    @work_root_pathname
         | 
| 72 73 | 
             
                  else
         | 
| 73 74 | 
             
                    @work_root_pathname = Pathname(File.join(SYNXRONIZE_DIR, root_pathname.basename.to_s))
         | 
| @@ -111,17 +112,14 @@ module Synx | |
| 111 112 |  | 
| 112 113 | 
             
                def has_object_for_pathname?(pathname)
         | 
| 113 114 | 
             
                  @unmodified_project ||= Synx::Project.open(path)
         | 
| 114 | 
            -
                  @unmodified_project.objects.any? do |o| | 
| 115 | 
            +
                  @unmodified_project.objects.any? do |o|
         | 
| 115 116 | 
             
                    begin
         | 
| 116 | 
            -
                      o.real_path.cleanpath == pathname.cleanpath | 
| 117 | 
            -
                    rescue | 
| 118 | 
            -
                      false | 
| 117 | 
            +
                      o.real_path.cleanpath == pathname.cleanpath
         | 
| 118 | 
            +
                    rescue
         | 
| 119 | 
            +
                      false
         | 
| 119 120 | 
             
                    end
         | 
| 120 121 | 
             
                  end
         | 
| 121 122 | 
             
                end
         | 
| 122 | 
            -
             | 
| 123 123 | 
             
              end
         | 
| 124 124 | 
             
            end
         | 
| 125 125 |  | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
    
        data/lib/synx/version.rb
    CHANGED
    
    
| @@ -24,6 +24,7 @@ module Xcodeproj | |
| 24 24 | 
             
                          group.sync(self)
         | 
| 25 25 | 
             
                        end
         | 
| 26 26 | 
             
                        sync_path
         | 
| 27 | 
            +
                        sort_by_name
         | 
| 27 28 |  | 
| 28 29 | 
             
                        Synx::Tabber.decrease
         | 
| 29 30 | 
             
                      end
         | 
| @@ -33,6 +34,20 @@ module Xcodeproj | |
| 33 34 | 
             
                      project.group_exclusions.include?(hierarchy_path)
         | 
| 34 35 | 
             
                    end
         | 
| 35 36 |  | 
| 37 | 
            +
                    def sort_by_name
         | 
| 38 | 
            +
                      children.sort! do |x, y|
         | 
| 39 | 
            +
                        if x.isa == 'PBXGroup' && !(y.isa == 'PBXGroup')
         | 
| 40 | 
            +
                          -1
         | 
| 41 | 
            +
                        elsif !(x.isa == 'PBXGroup') && y.isa == 'PBXGroup'
         | 
| 42 | 
            +
                          1
         | 
| 43 | 
            +
                        elsif x.display_name && y.display_name
         | 
| 44 | 
            +
                          x.display_name <=> y.display_name
         | 
| 45 | 
            +
                        else
         | 
| 46 | 
            +
                          0
         | 
| 47 | 
            +
                        end
         | 
| 48 | 
            +
                      end
         | 
| 49 | 
            +
                    end
         | 
| 50 | 
            +
             | 
| 36 51 | 
             
                    def move_entries_not_in_xcodeproj
         | 
| 37 52 | 
             
                      if excluded_from_sync?
         | 
| 38 53 | 
             
                        Synx::Tabber.puts "#{basename}/ (excluded)".yellow
         | 
| @@ -1,8 +1,6 @@ | |
| 1 | 
            +
            Frameworks:
         | 
| 2 | 
            +
            Products:
         | 
| 1 3 | 
             
            dummy:
         | 
| 2 | 
            -
              FolderWithGroupNotLinked:
         | 
| 3 | 
            -
                  data.json:
         | 
| 4 | 
            -
              Resources:
         | 
| 5 | 
            -
                image.png:
         | 
| 6 4 | 
             
              AlreadySynced:
         | 
| 7 5 | 
             
                Core Data.xcdatamodeld:
         | 
| 8 6 | 
             
                  Core Data.xcdatamodel:
         | 
| @@ -17,25 +15,28 @@ dummy: | |
| 17 15 | 
             
                NSObject+abc.m:
         | 
| 18 16 | 
             
                Woot.h:
         | 
| 19 17 | 
             
                Woot.m:
         | 
| 18 | 
            +
              FolderWithGroupNotLinked:
         | 
| 19 | 
            +
                  data.json:
         | 
| 20 20 | 
             
              GroupThatDoubleReferencesFile:
         | 
| 21 21 | 
             
                ManyFiles.h:
         | 
| 22 22 | 
             
                ManyFiles.m:
         | 
| 23 | 
            -
               | 
| 24 | 
            -
                 | 
| 25 | 
            -
                en.lproj:
         | 
| 26 | 
            -
                  Localizable.strings:
         | 
| 27 | 
            -
              dummy.h:
         | 
| 28 | 
            -
              dummy.m:
         | 
| 23 | 
            +
              Resources:
         | 
| 24 | 
            +
                image.png:
         | 
| 29 25 | 
             
              SuchGroup:
         | 
| 30 | 
            -
                Wow.h:
         | 
| 31 | 
            -
                Wow.m:
         | 
| 32 26 | 
             
                VeryChildGroup:
         | 
| 33 27 | 
             
                  Wowwww.h:
         | 
| 34 28 | 
             
                  Wowwww.m:
         | 
| 29 | 
            +
                Wow.h:
         | 
| 30 | 
            +
                Wow.m:
         | 
| 31 | 
            +
              Supporting Files:
         | 
| 32 | 
            +
                Localizable.strings:
         | 
| 33 | 
            +
                dummy-Prefix.pch:
         | 
| 34 | 
            +
              dummy.h:
         | 
| 35 | 
            +
              dummy.m:
         | 
| 35 36 | 
             
            dummyTests:
         | 
| 36 37 | 
             
              Other Files:
         | 
| 37 38 | 
             
                InfoPlist.strings:
         | 
| 38 39 | 
             
              Supporting Files:
         | 
| 39 | 
            -
                dummyTests-Prefix.pch:
         | 
| 40 40 | 
             
                dummyTests-Info.plist:
         | 
| 41 | 
            +
                dummyTests-prefix.pch:
         | 
| 41 42 | 
             
              dummyTests.m:
         | 
    
        data/spec/synx/project_spec.rb
    CHANGED
    
    | @@ -32,10 +32,12 @@ describe Synx::Project do | |
| 32 32 | 
             
              describe "#sync" do
         | 
| 33 33 |  | 
| 34 34 | 
             
                def verify_group_structure(group, expected_structure)
         | 
| 35 | 
            -
                  expected_structure. | 
| 35 | 
            +
                  expected_structure.each_with_index do |(object_name, object_children), index|
         | 
| 36 36 | 
             
                    failure_message = "expected group `#{group.basename}` to have child `#{object_name}`"
         | 
| 37 | 
            -
                    object = group.children | 
| 37 | 
            +
                    object = group.children[index]
         | 
| 38 | 
            +
                    expect(object.basename).to eq(object_name)
         | 
| 38 39 | 
             
                    expect(group).to_not be_nil, failure_message
         | 
| 40 | 
            +
                    next if ["Products", "Frameworks"].include?(object.display_name)
         | 
| 39 41 |  | 
| 40 42 | 
             
                    if object.instance_of?(Xcodeproj::Project::Object::PBXGroup)
         | 
| 41 43 | 
             
                      object_children ||= {}
         | 
| @@ -235,4 +237,4 @@ describe Synx::Project do | |
| 235 237 | 
             
                  expect(value).to eq(expected)
         | 
| 236 238 | 
             
                end
         | 
| 237 239 | 
             
              end
         | 
| 238 | 
            -
            end
         | 
| 240 | 
            +
            end
         | 
    
        data/synx.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,113 +1,113 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: synx
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0 | 
| 4 | 
            +
              version: 0.1.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Mark Larsen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2015- | 
| 11 | 
            +
            date: 2015-08-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.6'
         | 
| 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.6'
         | 
| 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.3'
         | 
| 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.3'
         | 
| 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: '2.14'
         | 
| 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: '2.14'
         | 
| 55 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 56 | 
             
              name: pry
         | 
| 57 57 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 58 | 
             
                requirements:
         | 
| 59 | 
            -
                - - ~>
         | 
| 59 | 
            +
                - - "~>"
         | 
| 60 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 61 | 
             
                    version: '0.9'
         | 
| 62 62 | 
             
              type: :development
         | 
| 63 63 | 
             
              prerelease: false
         | 
| 64 64 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 65 | 
             
                requirements:
         | 
| 66 | 
            -
                - - ~>
         | 
| 66 | 
            +
                - - "~>"
         | 
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 68 | 
             
                    version: '0.9'
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 70 | 
             
              name: clamp
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 72 | 
             
                requirements:
         | 
| 73 | 
            -
                - - ~>
         | 
| 73 | 
            +
                - - "~>"
         | 
| 74 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 75 | 
             
                    version: '0.6'
         | 
| 76 76 | 
             
              type: :runtime
         | 
| 77 77 | 
             
              prerelease: false
         | 
| 78 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 79 | 
             
                requirements:
         | 
| 80 | 
            -
                - - ~>
         | 
| 80 | 
            +
                - - "~>"
         | 
| 81 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 82 | 
             
                    version: '0.6'
         | 
| 83 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 84 | 
             
              name: colorize
         | 
| 85 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 86 | 
             
                requirements:
         | 
| 87 | 
            -
                - - ~>
         | 
| 87 | 
            +
                - - "~>"
         | 
| 88 88 | 
             
                  - !ruby/object:Gem::Version
         | 
| 89 89 | 
             
                    version: '0.7'
         | 
| 90 90 | 
             
              type: :runtime
         | 
| 91 91 | 
             
              prerelease: false
         | 
| 92 92 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 93 | 
             
                requirements:
         | 
| 94 | 
            -
                - - ~>
         | 
| 94 | 
            +
                - - "~>"
         | 
| 95 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 96 96 | 
             
                    version: '0.7'
         | 
| 97 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 98 98 | 
             
              name: xcodeproj
         | 
| 99 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 100 | 
             
                requirements:
         | 
| 101 | 
            -
                - - ~>
         | 
| 101 | 
            +
                - - "~>"
         | 
| 102 102 | 
             
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            -
                    version: 0. | 
| 103 | 
            +
                    version: 0.24.1
         | 
| 104 104 | 
             
              type: :runtime
         | 
| 105 105 | 
             
              prerelease: false
         | 
| 106 106 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 107 | 
             
                requirements:
         | 
| 108 | 
            -
                - - ~>
         | 
| 108 | 
            +
                - - "~>"
         | 
| 109 109 | 
             
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            -
                    version: 0. | 
| 110 | 
            +
                    version: 0.24.1
         | 
| 111 111 | 
             
            description: |2
         | 
| 112 112 | 
             
                                     A command-line tool that reorganizes your Xcode project folder to match your Xcode groups
         | 
| 113 113 | 
             
                                     Synx parses your .xcodeproj to build the same group structure out on the file system.
         | 
| @@ -118,8 +118,8 @@ executables: | |
| 118 118 | 
             
            extensions: []
         | 
| 119 119 | 
             
            extra_rdoc_files: []
         | 
| 120 120 | 
             
            files:
         | 
| 121 | 
            -
            - .gitignore
         | 
| 122 | 
            -
            - .travis.yml
         | 
| 121 | 
            +
            - ".gitignore"
         | 
| 122 | 
            +
            - ".travis.yml"
         | 
| 123 123 | 
             
            - CHANGELOG.md
         | 
| 124 124 | 
             
            - Gemfile
         | 
| 125 125 | 
             
            - LICENSE.txt
         | 
| @@ -187,17 +187,17 @@ require_paths: | |
| 187 187 | 
             
            - lib
         | 
| 188 188 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 189 189 | 
             
              requirements:
         | 
| 190 | 
            -
              - -  | 
| 190 | 
            +
              - - ">="
         | 
| 191 191 | 
             
                - !ruby/object:Gem::Version
         | 
| 192 192 | 
             
                  version: '0'
         | 
| 193 193 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 194 194 | 
             
              requirements:
         | 
| 195 | 
            -
              - -  | 
| 195 | 
            +
              - - ">="
         | 
| 196 196 | 
             
                - !ruby/object:Gem::Version
         | 
| 197 197 | 
             
                  version: '0'
         | 
| 198 198 | 
             
            requirements: []
         | 
| 199 199 | 
             
            rubyforge_project: 
         | 
| 200 | 
            -
            rubygems_version: 2. | 
| 200 | 
            +
            rubygems_version: 2.2.2
         | 
| 201 201 | 
             
            signing_key: 
         | 
| 202 202 | 
             
            specification_version: 4
         | 
| 203 203 | 
             
            summary: A command-line tool that reorganizes your Xcode project folder to match your
         |