git-history 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/git-history CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.expand_path('../../lib', __FILE__)
4
-
5
3
  require 'rubygems'
6
4
  require 'git_history'
7
5
 
data/git_history.gemspec CHANGED
@@ -3,17 +3,11 @@ require File.expand_path("../lib/git_history/version", __FILE__)
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "git-history"
5
5
  s.version = GitHistory::VERSION
6
- s.platform = Gem::Platform::RUBY
7
6
  s.authors = ["Peter Ehrenberg"]
8
7
  s.email = ["pe@dipe.de"]
9
8
  s.homepage = "http://github.com/dipe/git-history"
10
9
  s.summary = "Create changelog file from git history"
11
10
  s.description = "Simply reformats the history of your project based on the commit messages to changelog file format"
12
-
13
- s.required_rubygems_version = ">= 1.3.6"
14
- s.rubyforge_project = "git-history"
15
-
16
- s.files = `git ls-files`.split("\n")
17
- s.executables = 'git-history'
18
- s.require_path = 'lib'
11
+ s.files = `git ls-files`.split($/)
12
+ s.executables = ['git-history']
19
13
  end
@@ -2,22 +2,20 @@ module GitHistory::CLI
2
2
  require 'text'
3
3
 
4
4
  def self.run(args)
5
- range = args[0]
5
+ range = args[0] || ''
6
6
  history_from_gitlog(range)
7
7
  end
8
8
 
9
- def self.history_from_gitlog(range)
10
- history = []
11
- `git log --date=short #{range}`.split(/^commit .*/).each do |commit|
12
- next unless commit.match(/\S/)
9
+ def self.history_from_gitlog(range = "")
10
+ r = range[/[^\&\'\"]*/]
11
+ `git log --date=short #{r}`.split(/^commit .*/).each do |commit|
13
12
  next if commit.match(/^Merge:/)
14
13
 
15
14
  author = commit[/^Author:\s+(.*)/,1]
16
15
  date = commit[/^Date:\s+(.*)/,1]
17
- text = commit.grep(/^ .*/).map{ |l| Text::wrap(l.strip, 72, "\t") }.join("\n")
18
- history.push("#{date} #{author}\n\n#{text}")
16
+ text = commit.lines.grep(/^ .*/).map{ |l| Text::wrap(l.strip, 72, "\t") }.join("\n")
17
+
18
+ puts "#{date} #{author}\n\n#{text}\n\n"
19
19
  end
20
-
21
- puts history.join("\n\n")
22
20
  end
23
21
  end
@@ -1,3 +1,3 @@
1
1
  module GitHistory
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-history
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
4
+ prerelease:
5
+ version: 0.0.3
11
6
  platform: ruby
12
7
  authors:
13
8
  - Peter Ehrenberg
@@ -15,7 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2010-10-27 00:00:00 +02:00
13
+ date: 2011-08-05 00:00:00 +02:00
19
14
  default_executable:
20
15
  dependencies: []
21
16
 
@@ -52,25 +47,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
47
  requirements:
53
48
  - - ">="
54
49
  - !ruby/object:Gem::Version
55
- hash: 3
56
- segments:
57
- - 0
58
50
  version: "0"
59
51
  required_rubygems_version: !ruby/object:Gem::Requirement
60
52
  none: false
61
53
  requirements:
62
54
  - - ">="
63
55
  - !ruby/object:Gem::Version
64
- hash: 23
65
- segments:
66
- - 1
67
- - 3
68
- - 6
69
- version: 1.3.6
56
+ version: "0"
70
57
  requirements: []
71
58
 
72
- rubyforge_project: git-history
73
- rubygems_version: 1.3.7
59
+ rubyforge_project:
60
+ rubygems_version: 1.6.2
74
61
  signing_key:
75
62
  specification_version: 3
76
63
  summary: Create changelog file from git history