Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ forges:
- Directory: /var/lib/other-modules
- Source: /var/code/puppetlabs-apache
- Proxy: http://forge.puppetlabs.com
- GitRepository:
source: https://github.com/puppetlabs/puppetlabs-stdlib.git
include_tags: '[0-9.]+'
```

## Running with Phusion Passenger (EXPERIMENTAL)
Expand Down
8 changes: 5 additions & 3 deletions lib/puppet_library/forge/git_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ def self.configure(&block)

# * <tt>:source</tt> - The URL or path of the git repository
# * <tt>:version_tag_regex</tt> - A regex that describes which tags to serve
def initialize(git, version_tag_regex)
def initialize(source, version_tag_regex)
super(self)
@version_tag_regex = version_tag_regex
@version_tag_regex = Regexp.new version_tag_regex[1]
cache_dir = PuppetLibrary::Util::TempDir.new("git-repo-cache")
git = PuppetLibrary::Util::Git.new(source[1], cache_dir)
@git = git
@metadata_cache = PuppetLibrary::Http::Cache::InMemory.new(60)
@tags_cache = PuppetLibrary::Http::Cache::InMemory.new(60)
Expand Down Expand Up @@ -105,7 +107,7 @@ def get_metadata(author, module_name)
def tags
@tags_cache.get do
tags = @git.tags
tags = tags.select {|tag| tag =~ @version_tag_regex }
tags = tags.select {|tag| @version_tag_regex =~ tag }
tags = tags.select do |tag|
@git.file_exists?("metadata.json", tag) || @git.file_exists?("Modulefile", tag)
end
Expand Down