{"id":25728361,"url":"https://github.com/kenjij/kajiki","last_synced_at":"2025-05-07T11:09:21.108Z","repository":{"id":27759867,"uuid":"31248050","full_name":"kenjij/kajiki","owner":"kenjij","description":"A simple gem to build daemons","archived":false,"fork":false,"pushed_at":"2020-01-14T00:23:54.000Z","size":727,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T21:20:58.502Z","etag":null,"topics":["daemon","option-parsing","ruby"],"latest_commit_sha":null,"homepage":"https://kenjij.github.io/kajiki/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenjij.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-24T06:42:45.000Z","updated_at":"2020-01-14T00:23:56.000Z","dependencies_parsed_at":"2022-07-18T23:18:35.135Z","dependency_job_id":null,"html_url":"https://github.com/kenjij/kajiki","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fkajiki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fkajiki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fkajiki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fkajiki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjij","download_url":"https://codeload.github.com/kenjij/kajiki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240766601,"owners_count":19854119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["daemon","option-parsing","ruby"],"created_at":"2025-02-26T00:17:32.842Z","updated_at":"2025-02-26T00:17:35.375Z","avatar_url":"https://github.com/kenjij.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kajiki\n\n[![Gem Version](https://badge.fury.io/rb/kajiki.svg)](http://badge.fury.io/rb/kajiki) [![Code Climate](https://codeclimate.com/github/kenjij/kajiki/badges/gpa.svg)](https://codeclimate.com/github/kenjij/kajiki) [![security](https://hakiri.io/github/kenjij/kajiki/master.svg)](https://hakiri.io/github/kenjij/kajiki/master)\n\nA simple gem to build daemons.\n\nIt provides basic functions to start and stop a daemon process. It also parses command-line options.\n\n## Requirements\n\n- Ruby 2.0.0 \u003c=\n\nKajiki has no gem dependencies. It uses [Optimist](https://rubygems.org/gems/optimist), but it's embedded.\n\n## Getting Started\n\n### Install\n\n```\n$ gem install kajiki\n```\n\n### Code\n\n```ruby\nrequire 'kajiki'\n\nopts = Kajiki.preset_options(:minimal)\nKajiki.run(opts) do |command|\n  case command\n  when 'start'\n    while true\n      puts 'Are we there yet?'\n      sleep(5)\n    end\n  when 'stop'\n    puts 'Arrived!'\n  end\nend\n```\n\n### Use\n\nTo see help:\n\n```\n$ myapp -h\nUsage: myapp [options] {start|stop}\n  -d, --daemonize    Run in the background\n  -p, --pid=\u003cs\u003e      Store PID to file\n  -h, --help         Show this message\n```\n\nTo start your app as a daemon:\n\n```\n$ myapp -d -p ~/myapp.pid start\n```\n\nTo stop your app running as a daemon:\n\n```\n$ myapp -p ~/myapp.pid stop\n```\n\n### More\n\nThere are two ways to use Kajiki.\n\n1. With preset command-line option parsing and auto daemonizing\n2. Custom option parsing and semi-auto daemonizing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Fkajiki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjij%2Fkajiki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Fkajiki/lists"}