justprep 1.0.0 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed914c21c366068ea71cd655d4244ab64d09c23d84aa96c3e5ffee1da293c1ff
4
- data.tar.gz: d511e8cc0a4f1b39a0a9a6154d3a2ce17f9953d5c7040f5216302cbb9de763b9
3
+ metadata.gz: d4729fa9db5b45ee64efff9c7f0aaddbeddf6d654cfe031d1a7039a13c8deca0
4
+ data.tar.gz: a2806b5e251bf062763aec4b5c1806919051a3251e42d7c03f61a557f53b9465
5
5
  SHA512:
6
- metadata.gz: 7b896b41fb0b38201332c7d37440383f6d2bffa4e6e3890c49dd8103a0c183dc537ee32ede80ffb655fa49627eeb6d76aa94e07e67cb5b2e70e05e913419636f
7
- data.tar.gz: e1c08ac5bf2b996810cc56eaaf498e7c37de2332891633a274a4959d0cb48854d09c2fcca6f7a3f7972ec0d8e17cceb856c29e62f22f32a1f4acad0b13849218
6
+ metadata.gz: b27ccd199ac3f53759e0c07e039c3d5d3d4212166c5f4d6cec0fde22fb4f0281746ca7a61b690cb882280e4bdb0e45f7aee446a3696aadc40db20b9617a1117a
7
+ data.tar.gz: 436b0657a5d2a66d1db74cdfb953f7a83f2b69889653bb0ad0204365a79117f8adcf086aabc7f256123adefcac8861db339362de7d46c4d4e271974e507a799f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- justprep (1.0.0)
4
+ justprep (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -20,4 +20,4 @@ DEPENDENCIES
20
20
  rake (~> 13.0)
21
21
 
22
22
  BUNDLED WITH
23
- 2.2.21
23
+ 2.2.24
data/justfile CHANGED
@@ -5,7 +5,7 @@
5
5
  set positional-arguments := true
6
6
 
7
7
  # List available recipes
8
- @list:
8
+ @help:
9
9
  echo
10
10
  echo "Available Recipes at"
11
11
  echo `pwd`
@@ -16,10 +16,15 @@ set positional-arguments := true
16
16
 
17
17
 
18
18
  # Build the current gem
19
- build:
19
+ @build:
20
20
  rake clean clobber build
21
21
 
22
22
 
23
+ # Install the gem locally
24
+ @install:
25
+ rake install:local
26
+
27
+
23
28
  #################################################
24
29
  ## Recipes that deal with the source code version
25
30
  ## Version manager is handled by the "bump" gem
data/lib/justprep.rb CHANGED
@@ -30,7 +30,7 @@ module Justprep
30
30
  modules = []
31
31
 
32
32
  JUSTPREP_KEYWORDS.each do |keyword|
33
- modules << text.select{|x| x.start_with? "#{keyword} "}
33
+ modules << text.select{|x| x.start_with?("#{keyword} ") || x.strip == keyword}
34
34
  end
35
35
 
36
36
  return modules.flatten!
@@ -129,7 +129,10 @@ module Justprep
129
129
 
130
130
  mainfile = just_find_it
131
131
 
132
- exit(0) if mainfile.nil?
132
+ if mainfile.nil?
133
+ STDERR.puts "WARNING: JUSTPREP_FILENAME_IN Not Found: #{JUSTPREP_FILENAME_IN}"
134
+ exit(0)
135
+ end
133
136
 
134
137
  basefile = mainfile.parent + JUSTPREP_FILENAME_OUT
135
138
 
@@ -145,12 +148,21 @@ module Justprep
145
148
  modules.each do |a_line|
146
149
  an_index = text.index a_line
147
150
  begin_filename = a_line.index(' ')
148
- module_filename = a_line[begin_filename, a_line.size - begin_filename].strip
151
+
152
+ if begin_filename.nil?
153
+ module_filename = ""
154
+ else
155
+ module_filename = a_line[begin_filename, a_line.size - begin_filename].chomp.strip
156
+ end
149
157
 
150
158
  if module_filename.empty?
151
- STDERR.puts "#{an_index}: #{a_line}"
152
159
  STDERR.puts "ERROR: No path/to/file was provided"
153
- next
160
+ line_out = sprintf('% d ', an_index+1)
161
+ STDERR.puts (" "*line_out.size)+"|"
162
+ STDERR.puts "#{line_out}| #{a_line}"
163
+ STDERR.print (" "*line_out.size)+"|"
164
+ STDERR.puts (" "*(a_line.size+2)) + "^"
165
+ exit(1)
154
166
  end
155
167
 
156
168
  if module_filename.include?('~') || module_filename.include?('$')
@@ -166,10 +178,15 @@ module Justprep
166
178
  if module_path.exist?
167
179
  text[an_index] = include_content_from(module_path)
168
180
  else
169
- STDERR.puts "#{an_index}: #{a_line}"
170
- STDERR.puts "| ERROR: File Does Not Exist - #{module_path}"
181
+ STDERR.puts "ERROR: File Does Not Exist - #{module_path}"
182
+ line_out = sprintf('% d ', an_index+1)
183
+ STDERR.puts (" "*line_out.size)+"|"
184
+ STDERR.puts "#{line_out}| #{a_line}"
185
+ STDERR.print (" "*line_out.size)+"|"
186
+ STDERR.puts (" "*(a_line.index(module_filename)+1)) + "^"
187
+ exit(1)
171
188
  end
172
- end
189
+ end # modules.each do |a_line|
173
190
 
174
191
  basefile.write text.flatten!.join "\n"
175
192
  end # def execute
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Justprep
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justprep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-10 00:00:00.000000000 Z
11
+ date: 2021-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bump
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 3.2.21
75
+ rubygems_version: 3.2.24
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: A pre-processor for the 'just' command line utility