raykit 0.0.270 → 0.0.275

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: 1a4c65a71476a373d00dbe0f09d3979745f7816eddee9cb63c70580de41415d2
4
- data.tar.gz: 3813539267dab3fe18d39a437d629b550ac98652f61fd1bdc697055d539576f7
3
+ metadata.gz: 3034c0d7385e8dde9f24672efe09f90c8e9af110741bb513e67643ffab343e97
4
+ data.tar.gz: e20a66f85182dec2acb57ba7104bc0b86ce1a0311b84e0898d55f2aa2cfd26ab
5
5
  SHA512:
6
- metadata.gz: 47184a7ddadcf5ffb19b9e78ebbb404b01fb9bd865f91a21906be2fec018ba82e44dfeb0254419f48e89cf7dc5f936087ce022c819285b2e238624aa6ff55ee0
7
- data.tar.gz: 8bb6dd924aa8cb25eebf970ca03ca2e1c920b45c409a970239410c24398141a647aeb206c31a5e433a379977ab4b9cbdc8c8ac0cd912c9bf2a3ebc78c25c06b0
6
+ metadata.gz: 14473176fd5d33ad0a7f8fffebe237bba5b668491371c9213542031c51c356becbcc82908431bb6597b57a08f9fdac4c5840d7d5f30cc9afb3d6dbd7d76a505b
7
+ data.tar.gz: 99852e07a296e65b7a0c982dc423cb65571b586eb6267a6841a07fa644b41c687883204892ffcf8bfaca9a8b6004f8c539aa959e9814af059165c5e59ff57418
data/lib/raykit/tasks.rb CHANGED
@@ -9,7 +9,9 @@ task :integrate do
9
9
  puts Rainbow(':integrate').blue.bright
10
10
 
11
11
  git_dir=Raykit::Git::Directory.new(Rake.application.original_dir)
12
- if(!git_dir.detached?)
12
+ if(git_dir.detached?)
13
+ puts "detached head state, skipping integrate operations"
14
+ else
13
15
  if(PROJECT.outstanding_commit?)
14
16
  if(Rake::Task.task_defined?("test"))
15
17
  Rake::Task["test"].invoke
@@ -0,0 +1,30 @@
1
+ module Raykit
2
+ class Text
3
+ def self.replace_in_glob(glob,search,replace)
4
+ Dir.glob(glob).each{ |f| replace_in_file(f,search,replace) }
5
+ end
6
+
7
+ def self.replace_in_file(filename,search,replace)
8
+ text1 = IO.read(filename)
9
+ text2 = text1.gsub(search) { |str| str=replace }
10
+ unless text1==text2
11
+ File.open(filename,"w") { |f| f.puts text2 }
12
+ return true
13
+ end
14
+ false
15
+ end
16
+
17
+ def self.copy_if_different(source,destination)
18
+ if(!File.exists?(destination))
19
+ FileUtils.cp source, destination
20
+ else
21
+ source_text=IO.read(source)
22
+ destination_text=IO.read(destination)
23
+ if(source_text != destination_text)
24
+ FileUtils.rm destination
25
+ FileUtils.cp source, destination
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -7,7 +7,7 @@ module Raykit
7
7
 
8
8
  # detect a version number based on the NAME variable, if defined
9
9
  def self.detect(name,verbose=false)
10
- version=detect_from_file("#{name}/#{name}.csproj",/<Version>([-\w\d.]+)</,verbose)
10
+ version=detect_from_file("#{name}/#{name}.csproj",/<Version>([-\w\d\.]+)</,verbose)
11
11
  return version if(version.length>0)
12
12
 
13
13
  version=detect_from_file("#{name}/Properties/AssemblyInfo.cs",/^\[assembly: AssemblyVersion\(\"([.\w]+)/,verbose)
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.270
4
+ version: 0.0.275
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2021-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,6 +99,7 @@ files:
99
99
  - lib/raykit/sourceImports.rb
100
100
  - lib/raykit/string.rb
101
101
  - lib/raykit/tasks.rb
102
+ - lib/raykit/text.rb
102
103
  - lib/raykit/timer.rb
103
104
  - lib/raykit/version.rb
104
105
  - lib/raykit/zip.rb