weekly_commits 1.1.0 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e78ccbd42e1701cc41a936e07973e61c11318b86
4
- data.tar.gz: ef667d7c3fb3404be594a17f44a6d361cff23027
2
+ SHA256:
3
+ metadata.gz: e675ecdad9d744598bf5130689f18e3e4bbd456fa9c03a0dc27850fda1568ae5
4
+ data.tar.gz: 4533e14f2e66fe685599a99e31ee07abf45b46a4d21e0ebcb1326dcab65659dd
5
5
  SHA512:
6
- metadata.gz: 3216a4f3db74910bea407af5eb559d583475eac519dae682471e8056250b17ecb6f52601e26ba7aeb8550b5f8ceb91397fa77b30ca70b0c012d59fa5761398dc
7
- data.tar.gz: 64bcf59f6136427ce0439bf24276074f4343e3f3accde23145a6cf143325261611c1d7485a273325efaa97371656a533164b5fab29a43a203fbd07bc349326a0
6
+ metadata.gz: 8d55256b26a929b9bb52069c7d23f4f1f9adafc9048f6b78342d83ec1d7b7ee7c9c686f5de235331ef578c791419ed47a489755700ec5df8541652af471b3b12
7
+ data.tar.gz: 658b7a2c95db0610a148c2461fa110ae04ece70ad7215a57c6ab306d59836d5e61df8927e5974070aaf21b7ca5e245f5779494d716e1692e7b90deac4a61902f
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # WeeklyCommits
1
+ ![WeeklyCommits](weekly_commits.png)
2
+
3
+ [![Build Status](https://travis-ci.org/dkarter/weekly_commits.svg?branch=master)](https://travis-ci.org/dkarter/weekly_commits)
2
4
 
3
5
  WeeklyCommits is a command line tool for getting a bird's eye view of your
4
6
  commits on a branch for a specific week.
@@ -39,16 +41,21 @@ Usage:
39
41
  Options:
40
42
  -w, [--week=N] # Relative week number. e.g. -w=1 for last week. 0 = current week.
41
43
  # Default: 0
42
- [--show-author], [--no-show-author] # Display author(s) with each commit message. e.g. Did stuff (Dorian Karter)
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
43
46
  [--sort=SORT] # Show commits in ascending/descending order. Default: older commits on top, newer on bottom.
44
47
  # Default: desc
45
48
  # Possible values: asc, desc
46
49
  ```
47
50
 
48
- ### Example
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.
49
55
 
50
- First navigate to a repo and make sure you have the WeeklyCommits gem installed
51
- for that version of ruby in that directory.
56
+ By default WeeklyCommits will only show commits on the current branch.
57
+
58
+ ### Example
52
59
 
53
60
  Show me this week's commits:
54
61
 
@@ -56,33 +63,25 @@ Show me this week's commits:
56
63
  wcomm
57
64
  ```
58
65
 
59
- Show me last weeks commits:
66
+ Show me last week's commits:
60
67
 
61
68
  ```sh
62
69
  wcomm -w=1
63
70
  ```
64
71
 
65
- Show me commits from two weeks ago including committer
72
+ Show me commits from two weeks ago including author
66
73
 
67
74
  ```sh
68
75
  wcomm -w=2 --show-author
69
76
  ```
70
77
 
71
- ## Development
72
-
73
- After checking out the repo, run `bin/setup` to install dependencies. Then, run
74
- `rake spec` to run the tests. You can also run `bin/console` for an interactive
75
- prompt that will allow you to experiment.
78
+ ### Screenshots
76
79
 
77
- To install this gem onto your local machine, run `bundle exec rake install`. To
78
- release a new version, update the version number in `version.rb`, and then run
79
- `bundle exec rake release`, which will create a git tag for the version, push
80
- git commits and tags, and push the `.gem` file to
81
- [rubygems.org](https://rubygems.org).
80
+ ![tilex](screenshots/tilex.png)
82
81
 
83
82
  ## TODO
84
83
 
85
- - [ ] Add support for multiple branches
84
+ - [ ] Add support for specifying a branch explicitly
86
85
 
87
86
  ## Contributing
88
87
 
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "weekly_commits"
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 "irb"
13
+ require 'irb'
14
14
  IRB.start
@@ -2,5 +2,4 @@ require 'weekly_commits/version'
2
2
  require 'weekly_commits/cli'
3
3
 
4
4
  module WeeklyCommits
5
-
6
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'thor'
2
4
  require 'colorize'
3
5
  require 'active_support/all'
@@ -8,25 +10,27 @@ module WeeklyCommits
8
10
  default_task :weekly_commits
9
11
 
10
12
  desc 'weekly_commits', '[DEFAULT] Lists commits for a specified week'
11
- method_option :week, {
12
- type: :numeric,
13
- desc: 'Relative week number. e.g. -w=1 for last week. 0 = current week.',
14
- aliases: '-w',
15
- default: 0,
16
- }
17
-
18
- method_option :show_author, {
19
- type: :boolean,
20
- desc: 'Display author(s) with each commit message. e.g. Did stuff (Dorian Karter)',
21
- default: false,
22
- }
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: ['asc','desc'],
29
- }
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
30
34
 
31
35
  def weekly_commits
32
36
  relative_week = options[:week]
@@ -39,8 +43,9 @@ module WeeklyCommits
39
43
  committer = options[:show_author] ? ' (%cn)'.magenta : ''
40
44
 
41
45
  commits = `git --no-pager log --after='#{git_date_format} 00:00' --before='#{git_date_format} 23:59' --pretty=format:'%s#{committer}'`
46
+ commits += ' --no-merges' if options[:no_merge]
42
47
 
43
- commits = commits.lines.reverse if options[:sort].downcase == 'asc'
48
+ commits = commits.lines.reverse if options[:sort].casecmp('asc').zero?
44
49
 
45
50
  puts week_title.yellow
46
51
  puts commits
@@ -1,3 +1,3 @@
1
1
  module WeeklyCommits
2
- VERSION = "1.1.0"
2
+ VERSION = '1.2.0'.freeze
3
3
  end
@@ -1,5 +1,4 @@
1
- # coding: utf-8
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,22 +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 = %q{List your commits on a project for every day of a specified week}
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', "~> 1.11"
22
- spec.add_development_dependency 'rake', "~> 10.0"
23
- spec.add_development_dependency 'rspec', "~> 3.0"
20
+ spec.add_development_dependency 'bundler', '~> 2.1.4'
24
21
  spec.add_development_dependency 'pry'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'rspec', '~> 3.0'
25
24
 
26
25
  # runtime dependencies
27
26
  spec.add_runtime_dependency 'activesupport'
28
- spec.add_runtime_dependency 'thor'
29
27
  spec.add_runtime_dependency 'colorize'
28
+ spec.add_runtime_dependency 'thor'
30
29
  end
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: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Karter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-28 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
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: '1.11'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: thor
84
+ name: colorize
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: colorize
98
+ name: thor
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -130,6 +130,7 @@ files:
130
130
  - lib/weekly_commits/cli.rb
131
131
  - lib/weekly_commits/version.rb
132
132
  - weekly_commits.gemspec
133
+ - weekly_commits.png
133
134
  homepage: http://doriankarter.com
134
135
  licenses:
135
136
  - MIT
@@ -149,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
150
  - !ruby/object:Gem::Version
150
151
  version: '0'
151
152
  requirements: []
152
- rubyforge_project:
153
- rubygems_version: 2.5.1
153
+ rubygems_version: 3.1.2
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: List your commits on a project for every day of a specified week