<commit_before># Redshift::Client [![Build Status](https://travis-ci.org/dakatsuka/redshift-client.svg)](https://travis-ci.org/dakatsuka/redshift-client) [![Gem Version](https://badge.fury.io/rb/redshift-client.svg)](https://badge.fury.io/rb/redshift-client)

This gem provides a way to connect to AWS Redshift using the [ruby-pg](https://github.com/ged/ruby-pg).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'redshift-client'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install redshift-client

## Usage

### Using with your application

```ruby
require 'rubygems'
require 'redshift-client'
```

After that you configure the url of Redshift:

```
$ export REDSHIFT_URL="redshift://user:password@*****.region.redshift.amazonaws.com:5439/dbname"
```

Please refer to the following code:

```ruby
require 'redshift/client'

Redshift::Client.establish_connection

Redshift::Client.connection # instance of PG::Connection
Redshift::Client.connection.exec("SELECT GETDATE()").first
# => {"getdate"=>"2015-10-08 05:17:40"}
```

## Development
<commit_msg>Fix README<commit_after># Redshift::Client [![Build Status](https://travis-ci.org/dakatsuka/redshift-client.svg)](https://travis-ci.org/dakatsuka/redshift-client) [![Gem Version](https://badge.fury.io/rb/redshift-client.svg)](https://badge.fury.io/rb/redshift-client)

This gem provides a way to connect to AWS Redshift using the [ruby-pg](https://github.com/ged/ruby-pg).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'redshift-client'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install redshift-client

## Usage

### Using with your application

```ruby
require 'rubygems'
require 'redshift/client'
```

After that you configure the url of Redshift:

```
$ export REDSHIFT_URL="redshift://user:password@*****.region.redshift.amazonaws.com:5439/dbname"
```

Please refer to the following code:

```ruby
Redshift::Client.establish_connection

Redshift::Client.connection # instance of PG::Connection
Redshift::Client.connection.exec("SELECT GETDATE()").first
# => {"getdate"=>"2015-10-08 05:17:40"}
```

## Development

{'fraction_non_alphanumeric': 0.16063348416289594, 'fraction_numerical': 0.016289592760180997, 'mean_word_length': 5.21067415730337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 10, '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': '7601344', 'n_tokens_mistral': 782, 'n_tokens_neox': 717, 'n_words': 163}