Skip to content

Commit

Permalink
Merge pull request #20 from phinze/fixing-path-option
Browse files Browse the repository at this point in the history
    --path is no longer hard coded to _modules/_
  • Loading branch information
aussielunix committed Aug 6, 2012
2 parents 88c27e9 + 23c3f27 commit a5544e3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.gem
Gemfile.lock
tmp/
31 changes: 31 additions & 0 deletions features/install.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Feature: cli/install
In order to be worth anything
Puppet librarian needs to install modules properly

Scenario: Installing a module and its dependencies
Given a file named "Puppetfile" with:
"""
forge "http://forge.puppetlabs.com"
mod 'puppetlabs/apt'
"""
When I run `librarian-puppet install`
Then the exit status should be 0
And the file "modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/

Scenario: Changing the path
Given a directory named "puppet"
And a file named "Puppetfile" with:
"""
forge "http://forge.puppetlabs.com"
mod 'puppetlabs/apt'
"""
When I run `librarian-puppet install --path puppet/modules`
And I run `librarian-puppet config`
Then the exit status should be 0
And the output from "librarian-puppet config" should contain "path: puppet/modules"
And the file "puppet/modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
And the file "puppet/modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/

2 changes: 1 addition & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
slow_boot ||= RUBY_PLATFORM == "java"
slow_boot ||= defined?(::Rubinius)

@aruba_timeout_seconds = slow_boot ? 5 : 2
@aruba_timeout_seconds = slow_boot ? 10 : 2
end
3 changes: 2 additions & 1 deletion lib/librarian/puppet/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def adapter_name
end

def install_path
project_path.join("modules")
part = config_db["path"] || "modules"
project_path.join(part)
end

def cache_path
Expand Down

0 comments on commit a5544e3

Please sign in to comment.