<commit_before># Tasklist

Tasklist parse Github Flavor Markdown format task list into taslist.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'tasklist', :git => 'https://github.com/sumipan/tasklist.rb.git', :branch => 'master'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install tasklist

## Usage

```ruby
require 'tasklist/github'

github = Github::Client.new
github.setup(options)

github.issues.get(:number => number).tasklists.each do |tasklist|
  tasklist.attribute('attribute name')

  tasklist.tasks.each do |task|
    task.is_done?
    task.title
    task.assignee
    task.remaining_time
  end
end
```

Or

```ruby
require 'tasklist'

tasklist = Tasklist.parse(text)
tasklist.attribute('attribute name')

tasklist.tasks.each do |task|
  task.is_done?
  task.title
  task.assignee
  task.remaining_time
end
```

### Filter task

```ruby
tasklist.select {|task,tasklist| task.assignee == '@sumipan' }.tasks.each do |task|
  # do something
end
```

### Merge tasklist

```ruby
merged_tasklist = tasklist.merge(another_tasklist)
```

Tasks are sorted in the order in which they are added.

## Writing rule

Only issue of comment is subject.
Comments must begin with the word "タスク".
Describe the task at Github Flavor Markdown format.

"=>" And "," can not contain attribute key and value. These will be used as a delimiter.

```
タスク attribute 1 => value, attribute 2 => value

- [ ] Task title @sumipan 1h<commit_msg>Fix README<commit_after># Tasklist

Tasklist parse Github Flavor Markdown format task list into taslist.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'tasklist', :git => 'https://github.com/sumipan/tasklist.rb.git', :branch => 'master'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install tasklist

## Usage

```ruby
require 'tasklist/github'

github = Github::Client.new
github.setup(options)

github.issues.get(:number => number).body.tasklists.each do |tasklist|
  tasklist.attr('attribute name')

  tasklist.tasks.each do |task|
    task.is_done?
    task.title
    task.assignee
    task.remaining_time
  end
end
```

Or

```ruby
require 'tasklist'

tasklist = Tasklist.parse(text)
tasklist.attr('attribute name')

tasklist.tasks.each do |task|
  task.is_done?
  task.title
  task.assignee
  task.remaining_time
end
```

### Filter

```ruby
tasklist.tasks.select{|t|
  !t.is_done?
}.each do|task|
  # do something
end
```

### Sort

```ruby
tasklist.tasks.sort{|a,b|
  a.tasklist.attr('priority').to_i <=> b.tasklist.attr('priority').to_i
}.each do |task|
  # do something
end
```

### Merge

```ruby
tasklist.merge(tasklist2)
```

Tasks are sorted in the order in which they are added.

## Writing rule

Only issue of comment is subject.
Comments must begin with the word "タスク".
Describe the task at Github Flavor Markdown format.

"=>" And "," can not contain attribute key and value. These will be used as a delimiter.

```
タスク attribute 1 => value, attribute 2 => value

- [ ] Task title @sumipan 1h
{'fraction_non_alphanumeric': 0.12729057591623036, 'fraction_numerical': 0.0022905759162303663, 'mean_word_length': 4.019704433497537, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 16, 'https://': 2, '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': '7091106', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1020, 'n_words': 315}