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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3067fa7b8fde9dcfb36ae040a9033c8e2236bcf1
4
- data.tar.gz: 11dbc48cec6745cb624f2fd85beb70d65d26f1e7
3
+ metadata.gz: 6622bd968e1bad1aabc41c2e77e1e77aee8e28ae
4
+ data.tar.gz: be8c21777fe71eb5dd64974fdc0498de28a8d015
5
5
  SHA512:
6
- metadata.gz: 3b0767a1d2b31c059d4dc8defd4dc244ad12a517219554cb4dfd0486286d3bc43457e626632807bea695989fd6454a6c28e0fad1aab4f328f93eb9e917725023
7
- data.tar.gz: 5f093d360a1189d3e481bac404859e036bb577ca8823d53fb562fd80b961bae546353236782e0f072a917310f1a79a7e95136b59f62b37c57b20371500b92f6f
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 'highline'
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
- linebreak
80
+ default_idx = default.nil? ? 0 : options.index(default)
81
81
 
82
- HighLine.new.choose do |menu|
83
- menu.prompt = log(msg + (default.nil? ? '' : " (Default: #{default})"), :question)
84
- menu.flow = :columns_across
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
- y = default ? 'Y' : 'y'
99
- n = default ? 'n' : 'N'
100
- answer = HighLine.new.ask(log("#{msg} (#{y}/#{n})", :question))
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.downcase == 'y'
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
 
@@ -1,3 +1,3 @@
1
1
  module FerretsOnFire
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
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.7
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-04-12 00:00:00.000000000 Z
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