completely 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd3ae4ec92d7318bd4ef32fdd465d9bff3341931f5f965d2db8f263c1b95e38b
4
- data.tar.gz: 01ccb2fa2e1f050b7a45944b552590fad6aab9bafc90ef4cb98b8d6284200392
3
+ metadata.gz: ba5123d5b0bf95ed7ea2140188a6079e0510456a754d5fd93830df1382862274
4
+ data.tar.gz: 0f98b90e1515d753b94817932916aad966b8b3f81ede79f1bbb40a898b82662e
5
5
  SHA512:
6
- metadata.gz: fd06256b9cb4c42364d118ea1392b180ef662e98b2ea9c6b24ca815f5fa5cf1f16d6c0a6792090c9bc5f376ab7dfb04e9b8c732cb83292140acb59676d6090a9
7
- data.tar.gz: b1985849259627803ebe3f7c56b4adc98137456b172fb36cbf1379b4677257dca6cc671d85a12106596fb246de02aad07c5e9d51c5dd0abc7301518d9b7529b2
6
+ metadata.gz: e3618affd00e4a624b288ae7c37fd0d857fd9cf0672d6bcc8c558eb7870e2e3001e86a1c6997bc177def3b245bdc1142287539d99423dc175f6e208a9bf8a3b9
7
+ data.tar.gz: a34bc567cbf492e437168afeb0a509f392eb1600a49622136d50728a936c024ad90e757d3a3ede18b0b7204302b09e08567054c73f75ea03fd3cdea9d39074e3
data/README.md CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/completely.svg)](https://badge.fury.io/rb/completely)
4
4
  [![Build Status](https://github.com/DannyBen/completely/workflows/Test/badge.svg)](https://github.com/DannyBen/completely/actions?query=workflow%3ATest)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/6c021b8309ac796c3919/maintainability)](https://codeclimate.com/github/DannyBen/completely/maintainability)
5
6
 
6
7
  ---
7
8
 
8
9
  Completely is a command line utility and a Ruby library that lets you generate
9
10
  bash completion scripts from simple YAML configuration.
10
11
 
11
- This tool is for you it:
12
+ This tool is for you if:
12
13
 
13
14
  1. You develop your own command line tools.
14
15
  2. Your life feels empty without bash completions.
@@ -19,11 +20,11 @@ This tool is for you it:
19
20
 
20
21
  ## Install
21
22
 
22
- ```
23
+ ```bash
23
24
  $ gem install completely
24
25
  ```
25
26
 
26
- ## Usage
27
+ ## Using the `completely` command line
27
28
 
28
29
  The `completely` command line works with a simple YAML configuration file as
29
30
  input, and generates a bash completions script as output.
@@ -78,7 +79,7 @@ follows it will be suggested as completions.
78
79
 
79
80
  To generate the bash script, simply run:
80
81
 
81
- ```
82
+ ```bash
82
83
  $ completely generate
83
84
 
84
85
  # or, to just preview it without saving:
@@ -87,7 +88,7 @@ $ completely preview
87
88
 
88
89
  For more options (like setting input/output path), run
89
90
 
90
- ```
91
+ ```bash
91
92
  $ completely --help
92
93
  ```
93
94
 
@@ -107,17 +108,36 @@ simply be added using the [`compgen -A action`][compgen] function, so you can
107
108
  in fact use any of its supported arguments.
108
109
 
109
110
 
110
- ### Using the generated completion scripts
111
+ ## Using the generated completion scripts
111
112
 
112
113
  In order to enable the completions, simply source the generated script:
113
114
 
114
- ```
115
+ ```bash
115
116
  $ source completely.bash
116
117
  ```
117
118
 
118
119
  You may wish to add this to your `~/.bashrc` file to enable this for future
119
120
  sessions (just be sure to use absolute path).
120
121
 
122
+ ## Using from within Ruby code
123
+
124
+ ```ruby
125
+ require 'completely'
126
+
127
+ # Load from file
128
+ completions = Completely::Completions.load "input.yaml"
129
+
130
+ # Or, from a hash
131
+ input = {
132
+ "mygit" => %w[--help --version status init commit],
133
+ "mygit status" => %w[--help --verbose --branch]
134
+ }
135
+ completions = Completely::Completions.new input
136
+
137
+ # Generate the script
138
+ puts completions.script
139
+ ```
140
+
121
141
 
122
142
  ## Contributing / Support
123
143
 
data/lib/completely.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'requires'
2
-
3
1
  if ENV['BYEBUG']
4
2
  require 'byebug'
5
3
  require 'lp'
@@ -1,6 +1,6 @@
1
1
  require 'mister_bin'
2
- require 'completely/command'
3
2
  require 'completely/version'
3
+ require 'completely/command'
4
4
 
5
5
  module Completely
6
6
  class CLI
@@ -1,3 +1,3 @@
1
1
  module Completely
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: completely
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.7'
41
- - !ruby/object:Gem::Dependency
42
- name: requires
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.1'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.1'
55
41
  description: Generate bash completion scripts using simple YAML configuration
56
42
  email: db@dannyben.com
57
43
  executables: