smore 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: dd2970d10cfb74f907b35b52f3305b26b90c7448cc2df2cb0db1e87f653774d9
4
+ data.tar.gz: 0225252dc546474dc01a9b14ce577901f554a101321fef1c878da5ba083585f1
5
+ SHA512:
6
+ metadata.gz: cd15e327ca75aeec73a2b0241c69bc43570b326ef8d12df979179aa589eea4f28b88b420929d3dfc97d90005834cbd0d1f08d2c10a80eefec4b09c7cab1606a2
7
+ data.tar.gz: c8bfa66a0f0f4a9d619cd9d74be82e68884d09c6bf3d02dbc73fb4f2f1f1942b8b6894b54adb4c101bc37da8e8e9e5d73f6c43f098be8cc45b660fc7bd70b4a2
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 xrendan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # smore
2
+
3
+ [![Gem Version](https://img.shields.io/gem/v/smore)](https://rubygems.org/gems/smore)
4
+ [![Gem Downloads](https://img.shields.io/gem/dt/smore)](https://www.ruby-toolbox.com/projects/smore)
5
+ [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/xrendan/smore/ci.yml)](https://github.com/xrendan/smore/actions/workflows/ci.yml)
6
+ [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/xrendan/smore)](https://codeclimate.com/github/xrendan/smore)
7
+
8
+ smore brings tools to the raix and roast ecosystems to make it easier to automate workflows with AI.
9
+
10
+
11
+ ---
12
+
13
+ - [Quick start](#quick-start)
14
+ - [Support](#support)
15
+ - [License](#license)
16
+ - [Code of conduct](#code-of-conduct)
17
+ - [Contribution guide](#contribution-guide)
18
+
19
+ ## Quick start
20
+
21
+ ```
22
+ gem install smore
23
+ ```
24
+
25
+ ```ruby
26
+ require "smore"
27
+ ```
28
+
29
+ ## Support
30
+
31
+ If you want to report a bug, or have ideas, feedback or questions about the gem, [let me know via GitHub issues](https://github.com/xrendan/smore/issues/new) and I will do my best to provide a helpful answer. Happy hacking!
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](LICENSE.txt).
36
+
37
+ ## Code of conduct
38
+
39
+ Everyone interacting in this project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
40
+
41
+ ## Contribution guide
42
+
43
+ Pull requests are welcome, PRs adding tools without tests will be rejected.
44
+
45
+ If a tool requires a certain dependency, add a test that throws an error if
46
+ the dependency is not installed.
data/exe/smore ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "smore"
5
+ Smore::CLI.start(ARGV)
data/lib/smore/cli.rb ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+
5
+ module Smore
6
+ class CLI < Thor
7
+ extend ThorExt::Start
8
+
9
+ map %w[-v --version] => "version"
10
+
11
+ desc "version", "Display smore version", hide: true
12
+ def version
13
+ say "smore/#{VERSION} #{RUBY_DESCRIPTION}"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Smore
4
+ module ThorExt
5
+ # Configures Thor to behave more like a typical CLI, with better help and error handling.
6
+ #
7
+ # - Passing -h or --help to a command will show help for that command.
8
+ # - Unrecognized options will be treated as errors (instead of being silently ignored).
9
+ # - Error messages will be printed in red to stderr, without stack trace.
10
+ # - Full stack traces can be enabled by setting the VERBOSE environment variable.
11
+ # - Errors will cause Thor to exit with a non-zero status.
12
+ #
13
+ # To take advantage of this behavior, your CLI should subclass Thor and extend this module.
14
+ #
15
+ # class CLI < Thor
16
+ # extend ThorExt::Start
17
+ # end
18
+ #
19
+ # Start your CLI with:
20
+ #
21
+ # CLI.start
22
+ #
23
+ # In tests, prevent Kernel.exit from being called when an error occurs, like this:
24
+ #
25
+ # CLI.start(args, exit_on_failure: false)
26
+ #
27
+ module Start
28
+ def self.extended(base)
29
+ super
30
+ base.check_unknown_options!
31
+ end
32
+
33
+ def start(given_args=ARGV, config={})
34
+ config[:shell] ||= Thor::Base.shell.new
35
+ handle_help_switches(given_args) do |args|
36
+ dispatch(nil, args, nil, config)
37
+ end
38
+ rescue StandardError => e
39
+ handle_exception_on_start(e, config)
40
+ end
41
+
42
+ private
43
+
44
+ def handle_help_switches(given_args)
45
+ yield(given_args.dup)
46
+ rescue Thor::UnknownArgumentError => e
47
+ retry_with_args = []
48
+
49
+ if given_args.first == "help"
50
+ retry_with_args = ["help"] if given_args.length > 1
51
+ elsif e.unknown.intersect?(%w[-h --help])
52
+ retry_with_args = ["help", (given_args - e.unknown).first]
53
+ end
54
+ raise unless retry_with_args.any?
55
+
56
+ yield(retry_with_args)
57
+ end
58
+
59
+ def handle_exception_on_start(error, config)
60
+ return if error.is_a?(Errno::EPIPE)
61
+ raise if ENV["VERBOSE"] || !config.fetch(:exit_on_failure, true)
62
+
63
+ message = error.message.to_s
64
+ message.prepend("[#{error.class}] ") if message.empty? || !error.is_a?(Thor::Error)
65
+
66
+ config[:shell]&.say_error(message, :red)
67
+ exit(false)
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Smore
4
+ VERSION = "0.1.0"
5
+ end
data/lib/smore.rb ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Smore
4
+ autoload :CLI, "smore/cli"
5
+ autoload :VERSION, "smore/version"
6
+ autoload :ThorExt, "smore/thor_ext"
7
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: smore
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - xrendan
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: thor
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.2'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.2'
26
+ email:
27
+ - brendan@brendansamek.com
28
+ executables:
29
+ - smore
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - LICENSE.txt
34
+ - README.md
35
+ - exe/smore
36
+ - lib/smore.rb
37
+ - lib/smore/cli.rb
38
+ - lib/smore/thor_ext.rb
39
+ - lib/smore/version.rb
40
+ homepage: https://github.com/xrendan/smore
41
+ licenses:
42
+ - MIT
43
+ metadata:
44
+ bug_tracker_uri: https://github.com/xrendan/smore/issues
45
+ changelog_uri: https://github.com/xrendan/smore/releases
46
+ source_code_uri: https://github.com/xrendan/smore
47
+ homepage_uri: https://github.com/xrendan/smore
48
+ rubygems_mfa_required: 'true'
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '3.1'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubygems_version: 3.6.8
64
+ specification_version: 4
65
+ summary: smore brings tools to raix and roast for a delicious gooey concoction
66
+ test_files: []