berm
Version, currently 0.1.02 versions
- 0.2.0latestOct 13, 2020
- 0.1.0not indexedOct 13, 2020
github.com/giuseongit/berm
Simple library that helps to manage permissions.
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
berm:
github: giuseongit/berm
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
Berm

Berm is a simple library that helps to manage permissions.
The name come from binary permmissions because it can easily manage permissions using byte operations.
Rationale
bit operations are quite simple (and thus fast), and it's sometimes useful to have permission system that can be used programmatically, think about showing or hiding certain ui features based on the context. So the goal of this tool is to have a good permission system with the least hoverhead as possbile while being easy to use.
Usage
The class Berm::Flag represent the permission manager.
It needs to know which flags it will have so you can use the Berm::FlagsConstant("Myvar") annotation or declaring the FlagValues variable. Only string and symbol array are supported.
require "berm"
class MyFlag < Berm::Flag
FlagValues = %i(Read Write)
# Foreach flag value (aka permission) a constant is generated
# Flags can be combined using the or operator
ReadWrite = Write | Read
end
# For every permission a method `permits_{permission}?` is generated
puts MyFlag::Read.permits_read? # -> true
puts MyFlag::Read.permits_read? # -> false
puts MyFlag::ReadWrite.permits_read? # -> true
puts MyFlag::ReadWrite.permits_write? # -> true
# Also a None constant is generated to match the state of no permissions at all
# The permits_something? tells wheter there's at least one permission enabled
# it can be called on every permission
puts MyFlag::None.permits_something? # -> false
This is the basic usage, you can find more usage examples in examples.
Contributing
- Fork it (https://github.com/your-github-user/berm/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Giuseppe Pagano - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Oct 13, 2020
- Commit
e5b8028b4138- Indexed
- not yet
Dependents
Repository
github.com/giuseongit/berm
Metadata
- Created
- Aug 18, 2026
- Updated
- Oct 22, 2026
- Synced
- Oct 22, 2026
- Versions
- 2