git-sprint 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 26044aa3841b6b6e683ea7e210aa2e4e7caa5db2aae92a8e30aeb695323dcbca
4
+ data.tar.gz: eaf00d76dd0b0f3c45b5a2510a70f9042d1779623e2b6438099031634ca2346f
5
+ SHA512:
6
+ metadata.gz: d506297053a68379181dc47b6e3d1457868c85769f6556db705af7573ffa2afebfffa95cf51685378bb73719af857c92b3ea05ddc3fd8a083a40ee785d4ffc60
7
+ data.tar.gz: f2d1b6d90fbed6fedb95ff547d489e67e3cb1f2fdcf1fa8dd54b483a53c55821f4834567623564c138b3e6819e2319765c79a710f351dbab9785cc1bea785623
@@ -0,0 +1,57 @@
1
+ name: build
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ Ubuntu:
7
+ name: Ubuntu
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v1
11
+
12
+ - name: Set up Ruby 2.6
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.x
16
+
17
+ - name: Build and test with Rake
18
+ run: |
19
+ gem install bundler
20
+ bundle install --jobs 4 --retry 3
21
+ bundle exec rake
22
+
23
+ # macOS:
24
+ # name: macOS
25
+ # runs-on: macos-latest
26
+ # steps:
27
+ # - uses: actions/checkout@v1
28
+
29
+ # - name: Set up Ruby 2.6
30
+ # uses: actions/setup-ruby@v1
31
+ # with:
32
+ # ruby-version: 2.6.x
33
+
34
+ # - name: Build and test with Rake
35
+ # run: |
36
+ # gem uninstall bundler
37
+ # sudo rm -f /Users/runner/hostedtoolcache/Ruby/2.6.3/x64/bin/bundle
38
+ # gem install bundler -v '2.0.2'
39
+ # bundle install --jobs 4 --retry 3
40
+ # bundle exec rake
41
+
42
+ # Windows:
43
+ # name: windows
44
+ # runs-on: windows-latest
45
+ # steps:
46
+ # - uses: actions/checkout@v1
47
+
48
+ # - name: Set up Ruby 2.6
49
+ # uses: actions/setup-ruby@v1
50
+ # with:
51
+ # ruby-version: 2.6.x
52
+
53
+ # - name: Build and test with Rake
54
+ # run: |
55
+ # gem install bundler
56
+ # bundle install --jobs 4 --retry 3
57
+ # bundle exec rake test
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ # Ignore bundler config.
2
+ /.bundle
3
+
4
+ # Ignore IDE-specific files
5
+ tags
6
+
7
+ # Mac ignores
8
+ *.DS_Store
9
+
10
+ # Ignore rbenv's .ruby-version
11
+ .ruby-version
12
+
13
+ # Ignore local cache of remote Rubocop config
14
+ .rubocop-https*
15
+
16
+ # Other tmp stuff
17
+ tmp*
18
+
19
+ # Gem stuff
20
+ pkg/
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Mark Delk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # git-sprint
2
+
3
+ ![](https://github.com/jethrodaniel/git-sprint/workflows/build/badge.svg)
4
+
5
+ Source code is avaiable under MIT license at https://github.com/jethrodaniel/git-sprint.
6
+
7
+ ## Installation
8
+
9
+ ```
10
+ gem install git-sprint
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ git sprint help
17
+ ```
18
+
19
+ ## Development
20
+
21
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
22
+
23
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
24
+
25
+
26
+ ## Contributing
27
+
28
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jethrodaniel/git-sprint.
29
+
30
+ ### Todo
31
+
32
+ See the github project.
33
+
34
+ ## License
35
+
36
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'git-sprint'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ require 'pry'
11
+ Pry.start
data/bin/setup ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ APP_ROOT = File.expand_path '..', __dir__
5
+
6
+ def system! *args
7
+ system(*args) || abort("\n== Command #{args} failed ==")
8
+ end
9
+
10
+ def check_has_command? name
11
+ `which #{name}`
12
+ icon = $CHILD_STATUS.success? ? :✔️ : :❌
13
+ puts "has command? #{name} #{icon}"
14
+ $CHILD_STATUS.success? || abort("\n== Missing required command #{name} ==")
15
+ end
16
+
17
+ Dir.chdir APP_ROOT do
18
+ # This script is a starting point to setup your application.
19
+ # Add necessary setup steps to this file.
20
+ puts '== Setting up gem for local development =='
21
+
22
+ puts '== Installing dependencies =='
23
+ system! 'gem install bundler --conservative'
24
+ system('bundle check') || system!('bundle install')
25
+
26
+ puts '== Done! =='
27
+ end
data/bin/test ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ puts '== Installing gem locally =='
4
+ system 'bundle exec rake install'
5
+
6
+ puts '== Running gem specs =='
7
+ puts <<~MSG
8
+
9
+ Use like so:
10
+
11
+ ./bin/test
12
+ ./bin/test spec/example_spec.rb:42
13
+ ./bin/test spec/example_spec.rb --name 'test_name_here'
14
+
15
+ MSG
16
+
17
+ env = {'BACKTRACE' => 'true'}
18
+
19
+ system env, *%w[bundle exec m], *ARGV
20
+
21
+ puts '== Finished gem specs =='
data/exe/git-sprint ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'pathname'
5
+ lib = Pathname.new(__dir__) + '..' + 'lib'
6
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
+
8
+ require 'git-sprint'
9
+ require 'git-sprint/cli'
10
+
11
+ # Hack to make `git sprint` help show `sprint` instead of `git-sprint`.
12
+ # @todo fix this, and set this the right way
13
+ $PROGRAM_NAME = 'sprint'
14
+
15
+ GitSprint::CLI.start ARGV
data/gems.locked ADDED
@@ -0,0 +1,98 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ git-sprint (0.1.0)
5
+ colorize (~> 0.8.1)
6
+ lolcat (~> 100.0)
7
+ thor (~> 0.20.3)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ ansi (1.5.0)
13
+ ast (2.4.0)
14
+ builder (3.2.3)
15
+ byebug (11.0.1)
16
+ coderay (1.1.2)
17
+ colorize (0.8.1)
18
+ diff-lcs (1.3)
19
+ git (1.5.0)
20
+ jaro_winkler (1.5.3)
21
+ lolcat (100.0.0)
22
+ manpages (~> 0.6.1)
23
+ optimist (~> 3.0.0)
24
+ paint (~> 2.1.0)
25
+ m (1.5.1)
26
+ method_source (>= 0.6.7)
27
+ rake (>= 0.9.2.2)
28
+ manpages (0.6.1)
29
+ method_source (0.9.2)
30
+ minitest (5.12.0)
31
+ minitest-reporters (1.3.8)
32
+ ansi
33
+ builder
34
+ minitest (>= 5.0)
35
+ ruby-progressbar
36
+ minitest-spec-context (0.0.4)
37
+ optimist (3.0.0)
38
+ paint (2.1.1)
39
+ parallel (1.17.0)
40
+ parser (2.6.4.1)
41
+ ast (~> 2.4.0)
42
+ powerpack (0.1.2)
43
+ pry (0.12.2)
44
+ coderay (~> 1.1.0)
45
+ method_source (~> 0.9.0)
46
+ pry-byebug (3.7.0)
47
+ byebug (~> 11.0)
48
+ pry (~> 0.10)
49
+ psych (3.1.0)
50
+ rainbow (3.0.0)
51
+ rake (12.3.3)
52
+ rspec (3.8.0)
53
+ rspec-core (~> 3.8.0)
54
+ rspec-expectations (~> 3.8.0)
55
+ rspec-mocks (~> 3.8.0)
56
+ rspec-core (3.8.2)
57
+ rspec-support (~> 3.8.0)
58
+ rspec-expectations (3.8.4)
59
+ diff-lcs (>= 1.2.0, < 2.0)
60
+ rspec-support (~> 3.8.0)
61
+ rspec-mocks (3.8.1)
62
+ diff-lcs (>= 1.2.0, < 2.0)
63
+ rspec-support (~> 3.8.0)
64
+ rspec-support (3.8.2)
65
+ rubocop (0.65.0)
66
+ jaro_winkler (~> 1.5.1)
67
+ parallel (~> 1.10)
68
+ parser (>= 2.5, != 2.5.1.1)
69
+ powerpack (~> 0.1)
70
+ psych (>= 3.1.0)
71
+ rainbow (>= 2.2.2, < 4.0)
72
+ ruby-progressbar (~> 1.7)
73
+ unicode-display_width (~> 1.4.0)
74
+ ruby-progressbar (1.10.1)
75
+ thor (0.20.3)
76
+ unicode-display_width (1.4.1)
77
+ yard (0.9.20)
78
+
79
+ PLATFORMS
80
+ ruby
81
+
82
+ DEPENDENCIES
83
+ bundler (~> 2.0)
84
+ git (~> 1.5)
85
+ git-sprint!
86
+ m (~> 1.5)
87
+ minitest (~> 5.11)
88
+ minitest-reporters (~> 1.3)
89
+ minitest-spec-context (~> 0.0.4)
90
+ pry (~> 0.12.2)
91
+ pry-byebug (~> 3.7)
92
+ rake (~> 12.3.2)
93
+ rspec (~> 3.8)
94
+ rubocop (~> 0.65.0)
95
+ yard (~> 0.9.18)
96
+
97
+ BUNDLED WITH
98
+ 2.0.2
data/gems.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path 'lib', __dir__
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'git-sprint/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'git-sprint'
9
+ spec.version = GitSprint::VERSION
10
+ spec.authors = ['Mark Delk']
11
+ spec.email = ['jethrodaniel@gmail.com']
12
+
13
+ spec.summary = 'a git plugin for sprint related commands'
14
+ spec.homepage = 'https://github.com/jethrodaniel/git-sprint'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the
18
+ # 'allowed_push_host' to allow pushing to a single host or delete this
19
+ # section to allow pushing to any host.
20
+ unless spec.respond_to? :metadata
21
+ raise <<~MSG
22
+ RubyGems 2.0 or newer is required to protect against public gem pushes.
23
+ MSG
24
+ end
25
+
26
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
27
+ spec.metadata['homepage_uri'] = spec.homepage
28
+ spec.metadata['source_code_uri'] = spec.homepage
29
+
30
+ # Specify which files should be added to the gem when it is released. The
31
+ # `git ls-files -z` loads the files in the RubyGem that have been added into
32
+ # git.
33
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
34
+ `git ls-files -z`.split("\x0").reject do |f|
35
+ f.match %r{^(test|spec|features)/}
36
+ end
37
+ end
38
+ spec.bindir = 'exe'
39
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename f }
40
+ spec.require_paths = ['lib']
41
+ {
42
+ 'pry' => '~> 0.12.2',
43
+ 'pry-byebug' => '~> 3.7',
44
+ 'bundler' => '~> 2.0',
45
+ 'git' => '~> 1.5',
46
+ 'rake' => '~> 12.3.2',
47
+ 'minitest' => '~> 5.11',
48
+ 'minitest-spec-context' => '~> 0.0.4',
49
+ 'minitest-reporters' => '~> 1.3',
50
+ 'rspec' => '~> 3.8',
51
+ 'm' => '~> 1.5',
52
+ 'yard' => '~> 0.9.18',
53
+ 'rubocop' => '~> 0.65.0'
54
+ }.each do |gem, version|
55
+ spec.add_development_dependency gem, version
56
+ end
57
+
58
+ {
59
+ 'thor' => '~> 0.20.3',
60
+ 'colorize' => '~> 0.8.1',
61
+ 'lolcat' => '~> 100.0'
62
+ }.each do |gem, version|
63
+ spec.add_dependency gem, version
64
+ end
65
+ end
@@ -0,0 +1,224 @@
1
+ # frozen_string_literal: false
2
+
3
+ # ffrozen_string_literal: true
4
+
5
+ # The actual CLI part of this app.
6
+ #
7
+ # It's a standard thor CLI, and is called in the executable.
8
+
9
+ require 'git-sprint'
10
+
11
+ require 'stringio'
12
+
13
+ require 'git'
14
+ require 'thor'
15
+ require 'lolcat'
16
+
17
+ class String
18
+ include GitSprint::CaptureOutput
19
+
20
+ def rainbow
21
+ capture_std_out do
22
+ lolcat_opts = {spread: 3, freq: 0.1}
23
+ Lol.instance_eval { @os = rand * 8192 }
24
+ Lol.println self, lolcat_opts
25
+ end
26
+ end
27
+ end
28
+
29
+ module GitSprint
30
+ # Main command class
31
+ #
32
+ # @todo: use config for colors. `git.config.has_key? 'sprint.colors.branch'`
33
+ class CLI < Thor
34
+ include GitSprint::CaptureOutput
35
+
36
+ # Exit non-zero when no command is found of something was required, etc.
37
+ def self.exit_on_failure?
38
+ true
39
+ end
40
+
41
+ # Set debug level, --debug=N
42
+ class_option :debug,
43
+ type: :string,
44
+ banner: 'INFO (or WARN, DEBUG, ERROR, etc)',
45
+ aliases: %w[-d]
46
+
47
+ # Enable or disable color output
48
+ class_option :color, type: :boolean, aliases: %w[-c --color]
49
+
50
+ map %w[-v -V] => :version
51
+ desc :version, 'show the version'
52
+ def version
53
+ version = GitSprint::VERSION
54
+ if options[:color]
55
+ say "git sprint version #{version.light_green}"
56
+ else
57
+ say "git sprint version #{version}"
58
+ end
59
+ end
60
+
61
+ # Get help for a command.
62
+ #
63
+ # This command is generated by thor, so we just add a message to the start
64
+ # when `git sprint` or `git sprint help` is called.
65
+ #
66
+ # @param cmd [String] The command to get help on
67
+ # @param args [Array<String>] Additional command arguments
68
+ def help cmd = nil, *args
69
+ handle_debug_option!
70
+ log.debug { 'Running `help` command...' }
71
+
72
+ banner = <<~MSG
73
+ Name:
74
+ git sprint
75
+
76
+ Summary:
77
+ a git plugin for sprint related commands
78
+
79
+ Install and start using like so
80
+
81
+ gem install git-sprint && git sprint help
82
+
83
+ See https://github.com/jethrodaniel/git-sprint
84
+ MSG
85
+
86
+ usage = capture_std_out { super }
87
+
88
+ if cmd.nil? # print banner
89
+ if options[:color]
90
+ say "#{banner}\n#{usage}".rainbow
91
+ else
92
+ say "#{banner}\n#{usage}"
93
+ end
94
+ else
95
+ say usage unless options[:color]
96
+ end
97
+
98
+ log.debug { 'Finished `help` command.' }
99
+ end
100
+
101
+ desc :list, 'list all sprint branches'
102
+ def list
103
+ handle_debug_option!
104
+ log.debug { 'Running `list` command...' }
105
+
106
+ sprint_branches = git.branches
107
+ .local
108
+ .map(&:name)
109
+ .select { |b| b.include? 'sprint' }
110
+
111
+ die 'no sprint branches!' if sprint_branches.empty?
112
+
113
+ msg = 'sprint branches:'
114
+ say options[:color] ? msg.light_magenta : msg
115
+
116
+ sprint_branches.each do |branch|
117
+ say format_branch(branch: branch, color: :green)
118
+ end
119
+
120
+ log.debug { 'Finished `list` command...' }
121
+ end
122
+
123
+ desc :start, 'start a new sprint'
124
+ def start
125
+ handle_debug_option!
126
+ set_sprint_vars!
127
+
128
+ log.debug { 'Running `start` command...' }
129
+
130
+ git.branch(@dev_branch).create
131
+ git.branch(@branch).create
132
+
133
+ msg = 'created new branches'
134
+ say <<~MSG
135
+ #{options[:color] ? msg.light_magenta : msg}
136
+ #{format_branch branch: @branch, color: :green}
137
+ #{format_branch branch: @dev_branch, color: :green}
138
+ MSG
139
+
140
+ log.debug { 'Finished `start` command...' }
141
+ rescue Git::GitExecuteError => e
142
+ die "[Error] #{e.class}\n#{e.message}"
143
+ end
144
+
145
+ desc :delete, 'delete a sprint'
146
+ def delete
147
+ handle_debug_option!
148
+ set_sprint_vars!
149
+
150
+ log.debug { 'Running `delete` command...' }
151
+
152
+ del_msg = 'deleted sprint branches:'
153
+ msg = <<~MSG
154
+ #{options[:color] ? del_msg.light_magenta : del_msg}
155
+ #{format_branch branch: @branch, color: :red}
156
+ #{format_branch branch: @dev_branch, color: :red}
157
+ MSG
158
+
159
+ git.branch(@dev_branch).delete
160
+ git.branch(@branch).delete
161
+
162
+ say msg
163
+
164
+ log.debug { 'Finished `delete` command...' }
165
+ rescue Git::GitExecuteError => e
166
+ die "[Error] #{e.class}\n#{e.message}"
167
+ end
168
+
169
+ no_commands do
170
+ def die msg
171
+ if options[:color]
172
+ say msg, :red
173
+ else
174
+ say msg
175
+ end
176
+ exit 1
177
+ end
178
+
179
+ def handle_debug_option!
180
+ ENV['GIT_SPRINT_LOG_LEVEL'] = 'DEBUG' if options[:debug]
181
+ end
182
+
183
+ def git
184
+ # @todo refactor logger and use here
185
+ @git ||= Git.open Dir.pwd # , :log => Logger.new(STDERR)
186
+ rescue Git::GitExecuteError => e
187
+ die "Error: #{e.message}"
188
+ end
189
+
190
+ def format_branch branch:, color:
191
+ sha = git.branch(branch).gcommit.sha[0..7]
192
+ if !options[:color] || !color
193
+ " #{branch.ljust 32, ' '} #{sha}"
194
+ elsif color == :red
195
+ " #{branch.ljust(32, ' ').light_red} #{sha.cyan}"
196
+ else
197
+ " #{branch.ljust(32, ' ').light_green} #{sha.cyan}"
198
+ end
199
+ end
200
+
201
+ def set_sprint_vars!
202
+ ask = -> question do
203
+ question = options[:color] ? question.light_magenta : question
204
+ ask question
205
+ end
206
+
207
+ @project = ask.call 'project name :'
208
+ @project_number = ask.call 'project number:'
209
+ @sprint_number = ask.call 'sprint number :'
210
+ say
211
+
212
+ [@project, @project_number, @sprint_number].each do |var|
213
+ die "#{var} is invalid!" if var.nil?
214
+ end
215
+
216
+ @branch = "project-#{@project_number}/" \
217
+ "sprint-#{@sprint_number}/" \
218
+ "#{@project}"
219
+
220
+ @dev_branch = "#{@branch}-dev"
221
+ end
222
+ end
223
+ end
224
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'logger'
4
+ require 'colorize'
5
+
6
+ class Logger
7
+ class Formatter
8
+ def call severity, time, _progname, msg
9
+ color = case severity
10
+ when 'DEBUG' then :magenta
11
+ when 'INFO' then :green
12
+ when 'WARN' then :cyan
13
+ when 'ERROR' then :red
14
+ when 'FATAL', 'UNKNOWN' then :red
15
+ end
16
+
17
+ "[#{severity.ljust(5, ' ').colorize color}][#{time}]: #{msg}\n"
18
+ end
19
+ end
20
+ end
21
+
22
+ module GitSprintLogger
23
+ # Access a logger, to stdout (for now).
24
+ #
25
+ # Uses logging level ENV['GIT_SPRINT_LOG_LEVEL'], which can be WARN, INFO,
26
+ # etc, or even a number (since those just map to integers anyway).
27
+ def log
28
+ Logger.new(STDOUT).tap do |logger|
29
+ if Logger.constants.map(&:to_s).include? ENV['GIT_SPRINT_LOG_LEVEL']
30
+ logger.level = Logger.const_get ENV['GIT_SPRINT_LOG_LEVEL']
31
+ else
32
+ logger.level = Logger::INFO
33
+ logger.level = 9001 if GitSprint.testing?
34
+ end
35
+ end
36
+ end
37
+ end
38
+
39
+ class Thor
40
+ include GitSprintLogger
41
+ end
42
+
43
+ module GitSprint
44
+ include GitSprintLogger
45
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GitSprint
4
+ VERSION = '0.1.0'
5
+ end
data/lib/git-sprint.rb ADDED
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'git-sprint/version'
4
+ require 'git-sprint/logger'
5
+
6
+ module GitSprint
7
+ def self.testing?
8
+ ENV['GIT_SPRINT_TESTING'] == 'true'
9
+ end
10
+
11
+ # eww, global vars ...
12
+ #
13
+ # @todo remove the need for something like this.
14
+ #
15
+ # Either:
16
+ # - use custom help commands so that we can say, color the string
17
+ # - use something besides thor
18
+ #
19
+ # All this is needed for now is to capture the output of
20
+ # thor default commands that print to std out, to allow access to
21
+ # the actual help string.
22
+ module CaptureOutput
23
+ def capture_std_out
24
+ dummy = StringIO.new
25
+ original = $stdout
26
+ $stdout = dummy
27
+ yield
28
+ $stdout = original
29
+ dummy.string
30
+ end
31
+ end
32
+ end
data/rakefile.rb ADDED
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
9
+ require 'rdoc/task'
10
+
11
+ RDoc::Task.new :rdoc do |rdoc|
12
+ rdoc.rdoc_dir = 'rdoc'
13
+ rdoc.title = 'gud'
14
+ rdoc.options << '--line-numbers'
15
+ rdoc.rdoc_files.include 'README.md'
16
+ rdoc.rdoc_files.include 'lib/**/*.rb'
17
+ end
18
+
19
+ require 'bundler/gem_tasks'
20
+
21
+ require 'rake/testtask'
22
+
23
+ Rake::TestTask.new :test do |t|
24
+ t.libs << 'spec'
25
+ t.pattern = 'spec/**/*_spec.rb'
26
+ t.verbose = false
27
+ t.warning = false
28
+ end
29
+
30
+ task :spec => :test
31
+ task :default => :test
metadata ADDED
@@ -0,0 +1,273 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: git-sprint
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mark Delk
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-10-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.12.2
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.12.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry-byebug
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: git
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.5'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 12.3.2
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 12.3.2
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '5.11'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '5.11'
97
+ - !ruby/object:Gem::Dependency
98
+ name: minitest-spec-context
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.0.4
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.0.4
111
+ - !ruby/object:Gem::Dependency
112
+ name: minitest-reporters
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.3'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.3'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.8'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.8'
139
+ - !ruby/object:Gem::Dependency
140
+ name: m
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '1.5'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '1.5'
153
+ - !ruby/object:Gem::Dependency
154
+ name: yard
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 0.9.18
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.9.18
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.65.0
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 0.65.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: thor
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.20.3
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 0.20.3
195
+ - !ruby/object:Gem::Dependency
196
+ name: colorize
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: 0.8.1
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 0.8.1
209
+ - !ruby/object:Gem::Dependency
210
+ name: lolcat
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '100.0'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '100.0'
223
+ description:
224
+ email:
225
+ - jethrodaniel@gmail.com
226
+ executables:
227
+ - git-sprint
228
+ extensions: []
229
+ extra_rdoc_files: []
230
+ files:
231
+ - ".github/workflows/build.yml"
232
+ - ".gitignore"
233
+ - LICENSE.txt
234
+ - README.md
235
+ - bin/console
236
+ - bin/setup
237
+ - bin/test
238
+ - exe/git-sprint
239
+ - gems.locked
240
+ - gems.rb
241
+ - git-sprint.gemspec
242
+ - lib/git-sprint.rb
243
+ - lib/git-sprint/cli.rb
244
+ - lib/git-sprint/logger.rb
245
+ - lib/git-sprint/version.rb
246
+ - rakefile.rb
247
+ homepage: https://github.com/jethrodaniel/git-sprint
248
+ licenses:
249
+ - MIT
250
+ metadata:
251
+ allowed_push_host: https://rubygems.org/
252
+ homepage_uri: https://github.com/jethrodaniel/git-sprint
253
+ source_code_uri: https://github.com/jethrodaniel/git-sprint
254
+ post_install_message:
255
+ rdoc_options: []
256
+ require_paths:
257
+ - lib
258
+ required_ruby_version: !ruby/object:Gem::Requirement
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
263
+ required_rubygems_version: !ruby/object:Gem::Requirement
264
+ requirements:
265
+ - - ">="
266
+ - !ruby/object:Gem::Version
267
+ version: '0'
268
+ requirements: []
269
+ rubygems_version: 3.0.3
270
+ signing_key:
271
+ specification_version: 4
272
+ summary: a git plugin for sprint related commands
273
+ test_files: []