devcheck 0.3.3 → 0.4.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +62 -19
  3. data/devcheck +29 -8
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4557f8583d166864d19e37c1c297a2fc62b98ba311e6201f8c9d1c08fe599523
4
- data.tar.gz: c99270276bf19211e96fb0d24bae594d15b8c1b44de17993ea388f18538c18fc
3
+ metadata.gz: 6bef7ce735761025409136355663c512525e7154568c3ba615077b4651ee26f3
4
+ data.tar.gz: 63d8b5e9f9a21afab03591f587d0b8ffce7424ab9b2bec97ff5c70ae8613320d
5
5
  SHA512:
6
- metadata.gz: 4ea1d4b518510ebf88e39fd2fdacef55ee28e6f8df8881402bc072f331a3094b19ae603775de902d1bca9960cf3fb355f7c60ac2d87dfac8cbd6b46ee1b10878
7
- data.tar.gz: d30704fd11ba862151c0211747994903ea38372c30fc229859794f16f230d3ea0906edb84135841084814b0fccadf881ff677250fa702b79e2d0e5d5f4f96a17
6
+ metadata.gz: 7cd876c558e7a6d722c70819509a8702445bd0c93cdf4356a71dba3f39eb6e073a65966cceeaa6dc6d8060fb7ee8995023930c75f01ed474b5cd69e2a7753803
7
+ data.tar.gz: 6d38140df5cd7d725e6be76337c1fe1a60201bd7ae143c94bbb4cccc8719e587c9d200b7d0cccee667921484b2143f85e2c92f594ce55b01ae500e0729ca211d
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # devcheck
2
2
  A tool for checking development environments.
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/devcheck.svg)](https://rubygems.org/gems/devcheck)
5
+ [![GitHub Release](https://img.shields.io/github/v/release/Bloomy52/devcheck)](https://github.com/Bloomy52/devcheck/releases/latest)
6
+
7
+
4
8
  `devcheck` is a command-line tool that helps developers ensure their development environments
5
9
  are configured correctly for the project they are working on. `devcheck` provides
6
10
  an easy way to set up your development environment checking by just creating a `.devcheck.rb` file
@@ -17,17 +21,37 @@ Ruby is required to install and run `devcheck`. You will need Ruby version 3.0 o
17
21
  macOS Users will need to install a newer version of Ruby since the version Apple ships does not
18
22
  meet the minimum Ruby version required by `devcheck`.
19
23
 
24
+ ## Configuration
25
+ Before you can use `devcheck`, you need to create a `.devcheck.rb` file. A sample `.devcheck.rb`
26
+ is below along with other useful information.
27
+
28
+ ```ruby
29
+ name "devcheck" # Project Name
30
+ id "devcheck" # Project ID
31
+
32
+ command "ruby" # A command needed
33
+ command "git" # Another command needed
34
+
35
+ file "README.md" # A file needed
36
+ file "LICENSE" # Another file needed
37
+ ```
38
+ - `name "name"` refers to the project's display-name/whatever the project is called.
39
+ - `id "name"` refers to the project's stable machine/repository-style identifier
40
+ - `command "name"` refers to a specific command that is required to be in your system's PATH variable.
41
+ - `file "path"` refers to a specific file that is required by the program in the project directory for it to function properly.
42
+
43
+
20
44
  ## Usage
21
45
  `devcheck` can be run by typing `devcheck` in your terminal. All you need is to have a
22
- `.devcheck.rb` file in your project directory and the Ruby interpreter. This program only
23
- checks for commands and files.
46
+ `.devcheck.rb` file in your project directory and the Ruby interpreter. You can find the
47
+ configuration information above. This program only checks for commands and files.
24
48
 
25
49
  ### Example
26
50
  ```bash
27
51
  devcheck
28
52
  ```
29
53
  ```text
30
- devcheck v0.3.2
54
+ devcheck v0.4.1
31
55
  Project Name: Go Choose Your License
32
56
  Project ID: go-choose-license
33
57
 
@@ -47,29 +71,48 @@ All checks passed!
47
71
  ```
48
72
  And there are even colors too! Green if you pass a check and red if a check is failed.
49
73
 
74
+ ### Environments
75
+ Starting with `devcheck` version `0.4.0`, you can now add environments to check
76
+ separate development environments. Check out an example of a `.devcheck.rb` file
77
+ ```ruby
78
+ name "IsUnicodeText?"
79
+ id "isunicodetext"
80
+
81
+ environment "vb" do
82
+ command "msbuild"
83
+ file "IsUnicodeText.slnx"
84
+ file "IsUnicodeText\\IsUnicodeText.vbproj"
85
+ file "IsUnicodeText\\Form1.vb"
86
+ file "IsUnicodeText\\Form1.Designer.vb"
87
+ file "IsUnicodeText\\App.config"
88
+ end
89
+
90
+ environment "c" do
91
+ command "cl"
92
+ file "test_unicode.c"
93
+ end
94
+
95
+ command "git"
96
+ ```
97
+ And when you want to call the `vb` environment, all you need to do type `devcheck vb` and you get
98
+ the checks for what is in the `vb` environment along with what is in the shared portion.
99
+
50
100
  ### Exit Codes
51
101
  This program uses exit codes to help indicate the status of the program.
52
102
  * `0`: All checks passed.
53
- * `1`: One or more checks failed or the `.devcheck.rb` file is missing.
103
+ * `1`: One or more checks failed.
104
+ * `2`: The `.devcheck.rb` file is missing.
54
105
 
55
- ## Configuration
56
- As mentioned earlier, all you need is a `.devcheck.rb` file in your project directory. A sample
57
- configuration file is shown and explained below.
106
+ ## Releases
58
107
 
59
- ```ruby
60
- name "devcheck" # Project Name
61
- id "devcheck" # Project ID
108
+ `devcheck` is distributed through [RubyGems](https://rubygems.org/gems/devcheck).
62
109
 
63
- command "ruby" # A command needed
64
- command "git" # Another command needed
110
+ For information about the latest release, previous versions, and
111
+ changes between releases, visit the
112
+ [GitHub Releases](https://github.com/Bloomy52/devcheck/releases) page.
65
113
 
66
- file "README.md" # A file needed
67
- file "LICENSE" # Another file needed
68
- ```
69
- - `name "name"` refers to the project's display-name/whatever the project is called.
70
- - `id "name"` refers to the project's stable machine/repository-style identifier
71
- - `command "name"` refers to a specific command that is required to be in your system's PATH variable.
72
- - `file "path"` refers to a specific file that is required by the program in the project directory for it to function properly.
114
+ Releases are automatically published to RubyGems, with corresponding
115
+ GitHub Releases providing version history and changelogs.
73
116
 
74
117
  ## Contributing
75
118
  We welcome contributions to the project and are so excited you have chosen to contribute!
data/devcheck CHANGED
@@ -13,9 +13,26 @@ $commands = []
13
13
  $files = []
14
14
  $project_name = ""
15
15
  $project_id = ""
16
+ $environment = ""
17
+ $argument = ""
16
18
 
17
19
  require 'rubygems'
18
20
  # Define Functions
21
+
22
+ def get_argv
23
+ if ARGV.empty?
24
+ $argument = ""
25
+ else
26
+ $argument = ARGV[0]
27
+ end
28
+ end
29
+
30
+ def environment(environment = "")
31
+ $environment = environment
32
+ yield
33
+ $environment = ""
34
+ end
35
+
19
36
  def name(name = "devcheck")
20
37
  $project_name = name
21
38
  end
@@ -24,11 +41,11 @@ def id(id = "devcheck")
24
41
  end
25
42
 
26
43
  def command(name)
27
- $commands << name
44
+ $commands << [name, $environment]
28
45
  end
29
46
 
30
47
  def file(name)
31
- $files << name
48
+ $files << [name, $environment]
32
49
  end
33
50
 
34
51
  def get_version
@@ -54,7 +71,6 @@ def command_exists?(cmd)
54
71
  end
55
72
  end
56
73
 
57
-
58
74
  def file_exists?(file)
59
75
  if File.exist?(file)
60
76
  puts "\e[32m✓ #{file}\e[0m"
@@ -68,12 +84,13 @@ begin
68
84
  load ".devcheck.rb"
69
85
  rescue LoadError
70
86
  puts "No .devcheck.rb file found"
71
- exit 1
87
+ exit 2
72
88
  end
73
89
 
74
90
 
75
91
 
76
92
  # Main Function
93
+ get_argv
77
94
  version = get_version
78
95
 
79
96
  puts "devcheck v#{version}"
@@ -87,8 +104,10 @@ if $commands.empty?
87
104
  puts "No Commands Specified."
88
105
  else
89
106
  puts "Commands:"
90
- $commands.each do |cmd|
91
- command_exists?(cmd)
107
+ $commands.each do |cmd, env|
108
+ if env == $argument or env == "" or $argument == ""
109
+ command_exists?(cmd)
110
+ end
92
111
  end
93
112
  end
94
113
 
@@ -98,8 +117,10 @@ if $files.empty?
98
117
  puts "No Files Specified."
99
118
  else
100
119
  puts "Files:"
101
- $files.each do |file|
102
- file_exists?(file)
120
+ $files.each do |file, env|
121
+ if env == $argument or env == "" or $argument == ""
122
+ file_exists?(file)
123
+ end
103
124
  end
104
125
  end
105
126
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louie Bloomberg