<commit_before># YAPFAC: Yet Another Parser for Apache Configuration

YAPFAC provides a parser to read and write Apache configuration files. YAPFAC also provides a secure RESTful API for doing this remotely, providing seamless controll of a number of Apache servers.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'yapfac', git: 'eiwi1101/yapfac'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install yapfac

## Usage

```ruby
local_server = Yapfac.new
local_server.sites_available #=> ["000-default.conf", "something.conf"]

begin
  remote_server = Yapfac.new('some.host.example.com')
  remote_server.a2ensite('000-default.conf')
rescue Yapfac::ConnectionError => e
  puts "Unable to connect to #{e.hostname}: #{e.message}"
end
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing<commit_msg>Updated readme to be kinda accurate.<commit_after># YAPFAC: Yet Another Parser for Apache Configuration

YAPFAC provides a parser to read and write Apache configuration files. YAPFAC also provides a secure RESTful API for doing this remotely, providing seamless controll of a number of Apache servers.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'yapfac', git: 'eiwi1101/yapfac'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install yapfac

## Usage

```ruby
default = Yapfac::Apache::Site.new("/etc/apache2/sites-available/000-default.conf")
puts default.to_s #=> Converts the config back into Apache Config format.
puts default.to_h #=> Converts the config into a hash.

sites = Yapfac::Apache.sites_available
puts sites.first.to_s #=> Dumps the configuration file for the first site in sites-available

online = Yapfac::Apache.sites_enabled #=> Just reads the sites-enabled dir.

### COMING SOON

Yapfac::Apache.a2ensite  "example.com.conf" #=> Enables site
Yapfac::Apache.a2dissite "000-default.conf" #=> Disables site

# Self-explanatory
Yapfac::Apache.reload
Yapfac::Apache.restart

Yapfac::Apache.a2ensite! "example.com.conf" #=> Enables site and reloads Apache. Same for ::a2dissite.
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

For ease in testing, you can modify `bin/quicktest` to run through some real-world scenarios. (Currently, `bin/quicktest` requires apache2 to be installed.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing
{'fraction_non_alphanumeric': 0.09392760993119952, 'fraction_numerical': 0.00807657792402034, 'mean_word_length': 4.658206429780034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3123327', 'n_tokens_mistral': 1029, 'n_tokens_neox': 979, 'n_words': 415}