u-menu 0.2.0 → 0.4.0

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: c6d032f982a5911f087289f6daf524e95abeafb01a12361977c234a3a5bedb00
4
- data.tar.gz: 24b457dd8775626ec10947b2f4b5aae4ae6b3f33a94ee91734b16f77cffebe70
3
+ metadata.gz: 413a453b9fa4da63d069763afd994f5fe0afe3298057dbc58afc5a25df3fe2a0
4
+ data.tar.gz: fa0edfa226e1026d15556b429706bd4b6f17d407c58c8bafd01aa9783e0f31c6
5
5
  SHA512:
6
- metadata.gz: 02ebe5a7b058281495f04d0256a63eddf8f2878ba8cca8852c72e8d5a47e5a790fd081e0e06b7c4ff86b2853b1c7b47f4cd63f246d675284627d88b35dac3f15
7
- data.tar.gz: a26ffd9335fd9dfa23eba00dd8bbd5fb67bba9130be71ba774e948789ec43f1bf514da66fe4f73c90c5cb3611f8321b0a88340154fd5fe5e466249e18c4955ad
6
+ metadata.gz: c76ebb0ccad068b713cd1adfdc32b796748a51a7dba9a657dafcffc73f005df750ff3371600c6607659f850b235fd3e314360b03fab06f8876ef58ab70aa30df
7
+ data.tar.gz: c4f80d5d1abc512a810eac30d4c4f79a70097594f9bdec0f54074c74a72e8b7ce5a948091899cd4600a1813ab8501170b5a2318b82ace4f87b80a82923f20456
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # u-menu
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/u/menu`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Maintainability](https://api.codeclimate.com/v1/badges/384f1905e6b7e6dc8153/maintainability)](https://codeclimate.com/github/dvinciguerra/u-menu/maintainability)
4
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/384f1905e6b7e6dc8153/test_coverage)](https://codeclimate.com/github/dvinciguerra/u-menu/test_coverage)
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ micro-menu is a command line tool that delivers a simple and customized command pallet.
6
7
 
7
8
  ## Installation
8
9
 
data/bin/u-menu CHANGED
@@ -1,19 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'bundler/inline'
4
-
5
- gemfile do
6
- source 'https://rubygems.org'
7
-
8
- gem 'pastel'
9
- gem 'tty-prompt'
10
- end
3
+ require 'pastel'
4
+ require 'tty-prompt'
11
5
 
12
6
  require 'yaml'
13
7
 
14
- config_path = File.expand_path("#{ENV.fetch('HOME', nil)}/.umenurc.yml", __dir__)
15
- config_path ||= File.expand_path("#{ENV.fetch('HOME', nil)}/.umenu/umenurc.yml", __dir__)
8
+ paths = [
9
+ File.expand_path("#{Dir.home}/.umenurc.yml", __dir__),
10
+ File.expand_path("#{Dir.home}/.umenu/umenurc.yml", __dir__),
11
+ ]
16
12
 
13
+ config_path = paths.first { |path| File.exist? path }
17
14
  config = YAML.load_file(config_path, symbolize_names: true)
18
15
 
19
16
  pastel = Pastel.new
@@ -30,9 +27,9 @@ icons = {
30
27
  }
31
28
 
32
29
  thanks = [
33
- "#{pastel.green('Great job! o/')}",
34
- "#{pastel.green('See you later! =)')}",
35
- "#{pastel.green('Baby bye bye bye...')}",
30
+ pastel.green('Great job! o/'),
31
+ pastel.green('See you later! =)'),
32
+ pastel.green('Baby bye bye bye...'),
36
33
  "Bring me #{pastel.green('a cookie')} when you come back!?",
37
34
  "Have a nice #{pastel.cyan('day')}! =)",
38
35
  "See you later #{pastel.green('olligator')}! =)"
@@ -50,7 +47,7 @@ options << {
50
47
  name: '{{settings}} Edit Settings',
51
48
  type: 'edit',
52
49
  value: 'settings',
53
- execute: "#{config_path}"
50
+ execute: config_path
54
51
  }
55
52
  options = options.sort { |a, b| a[:name] <=> b[:name] }
56
53
 
@@ -70,7 +67,7 @@ loop do
70
67
 
71
68
  case action[:type]
72
69
  when 'command'
73
- system "#{action[:execute]} &"
70
+ system action[:execute]
74
71
  when 'link'
75
72
  puts "#{pastel.bold('Sure... opening link')} '#{pastel.cyan(action[:execute])}'"
76
73
  system "open #{action[:execute]} &"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Micro
4
4
  module Menu
5
- VERSION = '0.2.0'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
data/lib/micro/menu.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'menu/version'
4
+ require_relative 'menu/icons'
4
5
 
5
6
  module Micro
6
7
  module Menu
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: u-menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Vinciguerra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-02 00:00:00.000000000 Z
11
+ date: 2023-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel