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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 573271b147430fa57fbc9033ba649e3f06781682e84c5fcc9a6c0f3a298384cc
4
- data.tar.gz: eb7d882376968b14dbeff1e751aa41ac8ca4fbb9c45e990e291664b62b105554
3
+ metadata.gz: c62f93055ec627514c29cf3c8c1415f09eeb300c99e78f05f16a73bfae365c69
4
+ data.tar.gz: 5b9d24119f0ad3390a7a9b995a6e93540e0157c2c0a06e2e4453b94c42f8db4c
5
5
  SHA512:
6
- metadata.gz: ea9e30bf8524063648804609da775df4f608908748cfcd46f580d77c7cbcd3a753681857e42b6328496dd5d5914a4f711a6b9b946cd68d0a06fe10357dc2622e
7
- data.tar.gz: cce5f456d605e05c2d09938baa14c71ac0320df8a69de179920ab60a365c09d2caabbbe00f352a85d0245c34dd7e9e8ad3184c0472afe4a6b7833eb15f3c03a0
6
+ metadata.gz: ac405ec17ecf15f372b3849c18e29598d56237f625e01906a85afb528c99273836b305873901cbcd2cf2869e907c3085a7225fc43478697d06814bafe8be5dea
7
+ data.tar.gz: b334f114b4aab13a32e07a700104215075d718efc93589859ca969f69ca21a9f93edc0ee872b0b201ceedc6f3bea4e2218f21d0dbd5d175cd70e9a785c13211d
data/README.md CHANGED
@@ -1,35 +1,48 @@
1
- # UsageByExample
1
+ # Usage by Example
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/usage_by_example`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
5
+ Features
6
6
 
7
- ## Installation
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
- ```ruby
12
- gem 'usage_by_example'
13
- ```
14
-
15
- And then execute:
13
+ Example
16
14
 
17
- $ bundle install
18
-
19
- Or install it yourself as:
15
+ ```ruby
16
+ require 'usage_by_example'
20
17
 
21
- $ gem install usage_by_example
18
+ Options = UsageByExample.read(DATA).parse(ARGV)
22
19
 
23
- ## Usage
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
- ## Development
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
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
35
+ Usage: connect [options] [mode] host port
30
36
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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
- ## Contributing
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.0.0'
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.0.0
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
@@ -1,4 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
4
- --order random
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec # Specify your gem's dependencies in usage_by_example.gemspec
6
-
7
- gem 'pry'
8
- gem 'rspec'
9
-
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