https://github.com/olekscode/refrain
A tool for mining repetitive changes from the commit history of Pharo projects
https://github.com/olekscode/refrain
Last synced: 17 days ago
JSON representation
A tool for mining repetitive changes from the commit history of Pharo projects
- Host: GitHub
- URL: https://github.com/olekscode/refrain
- Owner: olekscode
- License: mit
- Created: 2020-10-14T12:50:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-30T11:06:22.000Z (over 4 years ago)
- Last Synced: 2025-04-05T14:43:45.886Z (11 months ago)
- Language: Smalltalk
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Refrain
[](https://travis-ci.org/olekscode/Refrain)
[](https://ci.appveyor.com/project/olekscode/refrain)
[](https://coveralls.io/github/olekscode/Refrain?branch=master)
[](https://raw.githubusercontent.com/olekscode/Refrain/master/LICENSE)
**Refrain** is a tool for mining repetitive changes from the commit history of [Pharo](https://pharo.org/) projects. It is based on the [A-Priori](https://github.com/pharo-ai/APriori) algorithm which goes through the change history of a given project and identifies all possible subsets of co-occuring changes that appear at least N times. For example, if method call to `doWithIndex:` was repetitively replaced with a call to `withIndexDo:` then Refrain will identify `#doWithIndex: -> #withIndexDo:` as a repetitive change.
In music and poetry, [_"refrain"_](https://en.wikipedia.org/wiki/Refrain) is the repetive phrase or verse, for example, a chorus of a song or repetitive lines in a poem.
> O Captain! my Captain! our fearful trip is done,
The ship has weather’d every rack, the prize we sought is won,
...
O Captain! my Captain! rise up and hear the bells;
Rise up—for you the flag is flung—for you the bugle trills,
...
— _extract from [O Captain! My Captain!](https://www.poetryfoundation.org/poems/45474/o-captain-my-captain) by Walt Whitman_
## How to install it?
To install Refrain, go to the Playground (Ctrl+OW) in your [Pharo](https://pharo.org/) image and execute the following Metacello script (select it and press Do-it button or Ctrl+D):
```Smalltalk
Metacello new
baseline: 'Refrain';
repository: 'github://olekscode/Refrain/src';
load.
```
## How to depend on it?
If you want to add a dependency on Refrain to your project, include the following lines into your baseline method:
```Smalltalk
spec
baseline: 'Refrain'
with: [ spec repository: 'github://olekscode/Refrain/src' ].
```
If you are new to baselines and Metacello, check out the [Baselines](https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md) tutorial on Pharo Wiki.
## How to use it?
```Smalltalk
refrain := Refrain
repositoryName: 'APriori'
branchName: 'master'
firstCommit: '84ed7471d4a6c0f5c070a6bfe8ab3371f0188035'
lastCommit: '57acf893b567393fec7967f0c32306fccda9321d'.
refrain minNumberOfRepetitions: 2.
refrain mineRepetitiveChanges.
```