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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f12bc26161d323018bdf18116360bb9b81981044ed51c1d451a4db2cc103b32
4
- data.tar.gz: 0aea0c5003456030440a5b0a74982cb13813731594a35933a19f9a68d13c2c33
3
+ metadata.gz: 88c04c0a3f92b224d8cf69412f3a93c6daeb829bc89749dd712874e88bd86531
4
+ data.tar.gz: f50157ba3e8559bfe70903f08c5804451eea29b015dc1b9aa9c4e895bc50aef3
5
5
  SHA512:
6
- metadata.gz: 537472ed15d28e45ef000fa04e2679a6f84ed5ce10df8c66f5ca6353a68bf172c289d5ec3b60033e640592e1029a73e90201771e4b749a7efb81905ad2edbc08
7
- data.tar.gz: 92aef3618b93a10f46845f101b905bea041d8b6ee4628a710747a455c2f12ae264edbecc756cb89d93b368719aaaeb93b6ae4a638b375cc1285690b862442adc
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 rubygems-clone
8
+ gem install gem-clone
9
9
  ```
10
10
 
11
11
  Or build and install locally:
12
12
 
13
13
  ```bash
14
- gem build rubygems-clone.gemspec
15
- gem install rubygems-clone-0.1.0.gem
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 rubygems-clone.gemspec
100
- gem install rubygems-clone-0.1.0.gem
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
- system("which #{command} > /dev/null 2>&1")
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-clone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi SHIBATA