<commit_before># Slack::Post

Just a simple thing to post messages to your [Slack](http://slack.com) rooms.

## Installation

Add this line to your application's Gemfile:

    gem 'slack-post'

And then execute:

    $ bundle install

## Usage

Example:
```ruby
require 'slack/post'
Slack::Post.configure(
  subdomain: 'myslack',
  token: '<KEY>',
  username: 'roboto, mr.'
)
Slack::Post.post "Domo arigato.", '#general'
```

### slack-post Command

slack-post comes with a `slack-post` command so you can send messages from the command line:
<commit_msg>update README for attachment support<commit_after># Slack::Post

Just a simple thing to post messages to your [Slack](http://slack.com) rooms.

## Installation

Add this line to your application's Gemfile:

    gem 'slack-post'

And then execute:

    $ bundle install

## Usage

Example:
```ruby
require 'slack/post'
Slack::Post.configure(
  subdomain: 'myslack',
  token: '<KEY>',
  username: 'roboto, mr.'
)
Slack::Post.post "Domo arigato.", '#general'
```

### Attachments

slack-post supports message attachments per Slack's [Attachment](https://api.slack.com/docs/attachments) specification.

Use `Slack::Post.post_with_attachments` to send a message with any number of attachments:
```ruby
attachments = [
  {
      fallback: "Required text summary...",
      text: "Optional text that should appear within the attachment",
      pretext: "Optional text that should appear above the formatted data",
      color: "#36a64f",
      fields: [
          {
              title: "Required Field Title",
              value: "Text value of the field.",
              short: false
          }
      ]
  }
]

Slack::Post.post_with_attachments "Domo arigato.", attachments, '#general'
```

### slack-post Command

slack-post comes with a `slack-post` command so you can send messages from the command line:

{'fraction_non_alphanumeric': 0.12372243141473911, 'fraction_numerical': 0.002151694459386767, 'mean_word_length': 3.5145631067961167, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '2573855', 'n_tokens_mistral': 598, 'n_tokens_neox': 573, 'n_words': 193}