discourse_plugin_statistics 0.1.0.pre5 → 0.1.0.pre7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0ae8228274c7608227e6f43cde59bfcc1ba9439e84700327046b2be31358912
4
- data.tar.gz: f2647b45ff91752b9cfb34e7835f50e01241cbc582e5ab2a856590d1b7d0f0af
3
+ metadata.gz: 918c4b831a10d6151c074f108c0d6693fa352653b3a3bfb4a3a4da5f5f7736dc
4
+ data.tar.gz: a788aeaf43534f5c7ba62602e381de99ff7cb420dff9e63cdc6605909b43069d
5
5
  SHA512:
6
- metadata.gz: 03b52b0cdeade6fdd80fd71b3b736ed345cde720817b231440b5600c44491b0e6f56b9c98331341a702fb9d95bb1eb1b9357aadc27abbc9df41ca052e9f4812f
7
- data.tar.gz: 833048742be89bbc38c210b2633615584158fcef8038a23f63d739249efacb68c899a333a3e3110a3b32152ffade04277cd68763ef65588911c87664fbfdfdff
6
+ metadata.gz: d8271077c1dfdf04c3a2ac277439ff73922ddc9b9069c849c9dd1be6b3382b862f5bb4d47bf17e65b775e4a902b0354c2eb1b7ed7ea8c1c71a0201d60806345c
7
+ data.tar.gz: fc980f9ccc18443da4b1c57e10fe4619d644a05cd8edf73b8e67229cbf5c9e1ca90b64cdc0cd8a81408819c2426842ec372c36ac106524561257c41925c979b2
@@ -15,6 +15,7 @@ module DiscoursePluginStatistics
15
15
  name: name,
16
16
  branch: branch,
17
17
  sha: sha,
18
+ url: url,
18
19
  data: data
19
20
  }.as_json
20
21
  end
@@ -27,6 +28,10 @@ module DiscoursePluginStatistics
27
28
  @sha ||= git_sha
28
29
  end
29
30
 
31
+ def url
32
+ @url ||= git_url
33
+ end
34
+
30
35
  def data
31
36
  @data ||= if self.class.respond_to?(name.underscore)
32
37
  self.class.send(name.underscore)
@@ -43,6 +48,10 @@ module DiscoursePluginStatistics
43
48
  run_shell_cmd("git rev-parse --abbrev-ref HEAD", chdir: dir)
44
49
  end
45
50
 
51
+ def git_url
52
+ run_shell_cmd("git config --get remote.origin.url", chdir: dir)
53
+ end
54
+
46
55
  def run_shell_cmd(cmd, opts = {})
47
56
  stdout, stderr_str, = Open3.capture3(cmd, opts)
48
57
  stderr_str.present? ? nil : stdout.strip
@@ -11,6 +11,8 @@ module DiscoursePluginStatistics
11
11
  end
12
12
 
13
13
  def update
14
+ return if ENV["DISCOURSE_PLUGIN_STATISTICS_OPT_OUT"]
15
+
14
16
  body = {
15
17
  discourse: discourse,
16
18
  plugins: plugins
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DiscoursePluginStatistics
4
- VERSION = "0.1.0.pre5"
4
+ VERSION = "0.1.0.pre7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_plugin_statistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre5
4
+ version: 0.1.0.pre7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angus McLeod
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-05 00:00:00.000000000 Z
11
+ date: 2023-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers