Class: Submodule::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Submodule::Task
- Defined in:
- lib/submodule.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #after_pull ⇒ Object
-
#initialize ⇒ Task
constructor
A new instance of Task.
- #test ⇒ Object
Constructor Details
#initialize ⇒ Task
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
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/submodule.rb', line 9 def path @path end |
Instance Method Details
#after_pull ⇒ Object
31 32 33 |
# File 'lib/submodule.rb', line 31 def after_pull p "after pull" end |
#test ⇒ Object
27 28 29 |
# File 'lib/submodule.rb', line 27 def test p "define tests in test function" end |