octostat 0.4.0 → 0.4.2
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/octostat/command.rb +21 -1
- data/lib/octostat/git.rb +3 -1
- data/lib/octostat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58b1ac73ef05f08cfa685900797998e55c3873a6ab8bd48dd5bb69504a2767fd
|
4
|
+
data.tar.gz: f36d8d9dc3b051332216d35a88373d853181e9212992e6ed29e561457d9d528b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd0682ccf500ab22463b5c42fa65c8d7d646d606bfeb6f739ff588a0584deb499043cd61787a0ae5434668cc704be6d3a5fc46571ac54ba8f3433d4a5f64516c
|
7
|
+
data.tar.gz: 7cebd4c675e228910bc48a1117be8e52aab418f9640fb7f1ca05c61dd0393de592570ad9b75995386bd7ed4c41c0fcd01f108c822556e6d1e03e0b0fd3edab1c
|
data/CHANGELOG.md
CHANGED
data/lib/octostat/command.rb
CHANGED
@@ -18,6 +18,9 @@ module Octostat
|
|
18
18
|
end
|
19
19
|
puts_progress git.count
|
20
20
|
puts "\nDone!"
|
21
|
+
rescue Octostat::Error => e
|
22
|
+
warn e.message
|
23
|
+
exit 1
|
21
24
|
end
|
22
25
|
|
23
26
|
private
|
@@ -31,7 +34,24 @@ module Octostat
|
|
31
34
|
|
32
35
|
def parser
|
33
36
|
OptionParser.new do |opts|
|
34
|
-
opts.
|
37
|
+
opts.banner = <<~HELP
|
38
|
+
Usage: octostat [options] [REPO]
|
39
|
+
|
40
|
+
REPO:
|
41
|
+
- A local path to a Git repository, or
|
42
|
+
- A Git URL (e.g., https://github.com/user/repo.git)
|
43
|
+
|
44
|
+
If REPO is a URL, octostat will clone it into a temporary directory.
|
45
|
+
If REPO is omitted, octostat will use the current directory.
|
46
|
+
|
47
|
+
Output:
|
48
|
+
- Octostat stores repository statistics in an SQLite database.
|
49
|
+
- By default, it writes to `./octostat.sqlite`.
|
50
|
+
- Use `--db` to specify a custom database path.
|
51
|
+
|
52
|
+
HELP
|
53
|
+
|
54
|
+
opts.on("-dDB", "--db=DB", "Path to the SQLite db (default: ./octostat.sqlite)") { |db| @db_path = db }
|
35
55
|
end
|
36
56
|
end
|
37
57
|
end
|
data/lib/octostat/git.rb
CHANGED
@@ -54,8 +54,10 @@ module Octostat
|
|
54
54
|
private
|
55
55
|
|
56
56
|
def clone_repo upstream
|
57
|
+
puts "Cloning #{upstream}"
|
57
58
|
repo_path = Dir.mktmpdir
|
58
|
-
Open3.capture2(*CLONE_COMMAND, upstream, repo_path)
|
59
|
+
status = Open3.capture2(*CLONE_COMMAND, upstream, repo_path)[1]
|
60
|
+
raise Octostat::Error.new("Error cloning '#{upstream}'") unless status.success?
|
59
61
|
repo_path
|
60
62
|
end
|
61
63
|
|
data/lib/octostat/version.rb
CHANGED