raykit 0.0.133 → 0.0.134

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: 13737148d0a3cc8fd632d9568447c182d496a315972d2960269c9c5030180998
4
- data.tar.gz: 7c15b9a25f7cdf2e1a406215921fd92a233c4bbade62e8f5890b4138a8e8d180
3
+ metadata.gz: 4d3401449c8a9b31362ec7f88ee166b5cf3a60653af68d940d355704c85ffe36
4
+ data.tar.gz: 6f58c91c9fa624675db0ec62cdaf02411968094b366479d9624cd3a8917eb351
5
5
  SHA512:
6
- metadata.gz: 671eea11ea493b1bd65044515d473d249b157c6f53da672aa54aea3741fb8a6106dc0bbf108d47727c464482aea2ad66a4e6df3bf98f43fbbf10cc92cc2c7e43
7
- data.tar.gz: fba5578258008cadcf86e5b94930879dc0671eafe8637ec0473ebc522034b30bd82a9a2fa153c950b3cc663b6ad60f9fe4946176c30302c6fbfb112c5fbdca14
6
+ metadata.gz: 1672afb00d6c46861e9f0ecdf029c404a73cad309ed30632bce5bb4ca07c91b224fbdb5949c2084b04997f4f461c83c7f034848bd6b607bb488535643f724f26
7
+ data.tar.gz: 835a82c9d80854dff9394fc1f34e53ea2971e138a317c366bbc870aa36526d876ccfd9faa8b55d36123d64773a2ca28045ac0f2e7e263ba34038bb03c4795637
@@ -9,7 +9,7 @@ BUFFER_SIZE=1024 if(!defined?(BUFFER_SIZE))
9
9
  module Raykit
10
10
  # Functionality to support executing and logging system commands
11
11
  class Command
12
- @@commands
12
+ @@commands=Array.new
13
13
  # The timeout in seconds, defaults to 0 if not specified
14
14
  attr_accessor :timeout
15
15
  # The working directory, defaults the current directory if not specified
@@ -81,7 +81,7 @@ module Raykit
81
81
  @elapsed = timer.elapsed
82
82
  log_filename = Environment.get_dev_dir('log') + '/Raykit.Command/' + SecureRandom.uuid + '.json'
83
83
  log_dir = File.dirname(log_filename)
84
- FileUtils.mkdir_p(log_dir) if(!Dir.exists?(log_dir))
84
+ FileUtils.mkdir_p(log_dir) if(!Dir.exist?(log_dir))
85
85
  File.open(log_filename, 'w') {|f| f.write(JSON.generate(to_hash)) }
86
86
  if(@exitstatus == 0)
87
87
  LOG.log('Raykit.Command',Logger::Severity::INFO,JSON.generate(to_hash))
@@ -101,7 +101,7 @@ module Raykit
101
101
 
102
102
  def summary
103
103
  checkmark="\u2713"
104
- warning="\u26A0"
104
+ #warning="\u26A0"
105
105
  error="\u0058"
106
106
  symbol=Rainbow(checkmark.encode('utf-8')).green
107
107
  symbol=Rainbow(error.encode('utf-8')).red if(@exitstatus!=0)
@@ -144,7 +144,7 @@ module Raykit
144
144
  end
145
145
 
146
146
  def self.parse_yaml_commands(yaml)
147
- commands=Array.new()
147
+ #commands=Array.new()
148
148
  data = YAML.load(yaml)
149
149
  commands = get_script_commands(data)
150
150
  end
@@ -121,6 +121,7 @@ module Raykit
121
121
  }
122
122
  end
123
123
  end
124
+ 0
124
125
  end
125
126
 
126
127
  def list(hash)
@@ -73,6 +73,14 @@ module Raykit
73
73
  @version
74
74
  end
75
75
 
76
+ def latest_tag
77
+ `git describe --abbrev=0`.strip
78
+ end
79
+
80
+ def latest_tag_commit
81
+ `git show-ref -s #{latest_tag}`.strip
82
+ end
83
+
76
84
  def remote
77
85
  @remote
78
86
  end
@@ -121,6 +129,8 @@ module Raykit
121
129
  puts "PROJECT.version".ljust(ljust) + Rainbow(PROJECT.version).yellow.bright
122
130
  puts "PROJECT.remote".ljust(ljust) + Rainbow(PROJECT.remote).yellow.bright
123
131
  puts "PROJECT.branch".ljust(ljust) + Rainbow(PROJECT.branch).yellow.bright
132
+ puts "PROJECT.latest_tag".ljust(ljust) + Rainbow(PROJECT.latest_tag).yellow.bright
133
+ puts "PROJECT.latest_tag_commit".ljust(ljust) + Rainbow(PROJECT.latest_tag_commit).yellow.bright
124
134
  puts "PROJECT.latest_commit".ljust(ljust) + Rainbow(PROJECT.latest_commit).yellow.bright
125
135
  puts "PROJECT.last_modified_filename".ljust(ljust) + Rainbow(PROJECT.last_modified_filename).yellow.bright
126
136
  #puts "PROJECT.elapsed".ljust(ljust) + Rainbow(PROJECT.elapsed).yellow.bright
@@ -32,7 +32,7 @@ module Raykit
32
32
  def self.get_build_yaml(directory)
33
33
  yaml=''
34
34
  Dir.chdir(directory) do
35
- if(File.exists?('.gitlab-ci.yml'))
35
+ if(File.exist?('.gitlab-ci.yml'))
36
36
  yaml = File.open('.gitlab-ci.yml').read
37
37
  end
38
38
  end
@@ -14,6 +14,9 @@ module Raykit
14
14
  version=detect_from_file("#{name}.gemspec",/version[\s]+=[\s]+['"]([\w.]+)['"]/,verbose)
15
15
  return version if(version.length>0)
16
16
 
17
+ version=detect_from_file("#{name}.gemspec",/version\s?=\s?['|"]([.\d]+)['|"]/,verbose)
18
+ return version if(version.length>0)
19
+
17
20
  version=detect_from_file("#{name}.nuspec",/<[Vv]ersion>([\d.]+)</,verbose)
18
21
  return version if(version.length>0)
19
22
 
@@ -48,6 +51,8 @@ module Raykit
48
51
  def self.set_version_in_file(filename,version)
49
52
  text=IO.read(filename)
50
53
  new_text=text.gsub(/<Version>([-\w\d.]+)</,"<Version>#{version}<")
54
+ new_text=new_text.gsub(/version[\s]+=\s?['|"]([.\d]+)['|"]/,"version='#{version}'")
55
+
51
56
  File.open(filename,'w'){|f|f.write(new_text)} if(new_text!=text)
52
57
  end
53
58
 
@@ -55,5 +60,14 @@ module Raykit
55
60
  version = Version.detect_from_file(source_filename,/<Version>([-\w\d.]+)</,false)
56
61
  Version.set_version_in_file(destination_filename,version)
57
62
  end
63
+
64
+ # increment to last digit of a version string
65
+ def self.bump(version)
66
+ # major.minor[.build[.revision]] (example: 1.2.12.102)
67
+
68
+ version_ints = version.split('.').map{|s| s.to_i}
69
+ version_ints[-1] = version_ints.last + 1;
70
+ version_ints.map{|i| i.to_s}.join('.')
71
+ end
58
72
  end
59
73
  end
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.133
4
+ version: 0.0.134
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-30 00:00:00.000000000 Z
11
+ date: 2020-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler