devcheck 0.1.5

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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +71 -0
  4. data/devcheck +92 -0
  5. metadata +41 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e4f68fcc82596c0be261a9fdd19d3a9bcf477fc3d0e452691d91b7081ecf539a
4
+ data.tar.gz: '0682da605f0e9bc711e56a41928da97f5314730c41fcb904eff9a56712a7e35e'
5
+ SHA512:
6
+ metadata.gz: 00e56e1771ab078643422823140c935196c42b61a7bd4dbe3dc2e16ca180cec251f4a9b6396b4fccaeaca2d6aafe9e5712c384376ff543c6d64448ef0d7f52b2
7
+ data.tar.gz: d7423ecfe23ea4071055c8d0977c54d7d2380af943f240b86acf244448933591ecae1f70fb00ead0b694b0900088987f90711afd897297b63bfbe831f39150ff
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Louie Bloomberg
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # devcheck
2
+ A tool for checking development environments.
3
+
4
+ `devcheck` is a command-line tool that helps developers ensure their development environments
5
+ are configured correctly for the project they are working on. `devcheck` provides
6
+ an easy way to set up your development environment checking by just creating a `.devcheck.rb` file
7
+ and populating it with the required commands and files needed for the project to function properly.
8
+
9
+ ## Installation
10
+ `devcheck` can be installed by running the `gem install devcheck` command from your terminal.
11
+
12
+ Ruby is required to install and run `devcheck`. You will need Ruby version 3.0 or higher.
13
+ macOS Users will need to install a newer version of Ruby since the version Apple ships does not
14
+ meet the minimum Ruby version required by `devcheck`.
15
+
16
+ ## Usage
17
+ `devcheck` can be run by typing `devcheck` in your terminal. All you need is to have a
18
+ `.devcheck.rb` file in your project directory and the Ruby interpreter. This program only
19
+ checks for commands and files.
20
+
21
+ ### Example
22
+ ```bash
23
+ devcheck
24
+ ```
25
+ ```text
26
+ devcheck
27
+ Checking Development Environment
28
+
29
+ ✓ ruby
30
+ ✓ irb
31
+ ✓ git
32
+
33
+ ✓ LICENSE
34
+ ✓ README.md
35
+
36
+ All checks passed!
37
+ ```
38
+
39
+ ### Exit Codes
40
+ This program uses exit codes to help indicate the status of the program.
41
+ * `0`: All checks passed.
42
+ * `1`: One or more checks failed or the `.devcheck.rb` file is missing.
43
+
44
+ ## Configuration
45
+ As mentioned earlier, all you need is a `.devcheck.rb` file in your project directory. A sample
46
+ configuration file is shown and explained below.
47
+
48
+ ```ruby
49
+ command "ruby"
50
+ command "git"
51
+
52
+ file "README.md"
53
+ file "LICENSE"
54
+ ```
55
+ - `command "name"` refers to a specific command that might be run by the program or require you to have said command installed on your device.
56
+ - `file "path"` refers to a specific file that might be required by the program or need to be present in the project directory for it to function properly.
57
+
58
+ ## Contributing
59
+ We welcome contributions to the project and are so excited you have chosen to contribute!
60
+ To contribute, please follow these steps:
61
+
62
+ 1. Fork the repository.
63
+ 2. Create a new branch for your feature or bug fix.
64
+ 3. Make your changes and commit them with descriptive commit messages.
65
+ 4. Push your changes to your forked repository.
66
+ 5. Create a pull request to the main repository.
67
+
68
+ Please ensure that your code follows the existing style and conventions of the project.
69
+
70
+ ## License
71
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
data/devcheck ADDED
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # devcheck
4
+ # devcheck
5
+ # Copyright (c) 2026 Louie Bloomberg.
6
+ # SPDX-License-Identifier: MIT
7
+
8
+ # frozen_string_literal: true
9
+
10
+ # Define Global Variables
11
+ $failures = 0
12
+ $commands = []
13
+ $files = []
14
+
15
+ # Define Functions
16
+ def command(name)
17
+ $commands << name
18
+ end
19
+
20
+ def file(name)
21
+ $files << name
22
+ end
23
+
24
+
25
+ def command_exists?(cmd)
26
+ # On Windows, use 'where', on Unix-like systems use 'which'
27
+ checker = Gem.win_platform? ? 'where' : 'which'
28
+
29
+ # Suppress output and check exit status
30
+ system("#{checker} #{cmd} > /dev/null 2>&1")
31
+ if $?.success?
32
+ puts "✓ #{cmd}"
33
+ else
34
+ puts "✗ #{cmd}"
35
+ $failures += 1
36
+ end
37
+ end
38
+
39
+
40
+ def file_exists?(file)
41
+ if File.exist?(file)
42
+ puts "✓ #{file}"
43
+ else
44
+ puts "✗ #{file}"
45
+ $failures += 1
46
+ end
47
+ end
48
+
49
+ begin
50
+ load ".devcheck.rb"
51
+ rescue LoadError
52
+ puts "No .devcheck.rb file found"
53
+ exit 1
54
+ end
55
+
56
+ # Main Function
57
+
58
+ puts "devcheck"
59
+ puts "Checking Development Environment"
60
+ puts ""
61
+
62
+ if $commands.empty?
63
+ puts "No Commands Specified."
64
+ else
65
+ $commands.each do |cmd|
66
+ command_exists?(cmd)
67
+ end
68
+ end
69
+
70
+ puts ""
71
+
72
+ if $files.empty?
73
+ puts "No Files Specified."
74
+ else
75
+ $files.each do |file|
76
+ file_exists?(file)
77
+ end
78
+ end
79
+
80
+ puts ""
81
+
82
+ if $failures > 0
83
+ if $failures == 1
84
+ puts "#{$failures} check failed"
85
+ else
86
+ puts "#{$failures} checks failed"
87
+ end
88
+ exit 1
89
+ else
90
+ puts "All checks passed!"
91
+ exit 0
92
+ end
metadata ADDED
@@ -0,0 +1,41 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: devcheck
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
5
+ platform: ruby
6
+ authors:
7
+ - Louie Bloomberg
8
+ bindir: "."
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ executables:
13
+ - devcheck
14
+ extensions: []
15
+ extra_rdoc_files: []
16
+ files:
17
+ - "./devcheck"
18
+ - LICENSE
19
+ - README.md
20
+ homepage: https://github.com/Bloomy52/devcheck
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '3.0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubygems_version: 4.0.20
39
+ specification_version: 4
40
+ summary: Check a project's development environment
41
+ test_files: []