Official Ruby client library for the Rasepi API — a multilingual-first collaborative documentation platform with forced expiry and plugin architecture.
Add to your Gemfile:
gem 'rasepi'Or install directly:
gem install rasepirequire 'rasepi'
client = Rasepi::Client.new(
base_url: 'https://your-instance.rasepi.com',
access_token: 'your-access-token'
)
# List hubs
hubs = client.hubs.list
hubs.each { |hub| puts "#{hub['name']} (#{hub['key']})" }
# Get an entry
entry = client.entries.get(entry_id)
puts entry['title']
# Create a new entry
new_entry = client.entries.create(
hub_key: 'engineering',
key: 'getting-started',
title: 'Getting Started Guide',
content: '<p>Hello world</p>',
original_language: 'en',
expiry_days: 90
)client = Rasepi::Client.new(base_url: 'https://your-instance.rasepi.com')
# Step 1: Get the OAuth login URL
login_url = client.auth.get_login_url('google', redirect_uri: 'https://your-app.com/callback')
# Step 2: Exchange the code
tokens = client.auth.exchange_code(auth_code)
# Client automatically stores and uses the tokens
# Tokens are refreshed automatically when expiredtokens = client.auth.refresh_token(refresh_token)client = Rasepi::Client.new(
base_url: 'http://localhost:5000',
dev_token: { tenant_id: tenant_id, user_id: user_id }
)client.hubs.list
client.hubs.get('engineering')
client.hubs.create(key: 'eng', name: 'Engineering', default_expiry_days: 90)
client.hubs.update('engineering', name: 'Engineering Docs')
client.hubs.delete('engineering')
client.hubs.transfer_ownership('engineering', new_owner_id)client.entries.list_by_hub('engineering')
client.entries.get(entry_id)
client.entries.create(hub_key: 'eng', key: 'guide', title: 'Guide', content: '<p>Hi</p>', original_language: 'en', expiry_days: 90)
client.entries.update(entry_id, title: 'Updated Title', content: '<p>Updated</p>')
client.entries.publish(entry_id)
client.entries.renew(entry_id)
client.entries.delete(entry_id)client.translations.list(entry_id)
client.translations.get(entry_id, 'de')
client.translations.create(entry_id, 'de', title: 'Titel', content: '<p>Inhalt</p>')
client.translations.get_status(entry_id, 'de')
client.translations.get_stale_blocks(entry_id, 'de')
client.translations.mark_up_to_date(entry_id, 'de')client.analytics.get_summary(entry_id)
client.analytics.get_events(entry_id, skip: 0, take: 50)
client.analytics.report_time_spent(entry_id, 120)results = client.ai.search(query: 'how to deploy', mode: 'hybrid')
conversation = client.ai.create_conversation(title: 'My Question')
response = client.ai.send_message(conversation['id'], content: 'How to set up CI/CD?')client.portal.get_feed
client.portal.get_topics
client.portal.get_content('engineering', 'getting-started', language: 'en')
client.portal.search('deployment guide')link = client.sharing.create('getting-started', expires_at: (Time.now + 7*24*3600).iso8601)
links = client.sharing.list('getting-started')
client.sharing.revoke('getting-started', link_id)begin
hub = client.hubs.get('non-existent')
rescue Rasepi::ApiError => e
puts "Error #{e.status_code}: #{e.message}"
end- Ruby 3.1+
faradaygem
MIT — see LICENSE for details.