Skip to content

Commit

Permalink
added backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Nicklas committed Aug 26, 2016
1 parent 0200119 commit 3a2a894
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Unreleased

## 0.0.2 (2016-08-26)

Bugfixes:

- added aliases `User#home` and `User#member_of_group?` for backwards
compatibility

## 0.0.1 (2016-07-01)

Initial release!
4 changes: 4 additions & 0 deletions lib/ood_support/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class User

alias_method :id, :uid

alias_method :home, :dir

# @param user [Fixnum, #to_s] user id or name
def initialize(user = Process.user)
@passwd = user.is_a?(Fixnum) ? Etc.getpwuid(user) : Etc.getpwnam(user.to_s)
Expand All @@ -40,6 +42,8 @@ def in_group?(group)
groups.include? Group.new(group)
end

alias_method :member_of_group?, :in_group?

# Provide primary group of user
# @return [Group] primary group of user
def group
Expand Down

0 comments on commit 3a2a894

Please sign in to comment.