Class: TwitterCldr::Resources::Requirements::GitRequirement

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/resources/requirements/git_requirement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_url, ref) ⇒ GitRequirement

Returns a new instance of GitRequirement.



13
14
15
16
# File 'lib/twitter_cldr/resources/requirements/git_requirement.rb', line 13

def initialize(repo_url, ref)
  @repo_url = repo_url
  @ref = ref
end

Instance Attribute Details

#refObject (readonly)

Returns the value of attribute ref.



11
12
13
# File 'lib/twitter_cldr/resources/requirements/git_requirement.rb', line 11

def ref
  @ref
end

#repo_urlObject (readonly)

Returns the value of attribute repo_url.



11
12
13
# File 'lib/twitter_cldr/resources/requirements/git_requirement.rb', line 11

def repo_url
  @repo_url
end

Instance Method Details

#prepareObject



18
19
20
21
22
# File 'lib/twitter_cldr/resources/requirements/git_requirement.rb', line 18

def prepare
  check_git_available
  clone_or_fetch_if_necessary
  puts "Using repo in #{source_path}"
end

#source_pathObject



24
25
26
# File 'lib/twitter_cldr/resources/requirements/git_requirement.rb', line 24

def source_path
  @source_path ||= File.join(TwitterCldr::VENDOR_DIR, 'git', repo_name)
end