gem-src 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -1
- data/gem-src.gemspec +1 -1
- data/lib/rubygems_plugin.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49616d662bfc4d63838e221b220a0159b0d28c59
|
4
|
+
data.tar.gz: 39f4410194d7b0bc0e3e42e6ae41351a63afc6a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0a8e311d525ebf2ef63b19595f05a03b5f668a2ea5734b870c509aaf83f7f57b691582139445ee5fbc4ce15fcf521e6ab1a36d043c3d267410307dfe0469c50
|
7
|
+
data.tar.gz: 6866e89026ee3890f115d2b6e9831aba2fc306051e32c2b49dd034ad9a3dbd93a690a17d6658142fec4ac565d9aca2c646257361ea3faf9615fc86cdefce0eab
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ So, the whole directory structure will be like this.
|
|
46
46
|
Note that you might be cloning the same repository again and again as the gem is updated, or the gem install directory changes.
|
47
47
|
For example, if you're using RVM, each of `~/.rvm/gems/*/gems/*` will have it's Git repo inside "src" directory.
|
48
48
|
|
49
|
-
###
|
49
|
+
### Specifying gemsrc_clone_root (strongly recommended)
|
50
50
|
|
51
51
|
Instead of cloning the repo under installed gem directory for each `gem install`, you can specify one single directory to keep all the cloned source repositories.
|
52
52
|
|
@@ -72,6 +72,24 @@ Now, the whole directory structure will look like this.
|
|
72
72
|
│ ├── i18n_generators
|
73
73
|
...
|
74
74
|
|
75
|
+
### Using ghq command (also recommended)
|
76
|
+
|
77
|
+
You can tell gem-src to rely on `ghq` command instead of `git clone`.
|
78
|
+
This requires ghq (https://github.com/motemen/ghq) to be installed, and either of the following two configurations should be made.
|
79
|
+
|
80
|
+
1) `GEMSRC_USE_GHQ` environment variable
|
81
|
+
2) add `gemsrc_use_ghq` configuration in your .gemrc
|
82
|
+
|
83
|
+
The directory structure should be like below in this mode.
|
84
|
+
|
85
|
+
ghq.root (~/.ghq by default)
|
86
|
+
├── github.com
|
87
|
+
│ ├── amatsuda
|
88
|
+
│ │ ├── database_rewinder
|
89
|
+
│ │ └── rfd
|
90
|
+
│ ├── jimweirich
|
91
|
+
│ │ └── rake
|
92
|
+
...
|
75
93
|
|
76
94
|
## Pristine
|
77
95
|
|
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.6.
|
7
|
+
gem.version = '0.6.1'
|
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` }'
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -71,15 +71,15 @@ module Gem
|
|
71
71
|
@tested_repositories << repository
|
72
72
|
return if github?(repository) && !github_page_exists?(repository)
|
73
73
|
|
74
|
-
if
|
74
|
+
if use_ghq?
|
75
75
|
system 'ghq', 'get', repository
|
76
76
|
else
|
77
77
|
system 'git', 'clone', repository, clone_dir if git?(repository)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
-
def
|
82
|
-
|
81
|
+
def use_ghq?
|
82
|
+
ENV['GEMSRC_USE_GHQ'] || Gem.configuration[:gemsrc_use_ghq]
|
83
83
|
end
|
84
84
|
|
85
85
|
def git_clone_homepage_or_source_code_uri_or_homepage_uri_or_github_organization_uri
|