katip 0.2.0 → 1.0.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: adf5bbf98c475d486485fa10d00f93b58d660e95
4
- data.tar.gz: a4594d538636fd600314dec01ba7c37d27366282
3
+ metadata.gz: 719d74b2fe50e71ab786572062f853fee6a82910
4
+ data.tar.gz: 00f669ba1fc6dac46f33711f78f2eddc5f1b8f5f
5
5
  SHA512:
6
- metadata.gz: 17c107230678e3bf30987cebeed1b5108e5ccd34f70a6e970be8e17b8d5710cda2645f848a9431218b3f4ad9ee6964a936daa13aa12841cfc06a075b8cdb9a9b
7
- data.tar.gz: 78a56b738abb653b78b64e5cc93ffb7e0b193acd17394f73eac334b0d95df20fc14dc98116152925f0cc20e2ef72b63c259584862ea3702544994011c25e70d4
6
+ metadata.gz: 4f3d423b057a5f458d16a653a8ffc817140042de1ae4b5fe37308e9c29f79a680f4b968210203b90afe815c51751514de96863e6aaf7f46d9a1dce95038fa9ba
7
+ data.tar.gz: ee87a0e765bd945a5b9318c727e6e5d85a2dd92691893cdb8f2f396918650e8af03a4caac5a26e3d67f8a401c416185efc24785f54ba41c0bde56b14a6b491d6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
 
2
2
  #### [Current]
3
+ * [6b8cfe7](6b8cfe7) #13 Add custom file name support to rake __(Murat Kemal BAYGÜN)__
4
+ * [7b5be3d](7b5be3d) #10 add output file name as optional parameter __(Murat Kemal BAYGÜN)__
5
+ * [695646c](695646c) #12 Add and correct information on gemspec __(Murat Kemal BAYGÜN)__
6
+ * [f30a3b2](f30a3b2) #9 Update rake job to use installed executable __(Murat Kemal BAYGÜN)__
7
+ * [a7200f0](a7200f0) #11 Fix bug Current commits is not seen on log file __(Murat Kemal BAYGÜN)__
8
+ * [6385fff](6385fff) #8 Change executable file name to katip __(Murat Kemal BAYGÜN)__
9
+
10
+ #### 0.2.0
11
+ * [61b2f06](61b2f06) Version 0.2.0 __(Murat Kemal BAYGÜN)__
12
+ * [9bd7659](9bd7659) #7 Fix documentation __(Murat Kemal BAYGÜN)__
13
+ * [2abca18](2abca18) #7 Organize readme, add usage for daktilo __(Murat Kemal BAYGÜN)__
14
+ * [b939475](b939475) #7 Add output message to inform user __(Murat Kemal BAYGÜN)__
15
+ * [99d3b3f](99d3b3f) #7 Add executable ruby file to gem to generate default output CHANGELOG.md __(Murat Kemal BAYGÜN)__
16
+ * [7265622](7265622) #4 Add simple usage documentation on readme __(Murat Kemal BAYGÜN)__
3
17
 
4
18
  #### 0.1.0
5
19
  * [de3acfb](de3acfb) #6 Update gemspec __(Onur Ozgur OZKAN)__
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- katip (0.1.0)
4
+ katip (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -4,8 +4,8 @@ Katip
4
4
  This is a Change Logging gem for a git initialized project.
5
5
 
6
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.
7
+ It also has an executable ruby file **katip**, which can be used in any git project.
8
+ Log rows will contain links to commits, commit note and contributor name.
9
9
 
10
10
  ## Installation
11
11
 
@@ -30,10 +30,17 @@ gem 'katip'
30
30
  In your git initialized project directory simply run
31
31
 
32
32
  ```sh
33
- % daktilo
33
+ % katip
34
34
  Create CHANGELOG.md
35
35
  ```
36
36
 
37
+ If you want to name your log file other than CHANGELOG.md
38
+
39
+ ```sh
40
+ % katip MyCustomFile.md
41
+ Create MyCustomFile.md
42
+ ```
43
+
37
44
 
38
45
  ### Using as a rake
39
46
  Add gem in your Gemfile:
@@ -49,7 +56,14 @@ gem 'katip'
49
56
  Create CHANGELOG.md
50
57
  ```
51
58
 
52
- and that's it. You have a CHANGELOG.md file on project root, generated based on your git commits and created release tags.
59
+ If you want to name your log file other than CHANGELOG.md
60
+
61
+ ```sh
62
+ % rake katip:create file=MyCustomFile.md
63
+ Create MyCustomFile.md
64
+ ```
65
+
66
+ and that's it. You have your change log file on project root, generated based on your git commits and created release tags.
53
67
 
54
68
  #### Links to resources
55
69
 
@@ -1,10 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- DEFAULT_FILE='CHANGELOG.md'
3
+ def write_file(output)
4
+
5
+ file_name='CHANGELOG.md'
6
+
7
+ if ARGV.length > 0
8
+ file_name=ARGV[0]
9
+ end
4
10
 
5
- def write_file(output, file_name=DEFAULT_FILE)
6
11
  begin
7
- file = File.open(file_name, "w")
12
+ file = File.open(file_name, 'w')
8
13
  file.puts output
9
14
 
10
15
  puts "Create #{file_name}"
@@ -27,16 +32,16 @@ def parse_change_log
27
32
 
28
33
  output << "\n#### [Current]"
29
34
 
30
- previous_tag=nil
35
+ previous_tag=''
31
36
  tags.each do |tag|
32
37
  current_tag = tag
33
38
 
34
- if previous_tag
39
+ unless previous_tag.empty?
35
40
  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
41
  end
39
42
 
43
+ output << `git log --pretty=format:" * [%h]($repo_url%h) %s __(%an)__" "#{current_tag}".."#{previous_tag}" | grep -v "Merge branch "`
44
+
40
45
  previous_tag = current_tag
41
46
  end
42
47
 
data/katip.gemspec CHANGED
@@ -9,12 +9,12 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = %w[lab2023]
10
10
  spec.email = %w[info@lab2023.com]
11
11
  spec.description = %q{This is a Change Logging gem for a git initialized project.}
12
- spec.summary = %q{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.}
12
+ spec.summary = %q{Katip is a gem which dumps the change log as a list grouped by version tags. It also has an executable ruby file katip, which can be used in any git project. Log rows will contain links to commits, commit note and contributor name.}
13
13
  spec.homepage = 'https://github.com/kebab-project/katip'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
17
- spec.executables = %w[daktilo]
17
+ spec.executables = %w[katip]
18
18
  spec.require_paths = %w[lib]
19
19
 
20
20
  spec.add_development_dependency 'bundler', '~> 1.3'
data/lib/katip.rb CHANGED
@@ -3,49 +3,18 @@ require 'katip/version'
3
3
  module Katip
4
4
  require 'katip/railtie' if defined?(Rails)
5
5
 
6
- @@daktilo = <<-SHELL
7
- # Get tags as an array
8
- TAGS_ARRAY=(`git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | grep -v '^$'`)
9
-
10
- repo_url="../../commit/"
11
-
12
- # Set User defined file if exist else use default
13
- if [ -n "$1" ]; then
14
- OUTPUT=$1
15
- else
16
- OUTPUT="CHANGELOG.md"
17
- fi
18
-
19
- # Calculate the tag count
20
- SIZE=${#TAGS_ARRAY[@]}
21
-
22
- echo "\n#### [Current]" > $OUTPUT
23
-
24
- # Iterate reversly on tags
25
- for (( i = SIZE - 1; i >= 0 ; i-- ));
26
- do
27
- CURR_TAG=${TAGS_ARRAY[$i]}
28
- echo "" >> $OUTPUT
29
- if [ $PREV_TAG ];then
30
- echo "#### [$PREV_TAG]" >> $OUTPUT
31
- fi
32
- git log --pretty=format:" * [%h]($repo_url%h) %s __(%an)__" $CURR_TAG..$PREV_TAG | grep -v "Merge branch " >> $OUTPUT
33
- PREV_TAG=$CURR_TAG
34
- done
35
-
36
- # Dump change log for first tag
37
- FIRST=$(git tag -l | head -1)
38
- echo "\n#### [$FIRST]" >> $OUTPUT
39
-
40
- git log --pretty=format:" * [%h]($repo_url%h) %s __(%an)__" $FIRST | grep -v "Merge branch " >> $OUTPUT
41
- SHELL
6
+ @@katip = `katip`
42
7
 
43
8
  def self.set(param)
44
- @@daktilo = param
9
+ @@katip = param
45
10
  end
46
11
 
47
12
  def self.get
48
- @@daktilo
13
+ @@katip
14
+ end
15
+
16
+ def self.get_file(file_name)
17
+ @@katip = "katip #{file_name}"
49
18
  end
50
19
 
51
20
  end
data/lib/katip/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Katip
2
- VERSION = '0.2.0'
2
+ VERSION = '1.0.0'
3
3
  end
data/lib/tasks/katip.rake CHANGED
@@ -1,7 +1,10 @@
1
1
  namespace :katip do
2
2
  desc 'Create CHANGELOG.md'
3
3
  task :create => [:environment] do
4
- puts 'Create CHANGELOG.md'
5
- exec Katip.get
4
+
5
+ file_name = ENV['file'] || 'CHANGELOG.md'
6
+
7
+ exec Katip.get_file(file_name)
8
+
6
9
  end
7
10
  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.2.0
4
+ version: 1.0.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-19 00:00:00.000000000 Z
11
+ date: 2013-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,7 +42,7 @@ description: This is a Change Logging gem for a git initialized project.
42
42
  email:
43
43
  - info@lab2023.com
44
44
  executables:
45
- - daktilo
45
+ - katip
46
46
  extensions: []
47
47
  extra_rdoc_files:
48
48
  - README.md
@@ -53,7 +53,7 @@ files:
53
53
  - Gemfile.lock
54
54
  - README.md
55
55
  - Rakefile
56
- - bin/daktilo
56
+ - bin/katip
57
57
  - katip.gemspec
58
58
  - lib/katip.rb
59
59
  - lib/katip/railtie.rb
@@ -82,8 +82,7 @@ rubyforge_project:
82
82
  rubygems_version: 2.0.5
83
83
  signing_key:
84
84
  specification_version: 4
85
- summary: Planned to design a rake which dumps the change log as a list grouped by
86
- version tags. Log rows will contain links to commits, commit note and contributer
87
- name.
85
+ summary: Katip is a gem which dumps the change log as a list grouped by version tags.
86
+ It also has an executable ruby file katip, which can be used in any git project.
87
+ Log rows will contain links to commits, commit note and contributor name.
88
88
  test_files: []
89
- has_rdoc: