raykit 0.0.55 → 0.0.56

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: 1375ad7b4d44b72aa4da057247cbdcb60ee3f79cde59a1fd804f1513f9df095e
4
- data.tar.gz: a854c88e58549b6fd11ce3b26630fc167cdc5b780fa0bcf6121cbcd4334557fb
3
+ metadata.gz: 1ad44bb9e0cea6e1ad02902fee1d69ada81ef7ddf320a2169ab38a490018016c
4
+ data.tar.gz: eeae689d141ac25da1f808fc959b0dfbb9f570500a9044773499d735d01065eb
5
5
  SHA512:
6
- metadata.gz: 8ade19c54656a0fe0b6b44efd73d40516cb21203040b2eda9c4b779b0d2d1b1c0c9c2a3d2576188e27e97baa6a9e6ca15a0201a71d14c0d3f0f75266dd20c6b5
7
- data.tar.gz: d73425f37486af55cde080e9487928b7ed71c623d688fd7451f0e40451182b3d1386818d5caac55aa048470b083e34382f045ecdb13d34e0b2755d8f8ce41398
6
+ metadata.gz: 2079d88036900fffe729a79db8d91c6b863b8cb8898b38b1dbfbfc9aa0ea2ad00183183432c12bf8dec7409ac22a168f300cb3a5e9def3851d30978b1db6cd94
7
+ data.tar.gz: '076378a8b5a2ee9c742837cd79e8a2cbbe5d54b3df69a5c1be926e2919c17cf7a6d79fec741cd3ee405d70a5e1b854818a03752abb867b9955eca815c160f997'
data/lib/raykit.rb CHANGED
@@ -1,23 +1,10 @@
1
- #require_relative './raykit/timer.rb'
2
- #require_relative './raykit/gitlegacy.rb'
3
- #require_relative './raykit/git/commit.rb'
4
- #require_relative './raykit/dotnet.rb'
5
- #require_relative './raykit/version.rb'
6
- #require_relative './raykit/environment.rb'
7
- #require_relative './raykit/logging.rb'
8
- #require_relative './raykit/command.rb'
9
- #require_relative './raykit/rake.rb'
10
- #require_relative './raykit/console.rb'
11
- lib_root = File.dirname(File.absolute_path(__FILE__))
12
- puts "lib_root #{lib_root}"
13
- Dir.glob(lib_root + '/raykit/**/*.rb') {|file| require file}
14
-
15
1
  require 'rainbow'
16
2
  require 'rake/clean'
17
3
  require 'open3'
18
4
  require 'rake/testtask'
19
5
 
20
6
  RAKE_DIR=Rake.application.original_dir
7
+ Dir.glob(RAKE_DIR + '/lib/raykit/**/*.rb') {|file| require file}
21
8
  TIMER= Raykit::Timer.new
22
9
  LOG = Raykit::Logging.new
23
10
  REPOSITORIES = Raykit::Git::Repositories.new(Raykit::Environment::get_dev_dir('log') + "/Raykit.Git.Repositories.json")
@@ -26,10 +13,10 @@ if(Dir.exist?('.git'))
26
13
  GIT_DIRECTORY=Raykit::Git::Directory.new(RAKE_DIR)
27
14
  end
28
15
 
29
- module Raykit
30
- def Raykit.run(command)
16
+ PROJECT=Raykit::Project.new
31
17
 
32
- LOG.log('Raykit.run',Logger::Severity::DEBUG,"begin executing #{command}")
18
+ module Raykit
19
+ def Raykit.run(command,quit_on_failure=true)
33
20
  cmd = Command.new(command)
34
21
  elapsed_str = Timer.get_elapsed_str(cmd.elapsed,0)
35
22
  if(cmd.exitstatus == 0)
@@ -39,7 +26,9 @@ module Raykit
39
26
  puts "\r\n" + cmd.command + "\r\n"
40
27
  system(cmd.command)
41
28
  puts ''
42
- abort Rainbow(elapsed_str).red.bright + " " + Rainbow(cmd.command).white
29
+ if(quit_on_failure)
30
+ abort Rainbow(elapsed_str).red.bright + " " + Rainbow(cmd.command).white
31
+ end
43
32
  end
44
33
  end
45
34
  end
@@ -36,7 +36,6 @@ module Raykit
36
36
  end
37
37
 
38
38
  def run()
39
- #buffer_size=1024
40
39
  @start_time = Time.now
41
40
  timer = Timer.new
42
41
  if(@timeout == 0)
@@ -12,7 +12,6 @@ module Raykit
12
12
  def outstanding_commit?
13
13
  Dir.chdir(directory) do
14
14
  if(user_can_commit)
15
- #puts `git status`
16
15
  return !`git status`.include?('nothing to commit,')
17
16
  else
18
17
  return false
@@ -20,6 +19,12 @@ module Raykit
20
19
  end
21
20
  end
22
21
 
22
+ def pull
23
+ Dir.chdir(directory) do
24
+ Raykit::run('git pull')
25
+ end
26
+ end
27
+
23
28
  def rake(task)
24
29
  Dir.chdir(directory) do
25
30
  if(File.exist?('rakefile.rb'))
@@ -4,9 +4,13 @@ module Raykit
4
4
  class Repository
5
5
  # The url of the remote repository
6
6
  attr_accessor :url
7
+ attr_accessor :clone_directory
8
+ attr_accessor :work_directory
7
9
 
8
10
  def initialize(url)
9
11
  @url=url
12
+ @clone_directory = Raykit::Git::Directory.new(get_dev_dir('clone'))
13
+ @work_directory = Raykit::Git::Directory.new(get_dev_dir('work'))
10
14
  end
11
15
 
12
16
  def to_json
@@ -65,7 +69,6 @@ module Raykit
65
69
 
66
70
  # The latest tag for a branch of the repository
67
71
  def latest_tag(branch)
68
- # git describe --abbrev=0
69
72
  if(checkout_local_clone_directory_branch(branch))
70
73
  return `git describe --abbrev=0`.strip
71
74
  end
@@ -0,0 +1,63 @@
1
+ require 'rake/clean'
2
+ RAKE_DIRECTORY=Rake.application.original_dir
3
+
4
+ module Raykit
5
+ class Project
6
+ attr_accessor :name
7
+ @directory
8
+ @version
9
+
10
+ def initialize()
11
+ @name=NAME if(defined?(NAME))
12
+ @directory=RAKE_DIRECTORY
13
+ @version=Raykit::Version.detect
14
+ end
15
+
16
+ def directory
17
+ @directory
18
+ end
19
+
20
+ def version
21
+ @version
22
+ end
23
+
24
+ def commit
25
+ Dir.chdir(@directory) do
26
+ if(File.exist?('.gitignore'))
27
+ Raykit::run("git add --all")
28
+ if(GIT_DIRECTORY.outstanding_commit?)
29
+ Raykit::run("git commit -m'update'")
30
+ Raykit::run("git push")
31
+ end
32
+ else
33
+ puts "warning: .gitignore not found."
34
+ end
35
+ end
36
+ end
37
+
38
+ def push
39
+ Dir.chdir(@directory) do
40
+ Raykit::run('git push')
41
+ Raykit::run('git push --tags')
42
+ end
43
+ end
44
+
45
+ def pull
46
+ Dir.chdir(@directory) do
47
+ Raykit::run('git pull')
48
+ end
49
+ end
50
+
51
+ def tag
52
+ Dir.chdir(@directory) do
53
+ tag = `git describe --abbrev=0 --tags`.strip
54
+ if(@version != tag)
55
+ Raykit::run('git add --all')
56
+ Raykit::run("git tag #{VERSION} -m'#{VERSION}'")
57
+ Raykit::run('git push')
58
+ Raykit::run("git push --tags")
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.55
4
+ version: 0.0.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
@@ -73,6 +73,7 @@ files:
73
73
  - lib/raykit/git/repository.rb
74
74
  - lib/raykit/gitlegacy.rb
75
75
  - lib/raykit/logging.rb
76
+ - lib/raykit/project.rb
76
77
  - lib/raykit/rake.rb
77
78
  - lib/raykit/timer.rb
78
79
  - lib/raykit/version.rb