Class: Pod::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-readonly/toggle_readonly.rb

Instance Method Summary collapse

Instance Method Details

#_set_permissions(permissions) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/cocoapods-readonly/toggle_readonly.rb', line 3

def _set_permissions(permissions)
  installer = installer_rep
  for pod in installer.pods
    # if the pod is actually in Pods/, and not a :path linked pod
    if pod.root.parent == installer.sandbox_root
      for file in pod.source_files
        File.chmod(permissions, file)
      end
    end
  end
end

#perform_post_install_actionsObject



16
17
18
19
# File 'lib/cocoapods-readonly/toggle_readonly.rb', line 16

def perform_post_install_actions
  real_perform_post_install_actions
  _set_permissions(0444)
end

#real_perform_post_install_actionsObject



15
# File 'lib/cocoapods-readonly/toggle_readonly.rb', line 15

alias_method :real_perform_post_install_actions, :perform_post_install_actions

#real_run_pre_install_hooksObject



21
# File 'lib/cocoapods-readonly/toggle_readonly.rb', line 21

alias_method :real_run_pre_install_hooks, :run_pre_install_hooks

#run_pre_install_hooksObject



22
23
24
25
# File 'lib/cocoapods-readonly/toggle_readonly.rb', line 22

def run_pre_install_hooks
  real_run_pre_install_hooks
  _set_permissions(0644)
end