raykit 0.0.421 → 0.0.423

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/raykit/git/repository.rb +18 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08950e670073b00324fc3b72e3ad590596f5a0d6464e9c08ae3443cb86c5fdbd'
4
- data.tar.gz: f8e3cd51b4781af195e7b0da3ce956f058f1274c6c6e37c78ad68c4edd959fbd
3
+ metadata.gz: 394d7bbbf2a0d9f4f042835f8c645e2a0b7781b4392311352949f509cc9926dd
4
+ data.tar.gz: d948856e3b9b7823485cb516d5b8e9d523552ff426e0e7ecef153846221ceb23
5
5
  SHA512:
6
- metadata.gz: b524750ccec43008b4a3a4871fcfbc5157295c3a0a82a496efdd36fcccada919e98cf7cd575151a5cd92befda1d354d63cbb0a63aae1c5f55db5675d20758614
7
- data.tar.gz: 89fa69af1d61a7698e519b56fb241ef4e6e3fcf74c594a209bbfadddd825691879c40aff1b73ff9c3860133f9addca2ebaf72a9a06ecfd9ed870ab9d67d7f15d
6
+ metadata.gz: 8327e27f45dd93fc44b421a0a3704a23874847cbc0db3138ac522ef0f21c3546d3b9941d602b19d2d97449f00e2f152c8af1c05a57d635732c718e5b5a2b5cae
7
+ data.tar.gz: 74c6f02b5f8ab3999636c7ae6217cf9adf87038dae279812de2faeb0a6a3bcf423ea7dc0ec2f84065151546a1eaba43e70727c17f1159f042397c7d4a4909c84
@@ -46,6 +46,19 @@ module Raykit
46
46
  end
47
47
  end
48
48
 
49
+ # default branch
50
+ def default_branch
51
+ update_local_clone_directory
52
+ if Dir.exist?(local_clone_directory)
53
+ Dir.chdir(local_clone_directory) do
54
+ # refs/remotes/origin/master
55
+ default_branch = `git symbolic-ref refs/remotes/origin/HEAD`.split("/").last.strip
56
+ return default_branch
57
+ end
58
+ end
59
+ "main"
60
+ end
61
+
49
62
  # The branches for the git repository
50
63
  def branches
51
64
  results = []
@@ -64,9 +77,11 @@ module Raykit
64
77
  # The latest commit id for a branch of the repostiory
65
78
  def latest_commit(branch)
66
79
  if checkout_local_clone_directory_branch(branch)
67
- text = `git log -n 1`
68
- scan = text.scan(/commit (\w+)\s/)
69
- return scan[0][0].to_s
80
+ Dir.chdir(local_clone_directory) do
81
+ text = `git log -n 1`
82
+ scan = text.scan(/commit (\w+)\s/)
83
+ return scan[0][0].to_s
84
+ end
70
85
  end
71
86
  ""
72
87
  end
@@ -149,7 +164,6 @@ module Raykit
149
164
  FileUtils.rm_rf(".git")
150
165
  cmd = Raykit::Command.new(command)
151
166
  cmd = cmd.run().summary().details_on_failure
152
- #cmd = run(command).details_on_failure
153
167
  end
154
168
  FileUtils.rm_rf(make_dir) if (cmd.exitstatus == 0)
155
169
  cmd
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.421
4
+ version: 0.0.423
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-22 00:00:00.000000000 Z
11
+ date: 2022-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler