gitbroker 0.6.3 → 0.6.4

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: 7f6274054ed60618fb8616a0749d40c1b4cb52ca6e404c1e6cf7db5680974f3a
4
- data.tar.gz: 6804bcf3df622af5f6e3c28982c0f02253344030d17d2e7abf33386a53e0930f
3
+ metadata.gz: b6c41dc04d47bc8bfbad2ccb322b3a952b58e4957c2e282c25cb9075e58e83b2
4
+ data.tar.gz: 6d2f1b148005c310ed3538fe6fc4349cbaa38821bd1aa0f2ef25117477f146fa
5
5
  SHA512:
6
- metadata.gz: cf810ab366134baa979fa36e90fe717e9651565c82456a52f18e2bb80e8a485cbdbaac654f17d92b91c9c0591d314402026beda26b7e213e9058cf88f012d8e1
7
- data.tar.gz: 1af26124d306502ac9f731538e40604d1b948cd8147dd9ce23ddd5aa1e50a462273be93a00d79d7640ebd2a00fa8d29d6a206fbf353e172701cb912ddbf8189e
6
+ metadata.gz: 271fb887ec812d171902d32a53ed027bd3107194c19e0d67f14a1e5d22352f143add06b8090f2ba9ddd57e5853e35c773541234ad50d4666a064d49a9683513f
7
+ data.tar.gz: 9a259bd5c66d1836d85b23f7e017a4011ff28722cd068f5eaeaf746eb7be8e0d2d6dbf578067cd529ed9a8858e9970fd1712d6feabc39a505afca5d9f3bd69bc
data/lib/gitbroker/cli.rb CHANGED
@@ -111,10 +111,25 @@ module Gitbroker
111
111
  end
112
112
 
113
113
  return run_daemon if foreground
114
+ return set_up_separate_instance(options[:name] || Socket.gethostname) if separate_instance?
114
115
 
115
116
  set_up(options[:name] || Socket.gethostname)
116
117
  end
117
118
 
119
+ # A GITBROKER_CONFIG_DIR that is not the default is another companion (say, one for a local dev server). The background
120
+ # service belongs to the default one, so this one is paired and then kept in this window; it never touches the service.
121
+ def separate_instance?
122
+ custom = @env["GITBROKER_CONFIG_DIR"]
123
+ custom && File.expand_path(custom) != File.expand_path(Config.default_dir(@env.reject { |key, _| key == "GITBROKER_CONFIG_DIR" }))
124
+ end
125
+
126
+ def set_up_separate_instance(name)
127
+ Login.new(config:, out: @out, name:).run unless config.paired?
128
+ @out.puts "This companion uses its own settings (#{config.dir}), so the background service is left alone. Keeping it in this " \
129
+ "window, connected to #{config.server}; press Ctrl-C to stop it."
130
+ run_daemon
131
+ end
132
+
118
133
  def run_daemon
119
134
  raise Error, "This machine is not paired. Run `gitbroker start` in a terminal to pair it." unless config.paired?
120
135
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gitbroker
4
- VERSION = "0.6.3"
4
+ VERSION = "0.6.4"
5
5
  end
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "gitbroker",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Skills for working on Git Broker agent tasks: the gitbroker MCP tools, write rules and report_task."
5
5
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitbroker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Sidorov (@newstler)