ferrets_on_fire 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ferrets_on_fire/dsl/git_dsl.rb +9 -0
- data/lib/ferrets_on_fire/dsl/logger_dsl.rb +14 -16
- data/lib/ferrets_on_fire/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6622bd968e1bad1aabc41c2e77e1e77aee8e28ae
|
4
|
+
data.tar.gz: be8c21777fe71eb5dd64974fdc0498de28a8d015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1671526314feea432aedc5d52207f81d623d86f762d7c4faecc9360dc689680322a2182be8abc085d3a24ce412ea7a655581c5abd0de9f2f7d9669a09dd78a01
|
7
|
+
data.tar.gz: 39d902776c2a9193de71f9e98d4d9c697c5d3d721d72cf196d41defc7a38d4e3c3201fd4ed98a9ec89b3bf03a2450267fdb6486004f6da4e3a243977cecebea3
|
@@ -43,6 +43,15 @@ module FerretsOnFire::DSL::GitDSL
|
|
43
43
|
tags
|
44
44
|
end
|
45
45
|
|
46
|
+
public def find_git_branches(dir)
|
47
|
+
repo = _git_setup(dir)
|
48
|
+
|
49
|
+
# Find all tags
|
50
|
+
branches = []
|
51
|
+
repo.references.each('refs/remotes/origin/*') { |ref| branches << ref }
|
52
|
+
branches
|
53
|
+
end
|
54
|
+
|
46
55
|
public def get_git_master_ref(dir)
|
47
56
|
repo = _git_setup(dir)
|
48
57
|
repo.ref('refs/remotes/origin/master')
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'colorize'
|
2
2
|
require 'benchmark'
|
3
|
-
require '
|
3
|
+
require 'tty'
|
4
4
|
|
5
5
|
module FerretsOnFire::DSL::LoggerDSL
|
6
6
|
COLORS = {
|
@@ -77,17 +77,11 @@ module FerretsOnFire::DSL::LoggerDSL
|
|
77
77
|
# @param [Array<Object>] options Array of option
|
78
78
|
# @return [Object] The chosen option value
|
79
79
|
public def choose(msg, options, default: nil)
|
80
|
-
|
80
|
+
default_idx = default.nil? ? 0 : options.index(default)
|
81
81
|
|
82
|
-
|
83
|
-
menu.
|
84
|
-
menu.
|
85
|
-
menu.default = default unless default.nil?
|
86
|
-
menu.index_suffix = ') '
|
87
|
-
|
88
|
-
options.each do |opt|
|
89
|
-
menu.choice(opt) { return opt }
|
90
|
-
end
|
82
|
+
get_prompt.select(log(msg + (default.nil? ? '' : " (Default: #{default})"), :question), per_page: 7) do |menu|
|
83
|
+
menu.default default_idx + 1
|
84
|
+
options.each { |opt| menu.choice opt }
|
91
85
|
end
|
92
86
|
end
|
93
87
|
|
@@ -95,13 +89,17 @@ module FerretsOnFire::DSL::LoggerDSL
|
|
95
89
|
answer = nil
|
96
90
|
|
97
91
|
until answer == '' || answer =~ /^(y|n)$/i
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
answer = default ? 'y' : 'n' if answer == ''
|
92
|
+
answer = get_prompt.yes?(log(msg, :question)) do |q|
|
93
|
+
q.default default
|
94
|
+
end
|
102
95
|
end
|
103
96
|
|
104
|
-
answer
|
97
|
+
answer
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
private def get_prompt
|
102
|
+
TTY::Prompt.new(help_color: :white)
|
105
103
|
end
|
106
104
|
|
107
105
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ferrets_on_fire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- phortx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: micon
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.25'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: tty
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.7.0
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.7.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rspec
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|