katip 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b509ee7719357955f294253549faefd8fbecab36
4
- data.tar.gz: 545696486d5e36617a756b23842fe527f12ac08c
3
+ metadata.gz: adf5bbf98c475d486485fa10d00f93b58d660e95
4
+ data.tar.gz: a4594d538636fd600314dec01ba7c37d27366282
5
5
  SHA512:
6
- metadata.gz: 1e2e0384b0f8db3b13d9a44c56f4ddf066e45057cc779832efcd76c65ed7da5e5b57ad6eb8c4936acd4686f6a3ee0156e4e537cfb36560e527b862c165f8d412
7
- data.tar.gz: 6341ea1ecff7baab2a252b0040ef7ff6ec787fa5d7bb7952f48060947c95fe2ccd8f309959eecc502780a782d1fdb2dbfb547239e0e18a6f3fb74bd601dade58
6
+ metadata.gz: 17c107230678e3bf30987cebeed1b5108e5ccd34f70a6e970be8e17b8d5710cda2645f848a9431218b3f4ad9ee6964a936daa13aa12841cfc06a075b8cdb9a9b
7
+ data.tar.gz: 78a56b738abb653b78b64e5cc93ffb7e0b193acd17394f73eac334b0d95df20fc14dc98116152925f0cc20e2ef72b63c259584862ea3702544994011c25e70d4
@@ -1,8 +1,12 @@
1
1
 
2
2
  #### [Current]
3
3
 
4
- #### []
5
- * [18fba8f](../../commit/18fba8f) #3 Add logger file __(Murat Kemal BAYGÜN)__
6
- * [105af37](../../commit/105af37) Update readme __(Murat Kemal BAYGÜN)__
7
- * [bc56515](../../commit/bc56515) Initial commit __(Murat Kemal BAYGÜN)__
8
- * [1b1d477](../../commit/1b1d477) Initial commit __(Murat Kemal BAYGÜN)__
4
+ #### 0.1.0
5
+ * [de3acfb](de3acfb) #6 Update gemspec __(Onur Ozgur OZKAN)__
6
+ * [498c3d6](498c3d6) #6 Set gem __(Onur Ozgur OZKAN)__
7
+ * [416e6c8](416e6c8) #6 Set gem __(Onur Ozgur OZKAN)__
8
+ * [c820767](c820767) #4 Add CHANGELOG.md file __(Murat Kemal BAYGÜN)__
9
+ * [18fba8f](18fba8f) #3 Add logger file __(Murat Kemal BAYGÜN)__
10
+ * [105af37](105af37) Update readme __(Murat Kemal BAYGÜN)__
11
+ * [bc56515](bc56515) Initial commit __(Murat Kemal BAYGÜN)__
12
+ * [1b1d477](1b1d477) Initial commit __(Murat Kemal BAYGÜN)__
data/README.md CHANGED
@@ -3,7 +3,53 @@ Katip
3
3
 
4
4
  This is a Change Logging gem for a git initialized project.
5
5
 
6
- Planned to design a rake which dumps the change log as a list grouped by version tags. Log rows will contain links to commits, commit note and contributer name.
6
+ Katip is a gem which dumps the change log as a list grouped by version tags.
7
+ It also has an executable ruby file **daktilo**, which can be used in any git project.
8
+ Log rows will contain links to commits, commit note and contributer name.
9
+
10
+ ## Installation
11
+
12
+ To install Katip just use:
13
+
14
+ ```sh
15
+ gem install katip
16
+ ```
17
+
18
+ When using bundler put it in your Gemfile:
19
+
20
+ ```ruby
21
+ source 'https://rubygems.org'
22
+
23
+ gem 'katip'
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ### Using the executable
29
+
30
+ In your git initialized project directory simply run
31
+
32
+ ```sh
33
+ % daktilo
34
+ Create CHANGELOG.md
35
+ ```
36
+
37
+
38
+ ### Using as a rake
39
+ Add gem in your Gemfile:
40
+
41
+ ```ruby
42
+ source 'https://rubygems.org'
43
+
44
+ gem 'katip'
45
+ ```
46
+
47
+ ```sh
48
+ % rake katip:create
49
+ Create CHANGELOG.md
50
+ ```
51
+
52
+ and that's it. You have a CHANGELOG.md file on project root, generated based on your git commits and created release tags.
7
53
 
8
54
  #### Links to resources
9
55
 
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ DEFAULT_FILE='CHANGELOG.md'
4
+
5
+ def write_file(output, file_name=DEFAULT_FILE)
6
+ begin
7
+ file = File.open(file_name, "w")
8
+ file.puts output
9
+
10
+ puts "Create #{file_name}"
11
+ rescue IOError => e
12
+ #some error occur, dir not writable etc.
13
+ ensure
14
+ file.close unless file == nil
15
+ end
16
+ end
17
+
18
+ def parse_change_log
19
+
20
+ output = []
21
+
22
+ tags=`git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | grep -v '^$'`
23
+
24
+ tags = tags.split
25
+
26
+ tags.reverse!
27
+
28
+ output << "\n#### [Current]"
29
+
30
+ previous_tag=nil
31
+ tags.each do |tag|
32
+ current_tag = tag
33
+
34
+ if previous_tag
35
+ output << "\n#### #{previous_tag}"
36
+
37
+ output << `git log --pretty=format:" * [%h]($repo_url%h) %s __(%an)__" "#{current_tag}".."#{previous_tag}" | grep -v "Merge branch "`
38
+ end
39
+
40
+ previous_tag = current_tag
41
+ end
42
+
43
+ output << "\n#### #{previous_tag}"
44
+ output << `git log --pretty=format:" * [%h]($repo_url%h) %s __(%an)__" #{previous_tag} | grep -v "Merge branch "`
45
+
46
+ output
47
+ end
48
+
49
+ write_file parse_change_log
50
+
51
+
@@ -14,6 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
17
+ spec.executables = %w[daktilo]
17
18
  spec.require_paths = %w[lib]
18
19
 
19
20
  spec.add_development_dependency 'bundler', '~> 1.3'
@@ -1,3 +1,3 @@
1
1
  module Katip
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - lab2023
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-18 00:00:00.000000000 Z
11
+ date: 2013-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -41,7 +41,8 @@ dependencies:
41
41
  description: This is a Change Logging gem for a git initialized project.
42
42
  email:
43
43
  - info@lab2023.com
44
- executables: []
44
+ executables:
45
+ - daktilo
45
46
  extensions: []
46
47
  extra_rdoc_files:
47
48
  - README.md
@@ -52,6 +53,7 @@ files:
52
53
  - Gemfile.lock
53
54
  - README.md
54
55
  - Rakefile
56
+ - bin/daktilo
55
57
  - katip.gemspec
56
58
  - lib/katip.rb
57
59
  - lib/katip/railtie.rb
@@ -84,3 +86,4 @@ summary: Planned to design a rake which dumps the change log as a list grouped b
84
86
  version tags. Log rows will contain links to commits, commit note and contributer
85
87
  name.
86
88
  test_files: []
89
+ has_rdoc: