devcheck 0.3.2 → 0.4.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -1
  3. data/devcheck +30 -9
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3daae8958d13219d8b43bdf0df0e95710dd060dea2ca401f20986580cd814c3
4
- data.tar.gz: dae60285594a15ee530d54c19875b82f80db8dfbfb1acef1fc03c71bb137429b
3
+ metadata.gz: e5261525f11e3d3219943815605bdd5ef4e8c51e56317668b0f88cfdea066c2b
4
+ data.tar.gz: a12aec97e39efaf2ae385717bf0dd5ba4ae0fbd342893bd5f7f08562654f8019
5
5
  SHA512:
6
- metadata.gz: 1c6594c2f9eec27279de837c644f3836a29e9bd1a6578f2b9518b6d6595005800f287196de3ba488b78852c9fd96e6cf4c2943c25763220f0ad4a07cafc7613e
7
- data.tar.gz: f16d78e1eb675ae313624b6261768da2fa1bbf518e6f24d31f28bedad19759dfac4cd39ab5084abc935f05d9900c07c6195fec411e4083352467f4b2c771edf6
6
+ metadata.gz: f6bed7325b21fd46b56ffc89192dfc4e0c739dd81446d5a9608e770dcf84deda6b12d8d0d74df27576d4a25409cc39e4dae48933253dd2677f6a1c73a6c1b106
7
+ data.tar.gz: a759c287ccc0543eacb5b95bfd1b8de65b9da999b01b75265c27e2c1cd7b0c39414b0dc5099e538418f36c91d847d94c608a04bfe0d796f5de24c5f253df5a18
data/README.md CHANGED
@@ -6,6 +6,10 @@ are configured correctly for the project they are working on. `devcheck` provide
6
6
  an easy way to set up your development environment checking by just creating a `.devcheck.rb` file
7
7
  and populating it with the required commands and files needed for the project to function properly.
8
8
 
9
+ What makes `devcheck` unique is its ability to be flexible. Unlike compiled development environment
10
+ checkers, `devcheck` allows you to customize what commands and files to check for. You can also
11
+ personalize your project's name and ID to show up when running `devcheck`.
12
+
9
13
  ## Installation
10
14
  `devcheck` can be installed by running the `gem install devcheck` command from your terminal.
11
15
 
@@ -23,15 +27,17 @@ checks for commands and files.
23
27
  devcheck
24
28
  ```
25
29
  ```text
26
- devcheck v0.3.1
30
+ devcheck v0.3.3
27
31
  Project Name: Go Choose Your License
28
32
  Project ID: go-choose-license
29
33
 
30
34
  Checking Development Environment
31
35
 
36
+ Commands:
32
37
  ✓ go
33
38
  ✓ git
34
39
 
40
+ Files:
35
41
  ✓ LICENSE
36
42
  ✓ README.md
37
43
  ✓ go.mod
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
@@ -45,8 +62,8 @@ def command_exists?(cmd)
45
62
  checker = Gem.win_platform? ? 'where' : 'which'
46
63
 
47
64
  # Suppress output and check exit status
48
- system("#{checker} #{cmd} > /dev/null 2>&1")
49
- if $?.success?
65
+ #system("#{checker} #{cmd} > /dev/null 2>&1")
66
+ if system(checker, cmd, out: File::NULL, err: File::NULL )
50
67
  puts "\e[32m✓ #{cmd}\e[0m"
51
68
  else
52
69
  puts "\e[31m✗ #{cmd}\e[0m"
@@ -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"
@@ -74,6 +90,7 @@ end
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.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louie Bloomberg