Class: Registry::Git

Inherits:
Checkout show all
Defined in:
lib/radiant/extension/script.rb

Instance Attribute Summary

Attributes inherited from Installer

#name, #path, #url

Instance Method Summary collapse

Methods inherited from Checkout

#initialize, #install

Methods inherited from Installer

#initialize, #install, #migrate, #update

Methods inherited from Action

#rake

Constructor Details

This class inherits a constructor from Registry::Checkout

Instance Method Details

#checkoutObject



136
137
138
139
140
141
142
143
144
# File 'lib/radiant/extension/script.rb', line 136

def checkout
  if project_in_git?
    system "git submodule add #{url} vendor/extensions/#{name}"
    system "cd vendor/extensions/#{name}; git submodule init && git submodule update"
  else
    super
    system "cd #{path}; git submodule init && git submodule update"
  end
end

#checkout_commandObject



132
133
134
# File 'lib/radiant/extension/script.rb', line 132

def checkout_command
  "git clone #{url} #{name}"
end

#copy_to_vendor_extensionsObject



146
147
148
# File 'lib/radiant/extension/script.rb', line 146

def copy_to_vendor_extensions
  super unless project_in_git?
end

#project_in_git?Boolean

Returns:

  • (Boolean)


128
129
130
# File 'lib/radiant/extension/script.rb', line 128

def project_in_git?
  @in_git ||= File.directory?(".git")
end