PermitPlane Docs
All docs pages

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:

PowerShell
gem install permitplane-client --version 0.1.0.alpha.1 --platform x64-mingw-ucrt --no-document --minimal-deps

2. 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:

ruby
require "permitplane"

PermitPlane::PPLicense.configure(config_path: File.join(__dir__, "permitplane.json"))

3. Check a feature

ruby
if PermitPlane::PPLicense.is_licensed("export")
  puts "Export is enabled"
else
  puts "Choose a licence to enable export"
end

Checks 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:

ruby
require "io/console"

print "Licence key: "
key = STDIN.noecho(&:gets).strip
PermitPlane::PPLicense.activate_with_key(key)
puts PermitPlane::PPLicense.status
PermitPlane::PPLicense.close

The 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.