Add licensing to a Ruby app
Use the application client for an MRI Ruby desktop or server application.
This preview supports Windows x64.
1. Install
Install the RubyGems preview with Ruby 3.2 or later:
gem install permitplane-client --version 0.1.0.alpha.1 --platform x64-mingw-ucrt --no-document --minimal-deps2. Connect your product
On your PermitPlane product page, click Download permitplane.json and Create test key. Bundle the configuration beside your application's entry file:
require "permitplane"
PermitPlane::PPLicense.configure(config_path: File.join(__dir__, "permitplane.json"))3. Check a feature
if PermitPlane::PPLicense.is_licensed("export")
puts "Export is enabled"
else
puts "Choose a licence to enable export"
endChecks use the saved signed licence offline. A due refresh can make a synchronous network request; run that check outside your GUI event thread.
4. Activate and close
Ask for the customer's licence key once, then activate it:
require "io/console"
print "Licence key: "
key = STDIN.noecho(&:gets).strip
PermitPlane::PPLicense.activate_with_key(key)
puts PermitPlane::PPLicense.status
PermitPlane::PPLicense.closeThe Windows host protects the installation key and saved state for the signed-in Windows user. Reopen the client after a process fork. Use the full client for hosted trial approval, enrollment, offline exchange and floating seats; schedule seat renewal from heartbeat_in_seconds and release the seat when work ends. Close clients explicitly or use the block form of Client.open.