gem-src 0.5.1 → 0.6.0

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
  SHA1:
3
- metadata.gz: 994fa9d12de12ccac86fa26afdc5b205b062c494
4
- data.tar.gz: 03c3d32859487deb220ca7bb6fd77a9bc5a2c1d3
3
+ metadata.gz: 536d3cfe29f58697b12874128699be241b6e1fb0
4
+ data.tar.gz: 730f039a50b289972e07930a35dfc6a1af9e9914
5
5
  SHA512:
6
- metadata.gz: 38903f66f7c82e5019f28c3fcd2a914da6bdd7c7fae0e8e1d4fcc2d57bfc7af1d86eba77806e11871963b2304415940a2eda8bdb65730b4c8931a9a80eac62ee
7
- data.tar.gz: 7c644e3ed14e39e17fc6aeac622f06704ccbcdc3388d4ae291d60721ed2f4710f69b0acece5d5a0f42d719b341a45c92e04c42cf6239ecabcf607adab38aea1f
6
+ metadata.gz: 140d3298960f4fdd4d080f2b74421fd6ef15aa7bbcd57d1422b9d678f4a60f67904f2c32221243cb65f81707e5cbafef0dec671cb76cb52be4c35a705051aa37
7
+ data.tar.gz: bd47b68082ce5c03922b84057c4b390fd4db9f4657ee74bafb05e8e881089f71fdd4767a702ad956401c18f75723b015bb4f1db92cc516873e61832e8bfc7468
data/README.md CHANGED
@@ -9,13 +9,13 @@ gem-src is a gem plugin && rbenv plugin that automatically `git clone`s the gem'
9
9
 
10
10
  gem-src is a gem plugin that can be installed via gem install command:
11
11
 
12
- $ gem install gem-src
12
+ % gem install gem-src
13
13
 
14
14
  ### As an rbenv plugin (recommended)
15
15
 
16
16
  Alternatively, if you're using rbenv, you can install gem-src as an rbenv plugin:
17
17
 
18
- $ git clone https://github.com/amatsuda/gem-src.git ~/.rbenv/plugins/gem-src
18
+ % git clone https://github.com/amatsuda/gem-src.git ~/.rbenv/plugins/gem-src
19
19
 
20
20
  then you get gem-src enabled for all `gem` and `bundle` commands invoked through rbenv.
21
21
 
data/gem-src.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "gem-src"
7
- gem.version = '0.5.1'
7
+ gem.version = '0.6.0'
8
8
  gem.authors = ["Akira Matsuda"]
9
9
  gem.email = ["ronnie@dio.jp"]
10
10
  gem.description = 'Gem.post_install { `git clone gem_source src` }'
@@ -1,9 +1,5 @@
1
1
  require 'rubygems'
2
- require 'rubygems/installer'
3
- require 'rubygems/command_manager'
4
- require 'net/http'
5
-
6
- Gem::CommandManager.instance.register_command :ginstall
2
+ require 'net/https'
7
3
 
8
4
  module Gem
9
5
  class Src
@@ -74,7 +70,16 @@ module Gem
74
70
  return if @tested_repositories.include? repository
75
71
  @tested_repositories << repository
76
72
  return if github?(repository) && !github_page_exists?(repository)
77
- system 'git', 'clone', repository, clone_dir if git?(repository)
73
+
74
+ if ghq_available?
75
+ system 'ghq', 'get', repository
76
+ else
77
+ system 'git', 'clone', repository, clone_dir if git?(repository)
78
+ end
79
+ end
80
+
81
+ def ghq_available?
82
+ system('which', 'ghq')
78
83
  end
79
84
 
80
85
  def git_clone_homepage_or_source_code_uri_or_homepage_uri_or_github_organization_uri
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-src
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-13 00:00:00.000000000 Z
11
+ date: 2014-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec