<commit_before>JIRA Glue
=========

Command line utility app for JIRA tracking system. 

Has support for a simple client-server model so that the server can be set up once with JIRA credentials, then any local client script (such as a keyboard shortcut via Automator) can easily connect and get JIRA information.

In order to use any part of jira-glue or the handy jira-wrapper class, there is some one time setup needed. The client-server configuration is optional, additional setup.

### One time setup

##### Create a file called `config.yml` in root of directory, with configuration details

```yaml
app:
  name: jira-glue
  title: JIRA glue

jira_client:     
  base_url: https://your-company.atlassian.net
  # authentication params

fields:
  impact: false
  
# optional (to use Safari)
# browser:
#   name: Safari
```

##### Get Oauth Credentials

To authenticate to the JIRA API via Oauth, you will need to get an access token and key from JIRA.  You will then store these locally in the config.yml file (alternatively you can use environment variables with ERB substitution, see below).

Oauth Token Generator for Invoca Instance: https://jira-glue.herokuapp.com/

1) Paste the provided key/values into the `config.yml`:

```yaml
app:
  name: jira-glue
  title: JIRA glue

jira_client:     
  # ---- PASTE OAUTH CREDENTIALS FROM GENERATOR HERE: ----
  base_url: https://your-company.atlassian.net
  consumer_key: '...'
  access_token: '...'
  access_key: '...'

fields:
  impact: false
```

2) Save private key that was used to generate the Application Link in JIRA to `rsakey.pem` in the root folder
  * (Can be found in LastPass under Jira Glue)


[View other Authentication options](https://github.com/nburwell/jira-glue/wiki/Authentication)

##### Setup Ruby and run bundle install (tested against Ruby 1.9.3 and 2.1.2)

```bash
rbenv local 2.1.2
gem install bundler -v 1.5.3  # tested against this version, likely newer versions also work
bundle install
rbenv rehash
```

##### Test it out!
```<commit_msg>Generalized readme again to have a more accurate, generic setup<commit_after>JIRA Glue
=========

Command line utility app for JIRA tracking system. 

Has support for a simple client-server model so that the server can be set up once with JIRA credentials, then any local client script (such as a keyboard shortcut via Automator) can easily connect and get JIRA information.

In order to use any part of jira-glue or the handy jira-wrapper class, there is some one time setup needed. The client-server configuration is optional, additional setup.

### One time setup

##### Create a file called `config.yml` in root of directory, with configuration details

```yaml
app:
  name: jira-glue
  title: JIRA glue

jira_client:     
  base_url: https://your-company.atlassian.net
  # authentication params (see readme)

fields:
  impact: false
  
# optional (to use Safari)
# browser:
#   name: Safari
```

##### Get Oauth Credentials

To authenticate to the JIRA API via Oauth, you will need to have an OAuth app configured on your JIRA instance (in the Application Links section), and you will then provide in the config.yml the consumer_key (App specific), access_token and access_key (user specific). This assumes you can already generate Oauth tokens on a user's behalf with that consumer_key as well.

1) Provide the required key/values in the `config.yml` under `jira_client`:

```yaml
app:
  name: jira-glue
  title: JIRA glue

jira_client:     
  # ---- PASTE OAUTH CREDENTIALS FROM GENERATOR HERE: ----
  base_url: https://your-company.atlassian.net
  consumer_key: '...'
  access_token: '...'
  access_key: '...'

fields:
  impact: false
```

2) Save the private key that was used when setting up the app in JIRA's Application Link to `rsakey.pem` in the root folder
  * This is gitignored by default, do not check this into any public repos

[View other Authentication options, including user & password](https://github.com/nburwell/jira-glue/wiki/Authentication)

##### Setup Ruby and run bundle install (tested against Ruby 1.9.3 and 2.1.2)

```bash
bundle install
rbenv rehash
```

##### Test it out!
```
{'fraction_non_alphanumeric': 0.09242680861359787, 'fraction_numerical': 0.005323009920154851, 'mean_word_length': 3.9272943980929678, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, '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': '435081', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1217, 'n_words': 543}