ood_support 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -7
- data/LICENSE.txt +1 -1
- data/lib/ood_support/acl.rb +2 -2
- data/lib/ood_support/acl_entry.rb +1 -1
- data/lib/ood_support/group.rb +5 -5
- data/lib/ood_support/user.rb +5 -5
- data/lib/ood_support/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9f497e435b0b2491c59b7f458e276e6793e6a8f
|
4
|
+
data.tar.gz: 2e1e746f59273aefb8258c572aed749e7fa997b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c122717d56da9b9b210516f9738f312d5e699107f09c68b74e881f2f7b7b1e20a88d8987e8d2a30663bc1ed0d117fa7de577771469eff2d5c54e85bb638503e4
|
7
|
+
data.tar.gz: 658a447d17092e7259c8dea5d500948c92e3a1dcf6f83b5c88d478799ad886eff41d64efe45000de4043d5e3b210d47c33e363fdaaec3af3e656ded444bdab06
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,30 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
2
3
|
|
3
|
-
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
4
6
|
|
5
|
-
|
7
|
+
## [Unreleased]
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
+
## [0.0.3] - 2017-11-17
|
10
|
+
### Changed
|
11
|
+
- Updated the `CHANGELOG.md` formatting.
|
12
|
+
[#3](https://github.com/OSC/ood_support/issues/3)
|
13
|
+
- Updated `LICENSE.txt` dates.
|
9
14
|
|
10
|
-
|
15
|
+
### Fixed
|
16
|
+
- Added support for Ruby 2.4 by replacing deprecated `Fixnum` with `Integer`.
|
17
|
+
[#4](https://github.com/OSC/ood_support/issues/4)
|
11
18
|
|
12
|
-
|
19
|
+
## [0.0.2] - 2016-08-26
|
20
|
+
### Fixed
|
21
|
+
- Added aliases `User#home` and `User#member_of_group?` for backwards
|
22
|
+
compatibility.
|
23
|
+
|
24
|
+
## 0.0.1 - 2016-07-01
|
25
|
+
### Added
|
26
|
+
- Initial release!
|
27
|
+
|
28
|
+
[Unreleased]: https://github.com/OSC/ood_support/compare/v0.0.3...HEAD
|
29
|
+
[0.0.3]: https://github.com/OSC/ood_support/compare/v0.0.2...v0.0.3
|
30
|
+
[0.0.2]: https://github.com/OSC/ood_support/compare/v0.0.1...v0.0.2
|
data/LICENSE.txt
CHANGED
data/lib/ood_support/acl.rb
CHANGED
@@ -21,7 +21,7 @@ module OodSupport
|
|
21
21
|
new(entries: entries, **kwargs)
|
22
22
|
end
|
23
23
|
|
24
|
-
# @param entries [
|
24
|
+
# @param entries [Array<ACLEntry>] list of entries
|
25
25
|
# @param default [Boolean] default allow, otherwise deny
|
26
26
|
def initialize(entries:, default: false)
|
27
27
|
@entries = entries
|
@@ -63,7 +63,7 @@ module OodSupport
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# Generates a hash value for this object
|
66
|
-
# @return [
|
66
|
+
# @return [Integer] hash value of object
|
67
67
|
def hash
|
68
68
|
[self.class, to_h].hash
|
69
69
|
end
|
data/lib/ood_support/group.rb
CHANGED
@@ -6,16 +6,16 @@ module OodSupport
|
|
6
6
|
include Comparable
|
7
7
|
|
8
8
|
# The id of the group
|
9
|
-
# @return [
|
9
|
+
# @return [Integer] the group id
|
10
10
|
attr_reader :id
|
11
11
|
|
12
12
|
# The name of the group
|
13
13
|
# @return [String] the group name
|
14
14
|
attr_reader :name
|
15
15
|
|
16
|
-
# @param group [
|
16
|
+
# @param group [Integer, #to_s] the group id or name
|
17
17
|
def initialize(group = Process.group)
|
18
|
-
if group.is_a?(
|
18
|
+
if group.is_a?(Integer)
|
19
19
|
@id = group
|
20
20
|
@name = Etc.getgrgid(@id).name
|
21
21
|
else
|
@@ -26,7 +26,7 @@ module OodSupport
|
|
26
26
|
|
27
27
|
# The comparison operator for sorting values
|
28
28
|
# @param other [#to_s] group to compare against
|
29
|
-
# @return [
|
29
|
+
# @return [Integer] how groups compare
|
30
30
|
def <=>(other)
|
31
31
|
name <=> other
|
32
32
|
end
|
@@ -40,7 +40,7 @@ module OodSupport
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# Generates a hash value for this object
|
43
|
-
# @return [
|
43
|
+
# @return [Integer] hash value of object
|
44
44
|
def hash
|
45
45
|
[self.class, name].hash
|
46
46
|
end
|
data/lib/ood_support/user.rb
CHANGED
@@ -30,9 +30,9 @@ module OodSupport
|
|
30
30
|
|
31
31
|
alias_method :home, :dir
|
32
32
|
|
33
|
-
# @param user [
|
33
|
+
# @param user [Integer, #to_s] user id or name
|
34
34
|
def initialize(user = Process.user)
|
35
|
-
@passwd = user.is_a?(
|
35
|
+
@passwd = user.is_a?(Integer) ? Etc.getpwuid(user) : Etc.getpwnam(user.to_s)
|
36
36
|
end
|
37
37
|
|
38
38
|
# Determine whether user is part of specified group
|
@@ -51,14 +51,14 @@ module OodSupport
|
|
51
51
|
end
|
52
52
|
|
53
53
|
# List of all groups that user belongs to
|
54
|
-
# @return [Array<
|
54
|
+
# @return [Array<Group>] list of groups user is in
|
55
55
|
def groups
|
56
56
|
@groups ||= get_groups
|
57
57
|
end
|
58
58
|
|
59
59
|
# The comparison operator for sorting values
|
60
60
|
# @param other [#to_s] user to compare against
|
61
|
-
# @return [
|
61
|
+
# @return [Integer] how users compare
|
62
62
|
def <=>(other)
|
63
63
|
name <=> other
|
64
64
|
end
|
@@ -72,7 +72,7 @@ module OodSupport
|
|
72
72
|
end
|
73
73
|
|
74
74
|
# Generates a hash value for this object
|
75
|
-
# @return [
|
75
|
+
# @return [Integer] hash value of object
|
76
76
|
def hash
|
77
77
|
[self.class, name].hash
|
78
78
|
end
|
data/lib/ood_support/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ood_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Nicklas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -88,4 +88,3 @@ signing_key:
|
|
88
88
|
specification_version: 4
|
89
89
|
summary: Open OnDemand gem that adds useful support methods for an HPC Center.
|
90
90
|
test_files: []
|
91
|
-
has_rdoc:
|