Class: MxxRu::Externals::Hg

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
Impl::ExternalBasics, Impl::OptionsHolder
Defined in:
lib/mxx_ru/externals.rb

Instance Attribute Summary collapse

Attributes included from Impl::ExternalBasics

#name, #paths, #url

Instance Method Summary collapse

Methods included from Impl::OptionsHolder

#option

Methods included from Impl::ExternalBasics

#map, #map_dir, #map_file

Constructor Details

#initialize(name) {|_self| ... } ⇒ Hg

Returns a new instance of Hg.

Yields:

  • (_self)

Yield Parameters:



584
585
586
587
588
589
590
# File 'lib/mxx_ru/externals.rb', line 584

def initialize(name)
  defaults(name)

  yield self if block_given?

  Registry::handle_external(@name, self)
end

Instance Attribute Details

#tag(v) ⇒ Object (readonly) Also known as: tag=

Returns the value of attribute tag.



592
593
594
# File 'lib/mxx_ru/externals.rb', line 592

def tag
  @tag
end

Instance Method Details

#define_rules(old_or_new) ⇒ Object



600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/mxx_ru/externals.rb', line 600

def define_rules(old_or_new)
  define(old_or_new) do |tmp_dir|
    sh_args = ['hg', 'clone']

    sh_args << '--updaterev' << @tag.to_s if @tag
    push_options_to(sh_args)

    sh_args << @url << tmp_dir

    sh *sh_args
  end
end

#make_hashObject



596
597
598
# File 'lib/mxx_ru/externals.rb', line 596

def make_hash
  options_to_map.merge!( basics_to_map ).merge!( { :tag => @tag } )
end