Class: Submodule::Task

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/submodule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTask

Returns a new instance of Task.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/submodule.rb', line 11

def initialize
  @cwd = Dir.pwd

  base = File.basename Dir["*.gemspec"][0], ".gemspec"
  if base[0]  
    base = File.basename Dir["*.gemspec"][0], ".gemspec"
    @version_file = "lib/#{base}/version.rb"
  end

  gitmodules = IniFile.new('./.gitmodules').to_h
  @path = gitmodules[gitmodules.keys.first]["path"]
  @submodule_name = gitmodules.keys.first.gsub('submodule ', '').gsub('"', '').gsub('vendor/', '')
  @github = gitmodules[gitmodules.keys.first]["url"].gsub('https://github.com/', '').gsub('.git', '')
  define
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/submodule.rb', line 9

def path
  @path
end

Instance Method Details

#after_pullObject



31
32
33
# File 'lib/submodule.rb', line 31

def after_pull
  p "after pull"
end

#testObject



27
28
29
# File 'lib/submodule.rb', line 27

def test
  p "define tests in test function"
end