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

#file_utils, #rake, #tasks_include?

Constructor Details

This class inherits a constructor from Registry::Checkout

Instance Method Details

#checkoutObject



159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/radiant/extension/script.rb', line 159

def checkout
  if project_in_git?
    system "git submodule add #{url} vendor/extensions/#{name}"
    cd(File.join('vendor', 'extensions', name)) do
      system "git submodule init && git submodule update"
    end
  else
    super
    cd(path) do
      system "git submodule init && git submodule update"
    end
  end
end

#checkout_commandObject



155
156
157
# File 'lib/radiant/extension/script.rb', line 155

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

#copy_to_vendor_extensionsObject



173
174
175
# File 'lib/radiant/extension/script.rb', line 173

def copy_to_vendor_extensions
  super unless project_in_git?
end

#project_in_git?Boolean

Returns:

  • (Boolean)


151
152
153
# File 'lib/radiant/extension/script.rb', line 151

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