bunchcli 1.1.4 → 1.1.5

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
  SHA256:
3
- metadata.gz: c85d1416d51d972ef7c577b1f143b2b646e9fcd4bb1871253b6ed5f98c5bbb4c
4
- data.tar.gz: 5986ff8fdd90521530e7b10c5a151eb0144074fdbed534f869ca03345f8f1988
3
+ metadata.gz: 85429d178706578f82263c19457bf79b369efee746ac17172e1b065c6fb4a1eb
4
+ data.tar.gz: 12dc65b8c0c8c3b86c3ef050c30e4aa756b8596ca0388d4c4c89b1bdf0db3beb
5
5
  SHA512:
6
- metadata.gz: d93fa5c16bc0e49dd24ead5c7d33ba786024e115b71c290142afc520118fc99a601de1bb0b35205aa102317a1a9af430f16d379ff803816ebe92c4fef4ad72af
7
- data.tar.gz: 24bb5364188045b58253836044a9980ff1e99adb716841c5af206b08074467eb154a7e29484ad7f311528037eb61463711be43dcdcc7a9d873727670d802a057
6
+ metadata.gz: b38da1ccef956f64112c4aa70f2f195b9200f134cf7415d7ed5651e93719acb2d289462b171d61ff7573566467b6804b0039f27ed681fbaf56e758c0428b713b
7
+ data.tar.gz: 57de9a2b54ad9f6de4bc9328c1badd2342e1b7c8ac6683d3aa4ef4a098d9fcdd03f6d6d01bf1b99b49faad27c4b675793256bbcf22c864d901a2bf6f57e64d07
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 1.1.5
2
+
3
+ - Add some color to the interactive URL generator
4
+
1
5
  ### 1.1.4
2
6
 
3
7
  - Add `--show-config-key KEY` query for specific keys (dir, toggle, method)
data/Gemfile CHANGED
@@ -4,3 +4,4 @@ source "https://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  gem "rake", "~> 12.0"
7
+ gem 'term-colorizer'
data/Gemfile.lock CHANGED
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bunchcli (1.1.3)
4
+ bunchcli (1.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  rake (12.3.3)
10
+ term-colorizer (0.2.1)
10
11
 
11
12
  PLATFORMS
12
13
  x86_64-darwin-19
@@ -14,6 +15,7 @@ PLATFORMS
14
15
  DEPENDENCIES
15
16
  bunchcli!
16
17
  rake (~> 12.0)
18
+ term-colorizer
17
19
 
18
20
  BUNDLED WITH
19
21
  2.2.4
data/lib/bunch.rb CHANGED
@@ -5,4 +5,5 @@ require "bunch/version"
5
5
  require 'yaml'
6
6
  require 'cgi'
7
7
  require 'bunch/url_generator'
8
+ require 'term-colorizer'
8
9
  require 'bunch/bunchCLI'
@@ -49,7 +49,8 @@ module Prompt
49
49
  def get_line(query = '->')
50
50
  stty_save = `stty -g`.chomp
51
51
  begin
52
- line = Readline.readline("#{query}: ", true)
52
+ print query.bright_green
53
+ line = Readline.readline(": ", true)
53
54
  rescue Interrupt
54
55
  system('stty', stty_save) # Restore
55
56
  exit
@@ -60,7 +61,7 @@ module Prompt
60
61
  def get_text(query = 'Enter text, ^d to end')
61
62
  stty_save = `stty -g`.chomp
62
63
  lines = []
63
- puts query
64
+ puts query.bright_green
64
65
  begin
65
66
  while (line = Readline.readline)
66
67
  lines << line
@@ -102,15 +103,15 @@ class Menu
102
103
  def choose(query = 'Select an item')
103
104
  throw 'No items initialized' if @items.nil?
104
105
  STDERR.puts
105
- STDERR.puts "┌#{("─" * 74)}┐"
106
+ STDERR.puts "┌#{("─" * 74)}┐".yellow
106
107
  intpad = Math::log10(@items.length).to_i + 1
107
108
  @items.each_with_index do |item, idx|
108
109
  idxstr = "%#{intpad}d" % (idx + 1)
109
110
  line = "#{idxstr}: #{item.title}"
110
111
  pad = 74 - line.length
111
- STDERR.puts "│#{line}#{" " * pad}│"
112
+ STDERR.puts "│".yellow + "#{line}#{" " * pad}".bright_white + "│".yellow
112
113
  end
113
- STDERR.puts "└┤ #{query} ├#{"─" * (70 - query.length)}┘"
114
+ STDERR.puts "└┤".yellow + " #{query} ".bright_green + "├#{"─" * (70 - query.length)}┘".yellow
114
115
  sel = choose_number("> ", @items.length)
115
116
  sel ? @items[sel.to_i - 1] : nil
116
117
  end
data/lib/bunch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BunchCLI
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunchcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra