weekly_commits 0.1.0 → 1.2.1
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.
- checksums.yaml +5 -5
- data/README.md +66 -11
- data/Rakefile +3 -3
- data/bin/console +3 -3
- data/lib/weekly_commits.rb +0 -1
- data/lib/weekly_commits/cli.rb +38 -11
- data/lib/weekly_commits/version.rb +1 -1
- data/weekly_commits.gemspec +8 -8
- data/weekly_commits.png +0 -0
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1d8a69fe23bc97b9db8980934e7a4a36d062c6141084e8e2a932483fe876d18f
|
4
|
+
data.tar.gz: a6d6a00b73857cde9ceecc6859ae669235e4d871935049516befa165099b267c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec720cc2fd7ebac98776be53c2456944a7da47b2b2c06c9d8b410413f0c069a40def3330b33c4ac33568037c176feda389b0b0ba80c238bed211d72cb9f77d07
|
7
|
+
data.tar.gz: bdb7c71ef4acae11733b2f66e96d33643f385fc522d6f142285db8fad4e7b0b2699c437ea804eb3ea9aa4a8563a250f38e947047dca086eb13f3554f45908e89
|
data/README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
|
1
|
+

|
2
2
|
|
3
|
-
|
3
|
+
[](https://travis-ci.org/dkarter/weekly_commits)
|
4
4
|
|
5
|
-
|
5
|
+
WeeklyCommits is a command line tool for getting a bird's eye view of your
|
6
|
+
commits on a branch for a specific week.
|
6
7
|
|
7
|
-
|
8
|
+
It is particularly helpful for stand ups, filling up detailed time sheets and
|
9
|
+
for recap when starting up again after a long weekend.
|
8
10
|
|
9
|
-
|
11
|
+
## Installation
|
10
12
|
|
11
13
|
```ruby
|
12
14
|
gem 'weekly_commits'
|
@@ -22,20 +24,73 @@ Or install it yourself as:
|
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
25
|
-
|
27
|
+
For help type:
|
28
|
+
|
29
|
+
```sh
|
30
|
+
wcomm help
|
31
|
+
# or
|
32
|
+
wcomm help weekly_commits
|
33
|
+
```
|
34
|
+
|
35
|
+
Usage documentation from command-line:
|
36
|
+
|
37
|
+
```
|
38
|
+
Usage:
|
39
|
+
wcomm
|
40
|
+
|
41
|
+
Options:
|
42
|
+
-w, [--week=N] # Relative week number. e.g. -w=1 for last week. 0 = current week.
|
43
|
+
# Default: 0
|
44
|
+
[--show-author], [--no-show-author] # Display author(s) with each commit message. e.g. Did stuff (Ghost Ninja)
|
45
|
+
[--no-merge] # Omit merge commit messages
|
46
|
+
[--sort=SORT] # Show commits in ascending/descending order. Default: older commits on top, newer on bottom.
|
47
|
+
# Default: desc
|
48
|
+
# Possible values: asc, desc
|
49
|
+
```
|
50
|
+
|
51
|
+
To use the gem, navigate to a repo and make sure you have the WeeklyCommits gem
|
52
|
+
installed for that version of ruby in that directory.
|
53
|
+
|
54
|
+
Make sure you are on the correct branch.
|
55
|
+
|
56
|
+
By default WeeklyCommits will only show commits on the current branch.
|
57
|
+
|
58
|
+
### Example
|
59
|
+
|
60
|
+
Show me this week's commits:
|
61
|
+
|
62
|
+
```sh
|
63
|
+
wcomm
|
64
|
+
```
|
65
|
+
|
66
|
+
Show me last week's commits:
|
67
|
+
|
68
|
+
```sh
|
69
|
+
wcomm -w=1
|
70
|
+
```
|
71
|
+
|
72
|
+
Show me commits from two weeks ago including author
|
73
|
+
|
74
|
+
```sh
|
75
|
+
wcomm -w=2 --show-author
|
76
|
+
```
|
77
|
+
|
78
|
+
### Screenshots
|
26
79
|
|
27
|
-
|
80
|
+

|
28
81
|
|
29
|
-
|
82
|
+
## TODO
|
30
83
|
|
31
|
-
|
84
|
+
- [ ] Add support for specifying a branch explicitly
|
32
85
|
|
33
86
|
## Contributing
|
34
87
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at
|
88
|
+
Bug reports and pull requests are welcome on GitHub at
|
89
|
+
https://github.com/dkarter/weekly_commits.
|
36
90
|
|
37
91
|
|
38
92
|
## License
|
39
93
|
|
40
|
-
The gem is available as open source under the terms of the [MIT
|
94
|
+
The gem is available as open source under the terms of the [MIT
|
95
|
+
License](http://opensource.org/licenses/MIT).
|
41
96
|
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'weekly_commits'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "weekly_commits"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
data/lib/weekly_commits.rb
CHANGED
data/lib/weekly_commits/cli.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'thor'
|
2
4
|
require 'colorize'
|
3
5
|
require 'active_support/all'
|
@@ -5,15 +7,31 @@ require 'active_support/all'
|
|
5
7
|
module WeeklyCommits
|
6
8
|
class CLI < Thor
|
7
9
|
package_name 'Weekly Commits'
|
8
|
-
default_task :
|
9
|
-
|
10
|
-
desc 'weekly_commits', 'Lists commits for a specified week'
|
11
|
-
method_option :week,
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
default_task :weekly_commits
|
11
|
+
|
12
|
+
desc 'weekly_commits', '[DEFAULT] Lists commits for a specified week'
|
13
|
+
method_option :week,
|
14
|
+
type: :numeric,
|
15
|
+
desc: 'Relative week number. e.g. -w=1 for last week. 0 = current week.',
|
16
|
+
aliases: '-w',
|
17
|
+
default: 0
|
18
|
+
|
19
|
+
method_option :show_author,
|
20
|
+
type: :boolean,
|
21
|
+
desc: 'Display author(s) with each commit message. e.g. Did stuff (Ghost Ninja)',
|
22
|
+
default: false
|
23
|
+
|
24
|
+
method_option :sort,
|
25
|
+
type: :string,
|
26
|
+
desc: 'Show commits in ascending/descending order. Default: older commits on top, newer on bottom.',
|
27
|
+
default: 'asc',
|
28
|
+
enum: %w[asc desc]
|
29
|
+
|
30
|
+
method_option :no_merge,
|
31
|
+
type: :boolean,
|
32
|
+
desc: 'Exclude merge commits',
|
33
|
+
default: false
|
34
|
+
|
17
35
|
def weekly_commits
|
18
36
|
relative_week = options[:week]
|
19
37
|
beg_week = relative_week.week.ago.beginning_of_week
|
@@ -21,9 +39,18 @@ module WeeklyCommits
|
|
21
39
|
5.times do |day_count|
|
22
40
|
date = beg_week + day_count.days
|
23
41
|
week_title = date.strftime('%a, %e %b %Y')
|
24
|
-
git_date_format = date.strftime('%
|
42
|
+
git_date_format = date.strftime('%Y-%m-%e')
|
43
|
+
committer = options[:show_author] ? ' (%cn)'.magenta : ''
|
44
|
+
|
45
|
+
git_log_command = "git --no-pager log --after='#{git_date_format} 00:00' --before='#{git_date_format} 23:59' --pretty=format:'%s#{committer}'"
|
46
|
+
git_log_command += ' --no-merges' if options[:no_merge]
|
47
|
+
|
48
|
+
commits = `#{git_log_command}`
|
49
|
+
commits = commits.lines.reverse if options[:sort].casecmp('asc').zero?
|
50
|
+
|
25
51
|
puts week_title.yellow
|
26
|
-
|
52
|
+
puts commits
|
53
|
+
puts
|
27
54
|
end
|
28
55
|
end
|
29
56
|
end
|
data/weekly_commits.gemspec
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'weekly_commits/version'
|
5
4
|
|
@@ -9,21 +8,22 @@ Gem::Specification.new do |spec|
|
|
9
8
|
spec.authors = ['Dorian Karter']
|
10
9
|
spec.email = ['jobs@doriankarter.com']
|
11
10
|
|
12
|
-
spec.summary =
|
11
|
+
spec.summary = 'List your commits on a project for every day of a specified week'
|
13
12
|
spec.homepage = 'http://doriankarter.com'
|
14
13
|
spec.license = 'MIT'
|
15
14
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|screenshots)/}) }
|
17
16
|
spec.bindir = 'bin'
|
18
17
|
spec.executables = ['wcomm']
|
19
18
|
spec.require_paths = ['lib']
|
20
19
|
|
21
|
-
spec.add_development_dependency 'bundler',
|
22
|
-
spec.add_development_dependency '
|
23
|
-
spec.add_development_dependency '
|
20
|
+
spec.add_development_dependency 'bundler', '~> 2.1.4'
|
21
|
+
spec.add_development_dependency 'pry'
|
22
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
23
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
24
24
|
|
25
25
|
# runtime dependencies
|
26
26
|
spec.add_runtime_dependency 'activesupport'
|
27
|
-
spec.add_runtime_dependency 'thor'
|
28
27
|
spec.add_runtime_dependency 'colorize'
|
28
|
+
spec.add_runtime_dependency 'thor'
|
29
29
|
end
|
data/weekly_commits.png
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weekly_commits
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Karter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.1.4
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.1.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +81,7 @@ dependencies:
|
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: colorize
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - ">="
|
@@ -81,7 +95,7 @@ dependencies:
|
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: thor
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
@@ -116,6 +130,7 @@ files:
|
|
116
130
|
- lib/weekly_commits/cli.rb
|
117
131
|
- lib/weekly_commits/version.rb
|
118
132
|
- weekly_commits.gemspec
|
133
|
+
- weekly_commits.png
|
119
134
|
homepage: http://doriankarter.com
|
120
135
|
licenses:
|
121
136
|
- MIT
|
@@ -135,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
150
|
- !ruby/object:Gem::Version
|
136
151
|
version: '0'
|
137
152
|
requirements: []
|
138
|
-
|
139
|
-
rubygems_version: 2.5.1
|
153
|
+
rubygems_version: 3.1.2
|
140
154
|
signing_key:
|
141
155
|
specification_version: 4
|
142
156
|
summary: List your commits on a project for every day of a specified week
|