git-story-workflow 0.9.12 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/git-story-workflow.gemspec +5 -3
- data/lib/git/story/app.rb +27 -22
- data/lib/git/story/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0a262c355dd2d101911c442e5e9ba5d12da74967e3db37a600dc5f2f21ed1d9
|
4
|
+
data.tar.gz: bfe8ea9f227c933eaec80aae69bef429cac5d76eb311b0ddf40b7bd6247e7779
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4957004998e3f360de92b4724a65a86ea3bc0e8264e5a740c1f8c6d4e725a4e787f449d429cfb2e5e738cd8c60cc81a38f3b481a10682282dc075c22a196ff4
|
7
|
+
data.tar.gz: 89b63867df083dccceb9673a9d18b6bfc04dcbe2e592cecf7a24826b753883079e5a8072d4645660a2e2af89427c516eba8019f3f55f189b825f1db9e4f7f3dd
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.10.0
|
data/git-story-workflow.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: git-story-workflow 0.
|
2
|
+
# stub: git-story-workflow 0.10.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "git-story-workflow".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.10.0"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
11
|
-
s.date = "2020-
|
11
|
+
s.date = "2020-02-11"
|
12
12
|
s.description = "Gem abstracting a git workflow\u2026".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["git-story".freeze]
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.add_runtime_dependency(%q<mize>.freeze, [">= 0"])
|
36
36
|
s.add_runtime_dependency(%q<term-ansicolor>.freeze, [">= 0"])
|
37
37
|
s.add_runtime_dependency(%q<complex_config>.freeze, [">= 0"])
|
38
|
+
s.add_runtime_dependency(%q<search_ui>.freeze, [">= 0"])
|
38
39
|
else
|
39
40
|
s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
|
40
41
|
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
@@ -45,5 +46,6 @@ Gem::Specification.new do |s|
|
|
45
46
|
s.add_dependency(%q<mize>.freeze, [">= 0"])
|
46
47
|
s.add_dependency(%q<term-ansicolor>.freeze, [">= 0"])
|
47
48
|
s.add_dependency(%q<complex_config>.freeze, [">= 0"])
|
49
|
+
s.add_dependency(%q<search_ui>.freeze, [">= 0"])
|
48
50
|
end
|
49
51
|
end
|
data/lib/git/story/app.rb
CHANGED
@@ -3,6 +3,8 @@ require 'open-uri'
|
|
3
3
|
require 'tins/go'
|
4
4
|
require 'set'
|
5
5
|
require 'infobar'
|
6
|
+
require 'search_ui'
|
7
|
+
require 'amatch'
|
6
8
|
|
7
9
|
class Git::Story::App
|
8
10
|
class ::String
|
@@ -13,6 +15,7 @@ class Git::Story::App
|
|
13
15
|
extend Git::Story::Utils
|
14
16
|
include ComplexConfig::Provider::Shortcuts
|
15
17
|
include Tins::GO
|
18
|
+
include SearchUI
|
16
19
|
|
17
20
|
annotate :command
|
18
21
|
|
@@ -315,29 +318,31 @@ class Git::Story::App
|
|
315
318
|
def switch(pattern = nil)
|
316
319
|
fetch_commits
|
317
320
|
ss = stories.map(&:story_base_name)
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
321
|
+
branch = Search.new(
|
322
|
+
match: -> answer {
|
323
|
+
answer = answer.strip.delete(?#).downcase
|
324
|
+
|
325
|
+
matcher = Amatch::PairDistance.new(answer)
|
326
|
+
matches = ss.map { |n| [ n, -matcher.similar(n.downcase) ] }.
|
327
|
+
select { |_, s| s < 0 }.sort_by(&:last).map(&:first)
|
328
|
+
|
329
|
+
matches.empty? and matches = ss
|
330
|
+
matches.first(Tins::Terminal.lines - 1)
|
331
|
+
},
|
332
|
+
query: -> _answer, matches, selector {
|
333
|
+
matches.each_with_index.
|
334
|
+
map { |m, i| i == selector ? '⏻ ' + Search.on_blue(m) : '┊ ' + m } * ?\n
|
335
|
+
},
|
336
|
+
found: -> _answer, matches, selector {
|
337
|
+
matches[selector]
|
338
|
+
},
|
339
|
+
prompt: 'Story? %s'.bold,
|
340
|
+
output: STDOUT
|
341
|
+
).start
|
342
|
+
if branch
|
343
|
+
sh "git checkout #{branch}"
|
344
|
+
return "Switched to story: #{branch}".green
|
339
345
|
end
|
340
|
-
rescue Interrupt
|
341
346
|
end
|
342
347
|
|
343
348
|
command doc: '[BRANCH] open branch on github'
|
data/lib/git/story/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-story-workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: search_ui
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
description: Gem abstracting a git workflow…
|
140
154
|
email: flori@ping.de
|
141
155
|
executables:
|