codelog 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +48 -0
- data/CODE_OF_CONDUCT.md +46 -0
- data/CONTRIBUTING.md +63 -0
- data/LICENSE +21 -0
- data/README.md +106 -0
- data/Rakefile +6 -0
- data/bin/codelog +6 -0
- data/bin/setup +8 -0
- data/lib/codelog.rb +8 -0
- data/lib/codelog/cli.rb +21 -0
- data/lib/codelog/command/new.rb +30 -0
- data/lib/codelog/command/release.rb +15 -0
- data/lib/codelog/command/setup.rb +34 -0
- data/lib/codelog/command/step/changelog.rb +45 -0
- data/lib/codelog/command/step/delete.rb +21 -0
- data/lib/codelog/command/step/version.rb +51 -0
- data/lib/codelog/version.rb +3 -0
- data/lib/fixtures/template.yml +20 -0
- metadata +153 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1a8af4bf07044d067f6f00a6e08f346c9fa58747
|
4
|
+
data.tar.gz: 1eb207cad96a79dafbefb197108dec71d122fcd1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4dfcb4950c72183f4de9a230a10d081050857a0a8747980c9d3f81676af9dd8129715560786809aaab11d424907d1e08842518744994e9cfc4ecfb9f889007b0
|
7
|
+
data.tar.gz: 336f554944b2cc621c11a033f316efb13de3b8d26d957cc9d728043c200965d4ec6003ec4804e2af87bfbf1da132d6dbaa334238032e8a0105e0f0697bd66812
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
4
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
5
|
+
|
6
|
+
## 0.2.2
|
7
|
+
### Changed
|
8
|
+
- Setup command copies a template.yml with an example data.
|
9
|
+
- Required files to gemspec
|
10
|
+
- Setup generates a gitkeep file
|
11
|
+
|
12
|
+
---
|
13
|
+
## 0.2.1
|
14
|
+
### Removed
|
15
|
+
- Unnecessary code on bin
|
16
|
+
|
17
|
+
---
|
18
|
+
## 0.2.0
|
19
|
+
### Added
|
20
|
+
- Command Line Interface (CLI) through Thor
|
21
|
+
- Rubocop
|
22
|
+
- Changelog
|
23
|
+
- Contributing guide
|
24
|
+
- License
|
25
|
+
- Code of conduct
|
26
|
+
- CodeClimate
|
27
|
+
- CI through Travis
|
28
|
+
|
29
|
+
### Changed
|
30
|
+
- All commands now are called by `codelog` command
|
31
|
+
- Updated README.md
|
32
|
+
|
33
|
+
### Removed
|
34
|
+
- Separated command to create release without deleting unreleased files
|
35
|
+
- Separated command to delete unreleased files
|
36
|
+
- Separated command to update changelog without releasing new version
|
37
|
+
|
38
|
+
---
|
39
|
+
## 0.1.0
|
40
|
+
### Added
|
41
|
+
- Automated setup to create folder structure and template
|
42
|
+
- Automated Changelog generator
|
43
|
+
- Automated Release file generator
|
44
|
+
- Automated Change file generator
|
45
|
+
- Automated unreleased files deletion
|
46
|
+
- Command to full Changelog generation flow
|
47
|
+
|
48
|
+
---
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
## Our Standards
|
8
|
+
|
9
|
+
Examples of behavior that contributes to creating a positive environment include:
|
10
|
+
|
11
|
+
* Using welcoming and inclusive language
|
12
|
+
* Being respectful of differing viewpoints and experiences
|
13
|
+
* Gracefully accepting constructive criticism
|
14
|
+
* Focusing on what is best for the community
|
15
|
+
* Showing empathy towards other community members
|
16
|
+
|
17
|
+
Examples of unacceptable behavior by participants include:
|
18
|
+
|
19
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
20
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
21
|
+
* Public or private harassment
|
22
|
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
23
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
24
|
+
|
25
|
+
## Our Responsibilities
|
26
|
+
|
27
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
28
|
+
|
29
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
30
|
+
|
31
|
+
## Scope
|
32
|
+
|
33
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
34
|
+
|
35
|
+
## Enforcement
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at opensource@codus.com.br. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
38
|
+
|
39
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
40
|
+
|
41
|
+
## Attribution
|
42
|
+
|
43
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
44
|
+
|
45
|
+
[homepage]: http://contributor-covenant.org
|
46
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# How to contribute to CodeLog
|
2
|
+
|
3
|
+
We at Codus welcome all kinds of contributions. By participating you agree to follow our [code of conduct].
|
4
|
+
|
5
|
+
If you find an issue, have an idea for a new feature or any improvement, we would like to hear from you. You can report these as issues or submit pull requests. In order to help us maintain an organized process, please read the following guidelines before submiting any of those.
|
6
|
+
|
7
|
+
## Reporting Issues
|
8
|
+
|
9
|
+
Before reporting new issues, please verify if there are existing issues for the same problem by searching at [issues].
|
10
|
+
|
11
|
+
To help us attend you quickly, please make sure to give a clear name to the issue and to describe it with all relevant information. Giving examples can help us understand your suggestion or, in case of issues, reproduce the problem.
|
12
|
+
|
13
|
+
## Sending Pull Requests
|
14
|
+
|
15
|
+
First check the Network at Insights tab to see if there are anyone already working on the same feature/fix you want to submit.
|
16
|
+
|
17
|
+
Then look at [issues] to see if there are any related issues that your feature/fix should consider. If there are none, please create one describing your implementations intent. You should always mention a related issue in the pull request description.
|
18
|
+
|
19
|
+
While writing code, follow the code conventions that you find in the existing code. It make it easier to read. Try to write short, clear and objective commit messages too. You can squash your commits and improve your commit messages once your done.
|
20
|
+
|
21
|
+
Also make sure to add good tests to your new code. Only refactoring of tested features and documentation do not need new tests. These way your changes will be documented and future changes will not break what you added.
|
22
|
+
|
23
|
+
### Step-by-step
|
24
|
+
|
25
|
+
- Fork the repository.
|
26
|
+
- Commit and push until your are proud of what you have done.
|
27
|
+
- Execute the full test suite to ensure all is passing.
|
28
|
+
- Make sure your code does not produce RuboCop offenses.
|
29
|
+
- Squash commits if necessary.
|
30
|
+
- If what you are submit is a noteworthy change, then create a [change] for us to add to the release notes. If you are not sure, create a change anyway.
|
31
|
+
- Push to your repository.
|
32
|
+
- Open a pull request to the master of the gem's repository.
|
33
|
+
- Give your pull request a good description. Do not forget to mention a related issue.
|
34
|
+
|
35
|
+
## Running Tests
|
36
|
+
|
37
|
+
Once you cloned the gem at your local machine you should run the following command at its root folder:
|
38
|
+
|
39
|
+
``` bash
|
40
|
+
$ bundle
|
41
|
+
```
|
42
|
+
|
43
|
+
After that, you can execute the tests suite by running the following command at the root folder:
|
44
|
+
|
45
|
+
``` bash
|
46
|
+
$ rspec
|
47
|
+
```
|
48
|
+
|
49
|
+
## Adding entry to Changelog
|
50
|
+
|
51
|
+
As we can add more than one pull request in a release, we ask you to simply add a change file living us to generate the release file and update the changelog. You can do it by following the following steps:
|
52
|
+
|
53
|
+
- Run `codelog new`.
|
54
|
+
- Describe your changes in the generated change file following the template.
|
55
|
+
- Commit it too.
|
56
|
+
|
57
|
+
Not every change should be a entry in the changelog. Only the ones that impact end users.
|
58
|
+
We use and recommend the changelog format proposed at [Keep a Changelog].
|
59
|
+
|
60
|
+
[code of conduct]: https://github.com/codus/codelog/blob/master/CODE_OF_CONDUCT.md
|
61
|
+
[issues]: https://github.com/codus/codelog/issues
|
62
|
+
[change]: #adding-entry-to-changelog
|
63
|
+
[Keep a Changelog]: http://keepachangelog.com/en/1.0.0/
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Codus Tecnologia
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
![CodeLog logo](https://raw.githubusercontent.com/codus/codelog/master/codelog.png)
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/codus/codelog.svg?branch=master)](https://travis-ci.org/codus/codelog)
|
4
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/6f5885536c6b5c82f304/maintainability)](https://codeclimate.com/github/codus/codelog/maintainability)
|
5
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/6f5885536c6b5c82f304/test_coverage)](https://codeclimate.com/github/codus/codelog/test_coverage)
|
6
|
+
|
7
|
+
This gem provides a simple way to manage changelogs, avoiding conflicts and missplaced informations. Changes are handled as if they were "migrations" and built when releasing a version, allowing a more precise knowledge of what changes were made to what version.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'codelog'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
``` bash
|
20
|
+
$ bundle
|
21
|
+
```
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
``` bash
|
26
|
+
$ gem install codelog
|
27
|
+
```
|
28
|
+
|
29
|
+
## Setup
|
30
|
+
|
31
|
+
After the installation run the following command to generate the `changelogs` folder structure and the `template.yml` file:
|
32
|
+
|
33
|
+
``` bash
|
34
|
+
$ codelog setup
|
35
|
+
```
|
36
|
+
|
37
|
+
The `template.yml` file will be used to create a new change file. Change files from `unreleased` folder will compose the next release file when generated.
|
38
|
+
You should populate this template with the sections and topic examples desired for describe the current release that will be later added in the `CHANGELOG.md` file.
|
39
|
+
The template can be as the following example:
|
40
|
+
|
41
|
+
```yaml
|
42
|
+
"Added":
|
43
|
+
- New features implemented
|
44
|
+
|
45
|
+
"Changed":
|
46
|
+
- Changes to existing feature
|
47
|
+
|
48
|
+
"Deprecated":
|
49
|
+
- Features that are soon to be removed
|
50
|
+
|
51
|
+
"Removed":
|
52
|
+
- Features that were removed
|
53
|
+
|
54
|
+
"Fixed":
|
55
|
+
- Changes to broken code
|
56
|
+
|
57
|
+
"Security":
|
58
|
+
- Changes that fix vulnerabilities
|
59
|
+
|
60
|
+
"Deploy notes":
|
61
|
+
- Changes that should impact the deploy process and what should be made before it
|
62
|
+
```
|
63
|
+
|
64
|
+
## Usage
|
65
|
+
|
66
|
+
After the initial setup every time a change is made, the user should run the following command in the project root path:
|
67
|
+
|
68
|
+
``` bash
|
69
|
+
$ codelog new
|
70
|
+
```
|
71
|
+
|
72
|
+
This will generate a change file on `changelogs/unreleased/` from the `template.yml` named with a timestamp value followed by `_change.yml`.
|
73
|
+
|
74
|
+
The new change file should be filled with informations about the implemented change, all unused topics should be erased and the file committed.
|
75
|
+
|
76
|
+
When closing a version you should run the following command:
|
77
|
+
|
78
|
+
``` bash
|
79
|
+
$ codelog release {x.y.z}
|
80
|
+
```
|
81
|
+
|
82
|
+
It will execute 3 steps:
|
83
|
+
|
84
|
+
- Generate a new release file at `changelogs/releases/` by merging all change files at `changelogs/unreleased/`
|
85
|
+
- Deletes the change files at `changelogs/unreleased/` because they now compose the new release. If it was not deleted, the change would appear repeated in the next release.
|
86
|
+
- Updates the `CHANGELOG.md` file by merging all the releases at `changelogs/releases/`.
|
87
|
+
|
88
|
+
## Contributing
|
89
|
+
|
90
|
+
Issue reports and pull requests are welcome on GitHub at https://github.com/codus/codelog. Read our [Contributing guide] for instructions on how to do it.
|
91
|
+
|
92
|
+
## Supported Ruby Versions
|
93
|
+
|
94
|
+
- Ruby 2.1.10+
|
95
|
+
- JRuby 9.1.14.0+
|
96
|
+
|
97
|
+
## License
|
98
|
+
|
99
|
+
This software was released under MIT License. Read [License] for further informations.
|
100
|
+
|
101
|
+
Copyright 2018 Codus. http://www.codus.com.br
|
102
|
+
|
103
|
+
You are not granted rights or licenses to the trademarks of Codus, including without limitation the Codelog name or logo.
|
104
|
+
|
105
|
+
[Contributing guide]: https://github.com/codus/codelog/blob/master/CONTRIBUTING.md
|
106
|
+
[License]: https://github.com/codus/codelog/blob/master/LICENSE
|
data/Rakefile
ADDED
data/bin/codelog
ADDED
data/bin/setup
ADDED
data/lib/codelog.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'codelog/version'
|
2
|
+
require 'codelog/cli'
|
3
|
+
require 'codelog/command/setup'
|
4
|
+
require 'codelog/command/new'
|
5
|
+
require 'codelog/command/release'
|
6
|
+
require 'codelog/command/step/changelog'
|
7
|
+
require 'codelog/command/step/delete'
|
8
|
+
require 'codelog/command/step/version'
|
data/lib/codelog/cli.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module Codelog
|
4
|
+
class CLI < Thor
|
5
|
+
desc 'setup', 'Generate the changelogs folder structure and the template.yml file'
|
6
|
+
def setup
|
7
|
+
Codelog::Command::Setup.run
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'new', 'Generate a file from the template for the unreleased changes'
|
11
|
+
method_option :change, aliases: '-c', default: true, desc: 'Create a change file'
|
12
|
+
def new
|
13
|
+
Codelog::Command::New.run
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'release [VERSION]', 'Generate new release updating changelog'
|
17
|
+
def release(version_number)
|
18
|
+
Codelog::Command::Release.run version_number
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Codelog
|
4
|
+
module Command
|
5
|
+
class New
|
6
|
+
include FileUtils
|
7
|
+
|
8
|
+
def self.run
|
9
|
+
Codelog::Command::New.new.run
|
10
|
+
end
|
11
|
+
|
12
|
+
def run
|
13
|
+
chdir Dir.pwd do
|
14
|
+
# This script create a change file for the changelog documentation.
|
15
|
+
|
16
|
+
full_file_name = "changelogs/unreleased/#{Time.now.to_i}_change.yml"
|
17
|
+
|
18
|
+
puts "== Creating #{full_file_name} change file based on example =="
|
19
|
+
system! "cp changelogs/template.yml #{full_file_name}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def system!(*args)
|
26
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Codelog
|
2
|
+
module Command
|
3
|
+
class Release
|
4
|
+
def self.run(version_number)
|
5
|
+
Codelog::Command::Release.new.run version_number
|
6
|
+
end
|
7
|
+
|
8
|
+
def run(version_number)
|
9
|
+
Codelog::Command::Step::Version.run version_number
|
10
|
+
Codelog::Command::Step::Delete.run
|
11
|
+
Codelog::Command::Step::Changelog.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Codelog
|
4
|
+
module Command
|
5
|
+
class Setup
|
6
|
+
include FileUtils
|
7
|
+
|
8
|
+
TEMPLATE_FILE_PATH = File.dirname(__FILE__) + '/../../fixtures/template.yml'
|
9
|
+
|
10
|
+
def self.run
|
11
|
+
Codelog::Command::Setup.new.run
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
chdir Dir.pwd do
|
16
|
+
# This script provides the initial setup for the gem usage.
|
17
|
+
|
18
|
+
puts '== Creating folder structure and template =='
|
19
|
+
system! 'mkdir changelogs/'
|
20
|
+
system! 'mkdir changelogs/unreleased'
|
21
|
+
system! 'mkdir changelogs/releases'
|
22
|
+
system! "cp #{TEMPLATE_FILE_PATH} changelogs/template.yml"
|
23
|
+
system! 'touch changelogs/unreleased/.gitkeep'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def system!(*args)
|
30
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Codelog
|
4
|
+
module Command
|
5
|
+
module Step
|
6
|
+
class Changelog
|
7
|
+
include FileUtils
|
8
|
+
|
9
|
+
def self.run
|
10
|
+
Codelog::Command::Step::Changelog.new.run
|
11
|
+
end
|
12
|
+
|
13
|
+
def run
|
14
|
+
chdir Dir.pwd do
|
15
|
+
create_file_from changes
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def changes
|
22
|
+
version_changelogs = Dir['changelogs/releases/*.md']
|
23
|
+
version_changelogs.sort_by! do |file_name|
|
24
|
+
version_number = file_name.split('/').last.chomp('.md')
|
25
|
+
Gem::Version.new(version_number)
|
26
|
+
end.reverse!
|
27
|
+
version_changelogs.inject([]) do |partial_changes, version_changelog|
|
28
|
+
partial_changes + File.readlines(version_changelog)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def create_file_from(changes)
|
33
|
+
File.open('CHANGELOG.md', 'w+') do |f|
|
34
|
+
f.puts %(# Changelog
|
35
|
+
All notable changes to this project will be documented in this file.
|
36
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
37
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
38
|
+
)
|
39
|
+
f.puts(changes)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Codelog
|
4
|
+
module Command
|
5
|
+
module Step
|
6
|
+
class Delete
|
7
|
+
include FileUtils
|
8
|
+
|
9
|
+
def self.run
|
10
|
+
Codelog::Command::Step::Delete.new.run
|
11
|
+
end
|
12
|
+
|
13
|
+
def run
|
14
|
+
chdir Dir.pwd do
|
15
|
+
system('rm -rv changelogs/unreleased/*.yml')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module Codelog
|
5
|
+
module Command
|
6
|
+
module Step
|
7
|
+
class Version
|
8
|
+
include FileUtils
|
9
|
+
|
10
|
+
def initialize(version)
|
11
|
+
@version = version
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.run(version)
|
15
|
+
Codelog::Command::Step::Version.new(version).run
|
16
|
+
end
|
17
|
+
|
18
|
+
def run
|
19
|
+
abort('ERROR: Please enter a version number') if @version.nil?
|
20
|
+
chdir Dir.pwd do
|
21
|
+
create_version_changelog_from changes_hash
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def changes_hash
|
28
|
+
change_files_paths = Dir['changelogs/unreleased/*.yml']
|
29
|
+
change_files_paths.inject({}) do |all_changes, change_file|
|
30
|
+
changes_per_category = YAML.load_file(change_file)
|
31
|
+
all_changes.merge!(changes_per_category) do |category, changes, changes_to_be_added|
|
32
|
+
changes | changes_to_be_added
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_version_changelog_from(changes_hash)
|
38
|
+
File.open("changelogs/releases/#{@version}.md", 'a') do |line|
|
39
|
+
line.puts "## #{@version}"
|
40
|
+
changes_hash.each do |category, changes|
|
41
|
+
line.puts "### #{category}"
|
42
|
+
changes.each { |change| line.puts "- #{change}" }
|
43
|
+
line.puts "\n"
|
44
|
+
end
|
45
|
+
line.puts "---\n"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"Added":
|
2
|
+
- New features implemented
|
3
|
+
|
4
|
+
"Changed":
|
5
|
+
- Changes to existing feature
|
6
|
+
|
7
|
+
"Deprecated":
|
8
|
+
- Features that are soon to be removed
|
9
|
+
|
10
|
+
"Removed":
|
11
|
+
- Features that were removed
|
12
|
+
|
13
|
+
"Fixed":
|
14
|
+
- Changes to broken code
|
15
|
+
|
16
|
+
"Security":
|
17
|
+
- Changes that fix vulnerabilities
|
18
|
+
|
19
|
+
"Deploy notes":
|
20
|
+
- Changes that should impact the deploy process and what should be made before it
|
metadata
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: codelog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Luís Bevilacqua
|
8
|
+
- Rodrigo Masaru
|
9
|
+
- Fernanda Thomazinho
|
10
|
+
- Celso Crivelaro
|
11
|
+
- Vinicius Oyama
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
14
|
+
cert_chain: []
|
15
|
+
date: 2018-01-12 00:00:00.000000000 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: thor
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - "~>"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '0.19'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - "~>"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0.19'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: bundler
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - "~>"
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.15'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '1.15'
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: rake
|
47
|
+
requirement: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - "~>"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '10.0'
|
52
|
+
type: :development
|
53
|
+
prerelease: false
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - "~>"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '10.0'
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: rspec
|
61
|
+
requirement: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - "~>"
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '3.4'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '3.4'
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: rubocop
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 0.52.1
|
80
|
+
type: :development
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - "~>"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 0.52.1
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: simplecov
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
type: :development
|
95
|
+
prerelease: false
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
description: A simple to use gem made to help managing changelogs avoiding conflicts
|
102
|
+
and missplaced changes
|
103
|
+
email:
|
104
|
+
- opensource@codus.com.br
|
105
|
+
executables:
|
106
|
+
- codelog
|
107
|
+
extensions: []
|
108
|
+
extra_rdoc_files: []
|
109
|
+
files:
|
110
|
+
- CHANGELOG.md
|
111
|
+
- CODE_OF_CONDUCT.md
|
112
|
+
- CONTRIBUTING.md
|
113
|
+
- LICENSE
|
114
|
+
- README.md
|
115
|
+
- Rakefile
|
116
|
+
- bin/codelog
|
117
|
+
- bin/setup
|
118
|
+
- lib/codelog.rb
|
119
|
+
- lib/codelog/cli.rb
|
120
|
+
- lib/codelog/command/new.rb
|
121
|
+
- lib/codelog/command/release.rb
|
122
|
+
- lib/codelog/command/setup.rb
|
123
|
+
- lib/codelog/command/step/changelog.rb
|
124
|
+
- lib/codelog/command/step/delete.rb
|
125
|
+
- lib/codelog/command/step/version.rb
|
126
|
+
- lib/codelog/version.rb
|
127
|
+
- lib/fixtures/template.yml
|
128
|
+
homepage: https://github.com/codus/codelog
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message: To start using the codelog run `codelog setup` and fill the
|
133
|
+
`template.yml` file
|
134
|
+
rdoc_options: []
|
135
|
+
require_paths:
|
136
|
+
- lib
|
137
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - ">="
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
requirements: []
|
148
|
+
rubyforge_project:
|
149
|
+
rubygems_version: 2.6.13
|
150
|
+
signing_key:
|
151
|
+
specification_version: 4
|
152
|
+
summary: A gem to help with changelog management
|
153
|
+
test_files: []
|