unix_like_permissions 0.4.13 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8078deb84ac8306f4eeec8f52a9b1bc470578ee894cd051cf0ae123b920b360
4
- data.tar.gz: 6392731df25b5cb8f014a117ec4de89d26bd90e274526faca801dcfe6b08b5ae
3
+ metadata.gz: 291c19c159a8cf33696e6ead400ef9903664bbaf248e740e4208c902c7287695
4
+ data.tar.gz: 8435259e0fcf1efd0025fd20b4a532a49715d6039110a1755a79465db62d05f2
5
5
  SHA512:
6
- metadata.gz: f6ee6be113f3e935be36b65251aab44776059390e0e1befe05c68f3e030601251b91cdbb23c4eeb1fefcfe23e9d92da2aa10eaa1db0e51486408382c3dc429fd
7
- data.tar.gz: 8eda9ea4bc7fe2da0fff16926fb9f70b6779e7538b52602bb286b61658c087194f20ab621994138b0a322ebbfac7542d14607fc96107fc99a22fb8072cb69a49
6
+ metadata.gz: a30813053117926c2be15106030700d4ddf44f3d1916c54c6aa48dbca288b980d87fbedea2a1026b2621ae1683953e8602b6e5cc01d442ec8914534a05bb12e9
7
+ data.tar.gz: c5185cfec0a9ac67a25a3e39330bda0a3909e2bf3c1b3f892b907da2e33cb9c98b741e68339d09122d92ebfc3acd426df70295cee8b017bc8763891cf2496ad8
data/README.md CHANGED
@@ -155,9 +155,11 @@ permissions.to_i # => 4
155
155
 
156
156
  #### Serialization
157
157
 
158
- `#to_h`: Returns a hash with permission names as keys and boolean values indicating whether each permission is set.
158
+ `#to_h(type = :bool)`: Returns a hash with permission names as keys and boolean values indicating whether each permission is set.
159
159
  ```ruby
160
160
  permissions.to_h # => { read: false, create: false, update: true, destroy: false }
161
+ permissions.to_h(:int) # => { read: 0, create: 0, update: 1, destroy: 0 }
162
+ permissions.to_h(:str) # => { read: '0', create: '0', update: '1', destroy: '0' }
161
163
  ```
162
164
 
163
165
  `#to_s`: Returns a string representation of the set permissions.
@@ -180,10 +182,10 @@ permissions.to_a(:str) # => ['0', '0', '1', '0]
180
182
  ```ruby
181
183
  permissions.set_all(true)
182
184
 
183
- permissions.to_s # => "read, create, update, destroy"
185
+ permissions.to_s # => "read create update destroy"
184
186
  ```
185
187
 
186
- set({ permission: value, ... }): Sets the specified permission to the boolean value provided (true or false).
188
+ `set({ permission: value, ... })`: Sets the specified permission to the boolean value provided (true or false).
187
189
 
188
190
  ```ruby
189
191
  permissions.set(read: true, create: false)
@@ -192,7 +194,7 @@ permissions.to_s # => "read"
192
194
 
193
195
  ## Contributing
194
196
 
195
- Bug reports and pull requests are welcome on GitHub at [repository URL]. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](link to code of conduct).
197
+ Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](CODE_OF_CONDUCT.md).
196
198
 
197
199
  ## License
198
200
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UnixLikePermissions
4
- VERSION = "0.4.13"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -13,9 +13,14 @@ module UnixLikePermissions
13
13
  end
14
14
 
15
15
  def load_permissions_map!(permissions)
16
+ PermissionSeries.send(:remove_const, :PERMISSIONS_MAP_WAS) if defined?(PermissionSeries::PERMISSIONS_MAP_WAS)
16
17
  PermissionSeries.const_set(:PERMISSIONS_MAP_WAS, PermissionSeries::PERMISSIONS_MAP)
18
+
19
+ PermissionSeries.send(:remove_const, :PERMISSIONS_MAP) if defined?(PermissionSeries::PERMISSIONS_MAP)
17
20
  PermissionSeries.const_set(:PERMISSIONS_MAP, permissions_map(permissions))
21
+
18
22
  PermissionSeries::PERMISSIONS_MAP.freeze
23
+ PermissionSeries::PERMISSIONS_MAP_WAS.freeze
19
24
 
20
25
  PermissionSeries.define_getters!
21
26
  puts "Permission map loaded: #{PermissionSeries::PERMISSIONS_MAP}"
@@ -29,3 +34,5 @@ module UnixLikePermissions
29
34
  end.to_h
30
35
  end
31
36
  end
37
+
38
+ ULP = UnixLikePermissions
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unix_like_permissions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.13
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Your Name
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rspec
@@ -55,7 +54,6 @@ metadata:
55
54
  homepage_uri: https://github.com/tee0zed/unix_like_permissions
56
55
  source_code_uri: https://github.com/your_username/unix_like_permissions
57
56
  changelog_uri: https://github.com/your_username/unix_like_permissions/blob/main/CHANGELOG.md
58
- post_install_message:
59
57
  rdoc_options: []
60
58
  require_paths:
61
59
  - lib
@@ -70,8 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
68
  - !ruby/object:Gem::Version
71
69
  version: '0'
72
70
  requirements: []
73
- rubygems_version: 3.4.17
74
- signing_key:
71
+ rubygems_version: 3.6.9
75
72
  specification_version: 4
76
73
  summary: Unix-like permissions management for Ruby applications
77
74
  test_files: []