Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 2, 2018. It is now read-only.

Use :install as the default action for python_pip #29

Merged
merged 2 commits into from Feb 13, 2013
Merged
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
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Install packages using the new hotness in Python package management...[`pip`](ht

# Actions

- :install: Install a pip package - if version is provided, install that specific version
- :install: Install a pip package - if version is provided, install that specific version (default)
- :upgrade: Upgrade a pip package - if version is provided, upgrade to that specific version
- :remove: Remove a pip package
- :user: User to run pip as, for using with virtualenv
Expand All @@ -65,26 +65,21 @@ Install packages using the new hotness in Python package management...[`pip`](ht
# Example

# install latest gunicorn into system path
python_pip "gunicorn" do
action :install
end
python_pip "gunicorn"

# target a virtualenv
python_pip "gunicorn" do
virtualenv "/home/ubunut/my_ve"
action :install
end

# install Django 1.1.4
python_pip "django" do
version "1.1.4"
action :install
end

# use this provider with the core package resource
package "django" do
provider Chef::Provider::PythonPip
action :install
end

`python_virtualenv`
Expand Down
7 changes: 7 additions & 0 deletions resources/pip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
#

actions :install, :upgrade, :remove, :purge
default_action :install if defined?(default_action) # Chef > 10.8

# Default action for Chef <= 10.8
def initialize(*args)
super
@action = :install
end

attribute :package_name, :kind_of => String, :name_attribute => true
attribute :version, :default => nil
Expand Down