Skip to content

Commit

Permalink
Use :install as the default action
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Feb 7, 2013
1 parent 6d2451d commit 6acad21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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

# Covers 0.10.8 and earlier :default_action
def initialize(*args)
super
@action = :install
end

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

0 comments on commit 6acad21

Please sign in to comment.