cocoapods-readonly 1.0.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 +7 -0
 - data/.gitignore +3 -0
 - data/Gemfile +10 -0
 - data/LICENSE.txt +13 -0
 - data/README.md +13 -0
 - data/Rakefile +13 -0
 - data/cocoapods-readonly.gemspec +23 -0
 - data/lib/cocoapods-readonly.rb +1 -0
 - data/lib/cocoapods-readonly/gem_version.rb +3 -0
 - data/lib/cocoapods-readonly/toggle_readonly.rb +27 -0
 - data/lib/cocoapods_plugin.rb +1 -0
 - data/spec/command/readonly_spec.rb +12 -0
 - data/spec/spec_helper.rb +45 -0
 - metadata +89 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 779c9bedc1e7d3e2e52f1ceb044cd3073ff35c0d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 337709810d11155cbede2a139fab85f77c4bf7a2
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 5e036c4fb01d05e84b57da72e3a0de238664c526fbc526d0376182b2715afec7cd595761c3849443e0c70420e6974c8c0717bc266be3baf63eb892f3f57af9fd
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: fcb38f5754b4384c8ac12aec9637b219cd2db30b8671a08a595403065fe2fa1d97a8a1cc1c4ab05f048407900499279620fc10686967ee9fe85c3fc265c840bf
         
     | 
    
        data/.gitignore
    ADDED
    
    
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE.txt
    ADDED
    
    | 
         @@ -0,0 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright 2015 Yelp
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
              Licensed under the Apache License, Version 2.0 (the "License");
         
     | 
| 
      
 4 
     | 
    
         
            +
              you may not use this file except in compliance with the License.
         
     | 
| 
      
 5 
     | 
    
         
            +
              You may obtain a copy of the License at
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                http://www.apache.org/licenses/LICENSE-2.0
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              Unless required by applicable law or agreed to in writing, software
         
     | 
| 
      
 10 
     | 
    
         
            +
              distributed under the License is distributed on an "AS IS" BASIS,
         
     | 
| 
      
 11 
     | 
    
         
            +
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         
     | 
| 
      
 12 
     | 
    
         
            +
              See the License for the specific language governing permissions and
         
     | 
| 
      
 13 
     | 
    
         
            +
              limitations under the License.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # cocoapods-readonly
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Developers switching from submodules are used to modifying library source files from within Xcode. If you don’t checkout a local version first, changes won’t be picked up by git and might be lost the next time you run ‘pod install.'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            This plugin removes the write permission from all pod-related files that aren’t installed via a local pod. Xcode will then give you a helpful message, noting that the file is locked.
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ## Installation
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                $ gem install cocoapods-readonly
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            This runs automatically on pod install – you don't have to do anything.
         
     | 
    
        data/Rakefile
    ADDED
    
    
| 
         @@ -0,0 +1,23 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # coding: utf-8
         
     | 
| 
      
 2 
     | 
    
         
            +
            lib = File.expand_path('../lib', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'cocoapods-readonly/gem_version.rb'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            Gem::Specification.new do |spec|
         
     | 
| 
      
 7 
     | 
    
         
            +
              spec.name          = "cocoapods-readonly"
         
     | 
| 
      
 8 
     | 
    
         
            +
              spec.version       = CocoapodsReadonly::VERSION
         
     | 
| 
      
 9 
     | 
    
         
            +
              spec.authors       = ["Mason Glidden"]
         
     | 
| 
      
 10 
     | 
    
         
            +
              spec.email         = ["mglidden@yelp.com"]
         
     | 
| 
      
 11 
     | 
    
         
            +
              spec.description   = %q{Makes CocoaPods source files read-only, so you can't accidently modify them.}
         
     | 
| 
      
 12 
     | 
    
         
            +
              spec.summary       = %q{Developers switching from submodules are used to modifying library source files from within Xcode. This locks those files as needed so Xcode warns you when attempting to edit.}
         
     | 
| 
      
 13 
     | 
    
         
            +
              spec.homepage      = "https://github.com/Yelp/cocoapods-readonly"
         
     | 
| 
      
 14 
     | 
    
         
            +
              spec.license       = "Apache"
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              spec.files         = `git ls-files`.split($/)
         
     | 
| 
      
 17 
     | 
    
         
            +
              spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
         
     | 
| 
      
 18 
     | 
    
         
            +
              spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
         
     | 
| 
      
 19 
     | 
    
         
            +
              spec.require_paths = ["lib"]
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              spec.add_development_dependency "bundler", "~> 1.3"
         
     | 
| 
      
 22 
     | 
    
         
            +
              spec.add_development_dependency "rake"
         
     | 
| 
      
 23 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'cocoapods-readonly/gem_version'
         
     | 
| 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Pod
         
     | 
| 
      
 2 
     | 
    
         
            +
              class Installer
         
     | 
| 
      
 3 
     | 
    
         
            +
                def _set_permissions(permissions)
         
     | 
| 
      
 4 
     | 
    
         
            +
                  installer = installer_rep
         
     | 
| 
      
 5 
     | 
    
         
            +
                  for pod in installer.pods
         
     | 
| 
      
 6 
     | 
    
         
            +
                    # if the pod is actually in Pods/, and not a :path linked pod
         
     | 
| 
      
 7 
     | 
    
         
            +
                    if pod.root.parent == installer.sandbox_root
         
     | 
| 
      
 8 
     | 
    
         
            +
                      for file in pod.source_files
         
     | 
| 
      
 9 
     | 
    
         
            +
                        File.chmod(permissions, file)
         
     | 
| 
      
 10 
     | 
    
         
            +
                      end
         
     | 
| 
      
 11 
     | 
    
         
            +
                    end
         
     | 
| 
      
 12 
     | 
    
         
            +
                  end
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
                
         
     | 
| 
      
 15 
     | 
    
         
            +
                alias_method :real_perform_post_install_actions, :perform_post_install_actions
         
     | 
| 
      
 16 
     | 
    
         
            +
                def perform_post_install_actions
         
     | 
| 
      
 17 
     | 
    
         
            +
                  real_perform_post_install_actions
         
     | 
| 
      
 18 
     | 
    
         
            +
                  _set_permissions(0444)
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
                
         
     | 
| 
      
 21 
     | 
    
         
            +
                alias_method :real_run_pre_install_hooks, :run_pre_install_hooks
         
     | 
| 
      
 22 
     | 
    
         
            +
                def run_pre_install_hooks
         
     | 
| 
      
 23 
     | 
    
         
            +
                  real_run_pre_install_hooks
         
     | 
| 
      
 24 
     | 
    
         
            +
                  _set_permissions(0644)
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'cocoapods-readonly/toggle_readonly.rb'
         
     | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,45 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'pathname'
         
     | 
| 
      
 2 
     | 
    
         
            +
            ROOT = Pathname.new(File.expand_path('../../', __FILE__))
         
     | 
| 
      
 3 
     | 
    
         
            +
            $:.unshift((ROOT + 'lib').to_s)
         
     | 
| 
      
 4 
     | 
    
         
            +
            $:.unshift((ROOT + 'spec').to_s)
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            require 'bundler/setup'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'bacon'
         
     | 
| 
      
 8 
     | 
    
         
            +
            require 'cocoapods'
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            require 'cocoapods_plugin'
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            #-----------------------------------------------------------------------------#
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            module Pod
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              # Disable the wrapping so the output is deterministic in the tests.
         
     | 
| 
      
 17 
     | 
    
         
            +
              #
         
     | 
| 
      
 18 
     | 
    
         
            +
              UI.disable_wrap = true
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              # Redirects the messages to an internal store.
         
     | 
| 
      
 21 
     | 
    
         
            +
              #
         
     | 
| 
      
 22 
     | 
    
         
            +
              module UI
         
     | 
| 
      
 23 
     | 
    
         
            +
                @output = ''
         
     | 
| 
      
 24 
     | 
    
         
            +
                @warnings = ''
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                class << self
         
     | 
| 
      
 27 
     | 
    
         
            +
                  attr_accessor :output
         
     | 
| 
      
 28 
     | 
    
         
            +
                  attr_accessor :warnings
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                  def puts(message = '')
         
     | 
| 
      
 31 
     | 
    
         
            +
                    @output << "#{message}\n"
         
     | 
| 
      
 32 
     | 
    
         
            +
                  end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                  def warn(message = '', actions = [])
         
     | 
| 
      
 35 
     | 
    
         
            +
                    @warnings << "#{message}\n"
         
     | 
| 
      
 36 
     | 
    
         
            +
                  end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                  def print(message)
         
     | 
| 
      
 39 
     | 
    
         
            +
                    @output << message
         
     | 
| 
      
 40 
     | 
    
         
            +
                  end
         
     | 
| 
      
 41 
     | 
    
         
            +
                end
         
     | 
| 
      
 42 
     | 
    
         
            +
              end
         
     | 
| 
      
 43 
     | 
    
         
            +
            end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
            #-----------------------------------------------------------------------------#
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,89 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: cocoapods-readonly
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Mason Glidden
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-04-01 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: bundler
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '1.3'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '1.3'
         
     | 
| 
      
 27 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 28 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 29 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 30 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - '>='
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - '>='
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 41 
     | 
    
         
            +
            description: Makes CocoaPods source files read-only, so you can't accidently modify
         
     | 
| 
      
 42 
     | 
    
         
            +
              them.
         
     | 
| 
      
 43 
     | 
    
         
            +
            email:
         
     | 
| 
      
 44 
     | 
    
         
            +
            - mglidden@yelp.com
         
     | 
| 
      
 45 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 46 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 47 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 48 
     | 
    
         
            +
            files:
         
     | 
| 
      
 49 
     | 
    
         
            +
            - .gitignore
         
     | 
| 
      
 50 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 51 
     | 
    
         
            +
            - LICENSE.txt
         
     | 
| 
      
 52 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 53 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 54 
     | 
    
         
            +
            - cocoapods-readonly.gemspec
         
     | 
| 
      
 55 
     | 
    
         
            +
            - lib/cocoapods-readonly.rb
         
     | 
| 
      
 56 
     | 
    
         
            +
            - lib/cocoapods-readonly/gem_version.rb
         
     | 
| 
      
 57 
     | 
    
         
            +
            - lib/cocoapods-readonly/toggle_readonly.rb
         
     | 
| 
      
 58 
     | 
    
         
            +
            - lib/cocoapods_plugin.rb
         
     | 
| 
      
 59 
     | 
    
         
            +
            - spec/command/readonly_spec.rb
         
     | 
| 
      
 60 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 61 
     | 
    
         
            +
            homepage: https://github.com/Yelp/cocoapods-readonly
         
     | 
| 
      
 62 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 63 
     | 
    
         
            +
            - Apache
         
     | 
| 
      
 64 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 65 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 66 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 67 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 68 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 69 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 70 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 71 
     | 
    
         
            +
              - - '>='
         
     | 
| 
      
 72 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 73 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 74 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 75 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 76 
     | 
    
         
            +
              - - '>='
         
     | 
| 
      
 77 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 78 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 79 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 80 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 81 
     | 
    
         
            +
            rubygems_version: 2.0.14
         
     | 
| 
      
 82 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 83 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 84 
     | 
    
         
            +
            summary: Developers switching from submodules are used to modifying library source
         
     | 
| 
      
 85 
     | 
    
         
            +
              files from within Xcode. This locks those files as needed so Xcode warns you when
         
     | 
| 
      
 86 
     | 
    
         
            +
              attempting to edit.
         
     | 
| 
      
 87 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 88 
     | 
    
         
            +
            - spec/command/readonly_spec.rb
         
     | 
| 
      
 89 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     |