New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

app-service

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-service

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= App::Service

A library for service application daemonize.

== Features

  • Easy switch from terminal application to background service.

== Installation

Add this line to your app's Gemfile:

[source,ruby]

gem 'app-service'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install app-service
or
$ gem install -l app-service-x.x.x.gem

== Usage

=== Example

[source,ruby]

require "app/service"

execute service application with default settings.

App::Service.setup( ARGV.shift )

execute service application with custom settings.

App::Service.setup( ARGV.shift, **options )

[source,bash]

run on terminal application.

ruby sample.rb run

start background service.

ruby sample.rb start

stop background service.

ruby sample.rb stop

restart background service.

ruby sample.rb restart

show status of background service.

ruby sample.rb status

== Reference

=== Setup App::Service.

[source,ruby]

App::Service.setup( mode = nil, **options )

  • Result: ** none.

  • Parameter: ** mode: Run mode. [run start stop restart status] ** argv: Commandline arguments. (default: ARGV) ** app_dir: Application working directory. (default: "..") ** tmp_dir: Temporary directory. (default: "tmp") ** log_dir: Logging directory. (default: "log") ** log_sync: Logging sync mode. (default: false) ** shift_age: Log file count, or log change event. [0.., "daily", "weekly", "monthly"] (default: 0) ** shift_size: Log rotation limit size. (default: 1048576) ** log_level: Log level. (default: Logger::Severity::DEBUG) [0:DEBUG, 1:INFO, 2:WARN, 3:ERROR, 4:FATAL, 5:UNKNOWN] ** progname: (default: nil) ** formatter: (default: Formatter.new) ** datetime_format: (default: '%Y-%m-%d %H:%M:%S') ** shift_period_suffix: (default: '%Y%m%d')

=== Shutdown App::Service.

[source,ruby]

App::Service.shutdown( cond = 0 )

  • Result: ** none.

  • Parameter: ** cond: process exit condition. (default: 0)

=== Get run mode.

[source,ruby]

App::Service.mode

  • Result: ** String: Run mode. [run start stop restart status]

  • Parameter: ** none.

=== Get logger instance.

[source,ruby]

App::Service.logger

  • Result: ** Logger instance.

  • Parameter: ** none.

== Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/arimay/app-service.

== License

The gem is available as open source under the terms of the http://opensource.org/licenses/MIT[MIT License].

Copyright (c) ARIMA Yasuhiro arima.yasuhiro@gmail.com

FAQs

Package last updated on 27 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc