Class: Releasinator::DownstreamRepo

Inherits:
Object
  • Object
show all
Defined in:
lib/downstream_repo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url, branch, options = {}) ⇒ DownstreamRepo

Returns a new instance of DownstreamRepo.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/downstream_repo.rb', line 4

def initialize(name, url, branch, options={})
  @name = name # The desired name of the repo. This is only used for the directory in the `downstream_repos` folder.
  @name.freeze
  @url = url # The GitHub repo location.
  @url.freeze
  @branch = branch # The git branch on which to base new changes.
  @branch.freeze
  @options = options # hash of any of the following options:
  @options.freeze
  #  :new_branch_name  # The name of the new branch to create.  If this is set, :release_to_github is ignored.
  #  :release_to_github  # True if publishing the root repo to GitHub.
  #  :files_to_copy # List of CopyFile objects for copying files into downstream.  Please see documentation on the `CopyFile` class.
  #  :full_file_sync # True if the downstream repo should just be a straight copy of source.  Setting this to true removes all files before replacing them all with those specified in base_docs_dir.
  #  :post_copy_methods # List of methods to run immediately after copying all files.
  #  :build_methods # List of methods to run immediately after copying files.  Useful to test whether the new downstream changes now compile.
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



3
4
5
# File 'lib/downstream_repo.rb', line 3

def branch
  @branch
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/downstream_repo.rb', line 3

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/downstream_repo.rb', line 3

def options
  @options
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/downstream_repo.rb', line 3

def url
  @url
end

Instance Method Details

#full_file_syncObject



21
22
23
24
# File 'lib/downstream_repo.rb', line 21

def full_file_sync
  return @options[:full_file_sync] if @options.has_key? :full_file_sync
  false
end

#release_to_githubObject



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

def release_to_github
  return @options[:release_to_github] if @options.has_key? :release_to_github
  false
end