<commit_before># Baal

Baal is a Ruby wrapper for start-stop-daemon that attempts to make your start-stop-daemon scripts easier to build and
read while still providing the same options you are used to. Baal, through start-stop-daemon, provides a myriad of ways
to start new daemon processes and check the status of and stop existing ones.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'baal'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install baal

## Usage

The intention of Baal is to provide an easily-readable, step-by-step process of building start-stop-daemon scripts.

The wrapper provides all methods you are used to and attempts to alert you (with a nice red error) if it notices a mistake.

All building is centered around the Daemon object which can be accessed like so:

```ruby
# Preferred
daemon = Baal.new

# Not preferred
daemon = Baal::Daemon.new
```

Once you have your builder object, it is simply a matter of constructing the needed commands and options.

```ruby
# Start a new process in the background
daemon.instance_of_exec('/abs/path/to/executable')
daemon.with_name('dave')
```

Then to execute what you have built

```ruby
daemon.daemonize!
```

You can even check the current status of what is to you have built up so far

```ruby
puts daemon.executable
```

All of the methods that build up your start-stop-daemon script are chain-able

```ruby
# Check the status of a process
daemon.status.with_pid(1234).daemonize!
```

All options with dashes have been converted to underscores and there are many methods that have been written to be more
Ruby-like, however, if you still prefer the original command and options names, those are available as well 

```ruby
# Kill a process
daemon.stop.pid(1234).daemonize!<commit_msg>Fixed README<commit_after># Baal

Baal is a Ruby wrapper for start-stop-daemon that attempts to make your start-stop-daemon scripts easier to build and
read while still providing the same options you are used to. Baal, through start-stop-daemon, provides a myriad of ways
to start new daemon processes and check the status of and stop existing ones.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'baal'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install baal

## Usage

The intention of Baal is to provide an easily-readable, step-by-step process of building start-stop-daemon scripts.

The wrapper provides all methods you are used to and attempts to alert you (with a nice red error) if it notices a mistake.

All building is centered around the Daemon object which can be accessed like so:

```ruby
# Preferred
daemon = Baal.new

# Not preferred
daemon = Baal::Daemon.new
```

Once you have your builder object, it is simply a matter of constructing the needed commands and options.

```ruby
# Start a new process in the background
daemon.instance_of_exec('/abs/path/to/executable')
daemon.with_name('dave')
```

Then to execute what you have built

```ruby
daemon.daemonize!
```

You can even check the current status of what is to you have built up so far

```ruby
puts daemon.execution
```

All of the methods that build up your start-stop-daemon script are chain-able

```ruby
# Check the status of a process
daemon.status.with_pid(1234).daemonize!
```

All options with dashes have been converted to underscores and there are many methods that have been written to be more
Ruby-like, however, if you still prefer the original command and options names, those are available as well 

```ruby
# Kill a process
daemon.stop.pid(1234).daemonize!
{'fraction_non_alphanumeric': 0.06898454746136866, 'fraction_numerical': 0.004415011037527594, 'mean_word_length': 4.2688953488372094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '584431', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1007, 'n_words': 516}