gem-clone 0.4.0 → 0.4.1
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/README.md +5 -6
- data/lib/rubygems/commands/clone_command.rb +8 -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: 88c04c0a3f92b224d8cf69412f3a93c6daeb829bc89749dd712874e88bd86531
|
4
|
+
data.tar.gz: f50157ba3e8559bfe70903f08c5804451eea29b015dc1b9aa9c4e895bc50aef3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c025fe44200548cc80821344aa8e930a71ef8b4bdea7001f2fb1ef7b5833e3694774803524f71b29a13b9c66e0d84f6b1e738463cf05c872d6fb179378e8f404
|
7
|
+
data.tar.gz: 513e70c10abe50e0655dbf065672bb36564648567dc1086e6d72abc0203b91d37ee731e0ba896077762366cf137e84ad51123c7e4828da40fb24f9a99a27fc4f
|
data/README.md
CHANGED
@@ -5,14 +5,14 @@ A RubyGems plugin that allows you to clone gem repositories using `ghq` based on
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
```bash
|
8
|
-
gem install
|
8
|
+
gem install gem-clone
|
9
9
|
```
|
10
10
|
|
11
11
|
Or build and install locally:
|
12
12
|
|
13
13
|
```bash
|
14
|
-
gem build
|
15
|
-
gem install
|
14
|
+
gem build gem-clone.gemspec
|
15
|
+
gem install gem-clone-0.1.0.gem
|
16
16
|
```
|
17
17
|
|
18
18
|
## Prerequisites
|
@@ -52,7 +52,6 @@ The command will:
|
|
52
52
|
2. Extract repository URL from:
|
53
53
|
- `source_code_uri` metadata
|
54
54
|
- `homepage_uri` (if it looks like a repository URL)
|
55
|
-
- `project_uri` (if it looks like a repository URL)
|
56
55
|
3. Clone the repository using:
|
57
56
|
- `ghq get` (preferred method if available)
|
58
57
|
- `git clone` (fallback if ghq is not available)
|
@@ -96,8 +95,8 @@ https://github.com/rails/rails
|
|
96
95
|
After checking out the repo, run tests and build the gem:
|
97
96
|
|
98
97
|
```bash
|
99
|
-
gem build
|
100
|
-
gem install
|
98
|
+
gem build gem-clone.gemspec
|
99
|
+
gem install gem-clone-0.1.0.gem
|
101
100
|
```
|
102
101
|
|
103
102
|
## License
|
@@ -2,6 +2,7 @@ require 'rubygems/command'
|
|
2
2
|
require 'json'
|
3
3
|
require 'net/http'
|
4
4
|
require 'uri'
|
5
|
+
require 'open3'
|
5
6
|
|
6
7
|
class Gem::Commands::CloneCommand < Gem::Command
|
7
8
|
def initialize
|
@@ -120,7 +121,13 @@ Examples:
|
|
120
121
|
private
|
121
122
|
|
122
123
|
def command_available?(command)
|
123
|
-
|
124
|
+
begin
|
125
|
+
check_command = RUBY_PLATFORM =~ /mswin|mingw|cygwin/ ? 'where' : 'which'
|
126
|
+
_, _, status = Open3.capture3("#{check_command} #{command}")
|
127
|
+
status.success?
|
128
|
+
rescue
|
129
|
+
false
|
130
|
+
end
|
124
131
|
end
|
125
132
|
|
126
133
|
def clone_with_ghq(url)
|