usage_by_example 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -21
- data/lib/usage_by_example/version.rb +6 -1
- metadata +1 -4
- data/.rspec +0 -4
- data/Gemfile +0 -9
- data/Gemfile.lock +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c62f93055ec627514c29cf3c8c1415f09eeb300c99e78f05f16a73bfae365c69
|
4
|
+
data.tar.gz: 5b9d24119f0ad3390a7a9b995a6e93540e0157c2c0a06e2e4453b94c42f8db4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac405ec17ecf15f372b3849c18e29598d56237f625e01906a85afb528c99273836b305873901cbcd2cf2869e907c3085a7225fc43478697d06814bafe8be5dea
|
7
|
+
data.tar.gz: b334f114b4aab13a32e07a700104215075d718efc93589859ca969f69ca21a9f93edc0ee872b0b201ceedc6f3bea4e2218f21d0dbd5d175cd70e9a785c13211d
|
data/README.md
CHANGED
@@ -1,35 +1,48 @@
|
|
1
|
-
#
|
1
|
+
# Usage by Example
|
2
2
|
|
3
|
-
|
3
|
+
No-code options parser that automatically detects command-line options from the usage text of your application. This intuitive parser identifies optional and required argument names as well as option names without requiring any additional code, making it easy to manage user input for your command-line applications.
|
4
4
|
|
5
|
-
|
5
|
+
Features
|
6
6
|
|
7
|
-
|
7
|
+
- Automatically detects optional and required argument names from usage text
|
8
|
+
- Automatically detects option names and associated arguments (if any) from usage text
|
9
|
+
- Parses those arguments and options from the command line (ARGV)
|
10
|
+
- Raises errors for unknown options or missing required arguments
|
8
11
|
|
9
|
-
Add this line to your application's Gemfile:
|
10
12
|
|
11
|
-
|
12
|
-
gem 'usage_by_example'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
13
|
+
Example
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
Or install it yourself as:
|
15
|
+
```ruby
|
16
|
+
require 'usage_by_example'
|
20
17
|
|
21
|
-
|
18
|
+
Options = UsageByExample.read(DATA).parse(ARGV)
|
22
19
|
|
23
|
-
|
20
|
+
puts Options.include_secure?
|
21
|
+
puts Options.include_verbose?
|
22
|
+
puts Options.include_retries?
|
23
|
+
puts Options.include_timeout?
|
24
|
+
puts Options.argument_retries
|
25
|
+
puts Options.argument_timeout
|
26
|
+
puts Options.argument_mode
|
27
|
+
puts Options.argument_host
|
28
|
+
puts Options.argument_port
|
24
29
|
|
25
|
-
TODO: Write usage instructions here
|
26
30
|
|
27
|
-
|
31
|
+
__END__
|
32
|
+
Establishes a network connection to a designated host and port, enabling
|
33
|
+
users to assess network connectivity and diagnose potential problems.
|
28
34
|
|
29
|
-
|
35
|
+
Usage: connect [options] [mode] host port
|
30
36
|
|
31
|
-
|
37
|
+
Options:
|
38
|
+
-s, --secure Establish a secure connection (SSL/TSL)
|
39
|
+
-v, --verbose Enable verbose output for detailed information
|
40
|
+
-r, --retries NUM Specify the number of connection retries (default 3)
|
41
|
+
-t, --timeout NUM Set the connection timeout in seconds (default 10)
|
32
42
|
|
33
|
-
|
43
|
+
Arguments:
|
44
|
+
[mode] Optional connection mode (active or passive)
|
45
|
+
host The target host to connect to (e.g., example.com)
|
46
|
+
port The target port to connect to (e.g., 80)
|
47
|
+
```
|
34
48
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/usage_by_example.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class UsageByExample
|
4
|
-
VERSION = '1.
|
4
|
+
VERSION = '1.1.0'
|
5
5
|
end
|
6
6
|
|
7
7
|
|
@@ -11,6 +11,11 @@ __END__
|
|
11
11
|
# Minor version bump when backward-compatible changes or enhancements
|
12
12
|
# Patch version bump when backward-compatible bug fixes, security updates etc
|
13
13
|
|
14
|
+
1.0.1
|
15
|
+
|
16
|
+
- Update readme file with features and an example
|
17
|
+
- Update the gemspec to include readme and ruby files only
|
18
|
+
|
14
19
|
1.0.0
|
15
20
|
|
16
21
|
- Extract optional and required argument names from a usage text
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usage_by_example
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Kuhn
|
@@ -17,9 +17,6 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- ".rspec"
|
21
|
-
- Gemfile
|
22
|
-
- Gemfile.lock
|
23
20
|
- README.md
|
24
21
|
- lib/usage_by_example.rb
|
25
22
|
- lib/usage_by_example/version.rb
|
data/.rspec
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
usage_by_example (1.0.0.beta)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
coderay (1.1.3)
|
10
|
-
diff-lcs (1.5.0)
|
11
|
-
method_source (1.0.0)
|
12
|
-
pry (0.14.2)
|
13
|
-
coderay (~> 1.1)
|
14
|
-
method_source (~> 1.0)
|
15
|
-
rspec (3.12.0)
|
16
|
-
rspec-core (~> 3.12.0)
|
17
|
-
rspec-expectations (~> 3.12.0)
|
18
|
-
rspec-mocks (~> 3.12.0)
|
19
|
-
rspec-core (3.12.2)
|
20
|
-
rspec-support (~> 3.12.0)
|
21
|
-
rspec-expectations (3.12.3)
|
22
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
23
|
-
rspec-support (~> 3.12.0)
|
24
|
-
rspec-mocks (3.12.5)
|
25
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
-
rspec-support (~> 3.12.0)
|
27
|
-
rspec-support (3.12.0)
|
28
|
-
|
29
|
-
PLATFORMS
|
30
|
-
x86_64-darwin-19
|
31
|
-
|
32
|
-
DEPENDENCIES
|
33
|
-
pry
|
34
|
-
rspec
|
35
|
-
usage_by_example!
|
36
|
-
|
37
|
-
BUNDLED WITH
|
38
|
-
2.3.7
|