discourse_plugin_statistics 0.1.0.pre6 → 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 918c4b831a10d6151c074f108c0d6693fa352653b3a3bfb4a3a4da5f5f7736dc
|
4
|
+
data.tar.gz: a788aeaf43534f5c7ba62602e381de99ff7cb420dff9e63cdc6605909b43069d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|