raykit 0.0.470 → 0.0.472

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58f2f51ae64b4e01957e95d9137b376277da475841970c05cfae502cc387e440
4
- data.tar.gz: 80117a88f447f0bde522922e54dcb6c8c08fff382ae7ffd1aee08027d3b224ea
3
+ metadata.gz: b8eae11fa047e9a2c4e8ffb8f4747188a12ff092e125ac29575353eeae0d7d8d
4
+ data.tar.gz: b3a52938228565f35c47db569462a7296ea95019a34dcd94fe6a05e671eb754a
5
5
  SHA512:
6
- metadata.gz: fcf031ab001b1e6a91e3f377af916b6af2f58d4d6066c8c9b78c9b0f5e710b5157031dedb00718f80dd23995b7a6dd008b364f97c2aa70cf7c727178da0c7973
7
- data.tar.gz: e9f14e573acc836ec6e08ae8dfb93ab7b9c8b556589dc83971dc66469cb58a483d050a0cd9049bd85cefc348258b236c071d82e29813f570bae5eff914cf8278
6
+ metadata.gz: 5fd18c68e0809c9f3073437433d962b58420eb061235a6b9e19c025e18831b03542f598f11fe684cb49cd71aad8189098312abd920ab75b28fd9ee774ef5a6e4
7
+ data.tar.gz: c64c91d04d0e1f5a680b1e1f28c030b00620fb56be89cdec2b68d0858480cf4be5e4c033535f19728cbf452e67e2d71b5d24f57ba5c9511c57e7a8524efc7bf6
@@ -5,8 +5,6 @@ require "yaml"
5
5
  require "logger"
6
6
  require "securerandom"
7
7
 
8
- BUFFER_SIZE = 1024 unless defined?(BUFFER_SIZE)
9
-
10
8
  module Raykit
11
9
  # Functionality to support executing and logging system commands
12
10
  class Command
@@ -235,18 +235,6 @@ module Raykit
235
235
  end
236
236
  end
237
237
 
238
- # def sync_version
239
- # if(@opts.arguments.length < 3)
240
- # puts 'source and destination arguments are required for sync_version'
241
- # return 1
242
- # end
243
- # source = @opts.arguments[1]
244
- # dest = @opts.arguments[2]
245
- # Raykit::Version::sync_file_versions(source,dest)
246
- # version = Raykit::Version::detect(source,false)
247
- # puts "version #{version} detected in #{source}, updating #{dest} to match."
248
- # end
249
-
250
238
  def copy
251
239
  if @opts.arguments.length < 3
252
240
  puts "source and destination arguments are required for copy"
@@ -282,5 +270,3 @@ module Raykit
282
270
  end
283
271
  end
284
272
  end
285
-
286
- # CONSOLE=Raykit::Console.new
@@ -181,6 +181,36 @@ module Raykit
181
181
  end
182
182
  end
183
183
  end
184
+
185
+ def get_unique_ruby_constants
186
+ # Define the regular expression pattern
187
+ pattern = /\b([A-Z][A-Z0-9_]*)\b\s*=/
188
+
189
+ constants = []
190
+
191
+ # Loop through each .rb file in the specified directory
192
+ Dir.glob("#{directory}/**/*.rb").each do |file|
193
+ # Read the contents of the file
194
+ content = File.read(file)
195
+
196
+ # Scan the content for constants and add the matches to the array.
197
+ content.scan(pattern) do |match|
198
+ # Add matched constant name to the constants array.
199
+ constants << match[0]
200
+ end
201
+ # Scan the content for constants and add the matches to the array
202
+ #constants.concat(content.scan(pattern))
203
+ end
204
+
205
+ # Return unique constants
206
+ constants.uniq
207
+ end
208
+ end
209
+
210
+ def setup
211
+ DEFAULT_SUBDIRECTORIES.each do |subdirectory|
212
+ FileUtils.mkdir_p(subdirectory)
213
+ end
184
214
  end
185
215
  end
186
216
  end
@@ -55,5 +55,3 @@ module Raykit
55
55
  end
56
56
  end
57
57
  end
58
-
59
- LOG = Raykit::Logging.new
@@ -19,5 +19,3 @@ module Raykit
19
19
  end
20
20
  end
21
21
  end
22
-
23
- MARKDOWN = Raykit::Markdown.new
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "rake/clean"
4
4
  require "digest"
5
- RAKE_DIRECTORY = Rake.application.original_dir
6
5
 
7
6
  module Raykit
8
7
  class Project
@@ -69,6 +68,10 @@ module Raykit
69
68
  end
70
69
  end
71
70
 
71
+ if description.length.zero?
72
+ @description = DESCRIPTION if defined?(DESCRIPTION)
73
+ end
74
+
72
75
  @repository = Raykit::Git::Repository.new(@remote)
73
76
  @values = Hash::new()
74
77
  @commands = Array::new()
@@ -139,21 +142,10 @@ module Raykit
139
142
  end
140
143
  end
141
144
 
142
- #def version
143
- # if @version.nil?
144
- # @version = Raykit::Version.detect(@name, @verbose)
145
- # end
146
- # @version
147
- #end
148
-
149
145
  def set_version(version)
150
146
  @version = version
151
147
  end
152
148
 
153
- # def update_version
154
- # @version=Raykit::Version.detect(@name,@verbose)
155
- # end
156
-
157
149
  def latest_tag
158
150
  `git describe --abbrev=0`.strip
159
151
  end
data/lib/raykit/tasks.rb CHANGED
@@ -97,3 +97,9 @@ end
97
97
 
98
98
  desc "update source files"
99
99
  task update: [:update_source]
100
+
101
+ if (RAYKIT_AUTO_DEFAULT_TASK)
102
+ task default: do
103
+ puts " completed in #{PROJECT.elapsed}"
104
+ end
105
+ end
data/lib/raykit.rb CHANGED
@@ -6,21 +6,36 @@ require "open3"
6
6
  require "rake/testtask"
7
7
  require "digest"
8
8
 
9
+ # Constants
10
+ BUFFER_SIZE = 1024 unless defined?(BUFFER_SIZE)
11
+ RAKE_DIRECTORY = Rake.application.original_dir unless defined?(RAKE_DIRECTORY)
12
+ DEFAULT_SUBDIRECTORIES = %w[src test examples] unless defined?(DEFAULT_SUBDIRECTORIES)
13
+ DEFAULT_FILES = %w[README.md LICENSE.md .gitignore] unless defined?(DEFAULT_FILES)
14
+ RAYKIT_GLOBALS = true unless defined?(RAYKIT_GLOBALS)
15
+ RAYKIT_AUTO_SETUP = false unless defined?(RAYKIT_AUTO_SETUP)
16
+ RAYKIT_AUTO_DEFAULT_TASK = false unless defined?(RAYKIT_AUTO_DEFAULT_TASK)
17
+
18
+ # Load all the files in the raykit directory
19
+
9
20
  lib_dir = File.dirname(__FILE__)
10
21
  Dir.glob("#{lib_dir}/raykit/**/*.rb").sort.each { |file| require file }
11
22
 
23
+ # Constants
12
24
  PROJECT = Raykit::Project.new
13
-
14
25
  SECRETS = Raykit::Secrets.new
15
-
16
26
  REPOSITORIES = Raykit::Git::Repositories.new("#{Raykit::Environment.get_dev_dir("log")}/Raykit.Git.Repositories.json")
17
27
  GIT_DIRECTORY = Raykit::Git::Directory.new(Rake.application.original_dir)
18
-
19
28
  NUGET_DIR = Raykit::Environment::get_dev_dir("nuget")
20
29
  PUBLISH_DIR = Raykit::Environment::get_dev_dir("publish")
21
30
 
31
+ LOG = Raykit::Logging.new
32
+ MARKDOWN = Raykit::Markdown.new
33
+
22
34
  Raykit::MsBuild::fix_msbuild_path
23
35
 
36
+ if RAYKIT_AUTO_SETUP
37
+ GIT_DIRECTORY.setup
38
+ end
24
39
  # include Raykit::TopLevel to make run method accessible from the global scope
25
40
  module Raykit
26
41
  module TopLevel
@@ -30,7 +45,6 @@ module Raykit
30
45
  end
31
46
  end
32
47
 
33
- RAYKIT_GLOBALS = true
34
48
  if defined?(RAYKIT_GLOBALS)
35
49
  def run(command, quit_on_failure = true)
36
50
  Raykit::TopLevel.run(command, quit_on_failure)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.470
4
+ version: 0.0.472
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-18 00:00:00.000000000 Z
11
+ date: 2023-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler