gem-src 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -5
- data/gem-src.gemspec +1 -1
- data/lib/rubygems_plugin.rb +2 -0
- metadata +4 -4
data/README.md
CHANGED
@@ -34,18 +34,24 @@ So, the whole directory structure will be like this.
|
|
34
34
|
...
|
35
35
|
Note that if you're using RVM, each of `~/.rvm/gems/*/gems/*` will have it's Git repo inside "src" directory.
|
36
36
|
|
37
|
-
###
|
37
|
+
### specifying gemsrc_clone_root
|
38
|
+
|
39
|
+
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.
|
38
40
|
|
39
|
-
Instead of cloning the repo under installed gem directory for each `gem install`, you can specify one single directory via `GEMSRC_CLONE_ROOT` environment variable to keep all the cloned repositories.
|
40
41
|
This way, `git clone` will no more be executed per every `gem update`.
|
41
42
|
This option would be more efficient particularly if you're frequently switching RVM gemsets, or using bundler with `--path` per each projects.
|
43
|
+
There are two ways to specify this variable:
|
44
|
+
|
45
|
+
1) `GEMSRC_CLONE_ROOT` environment variable
|
46
|
+
2) add `gemsrc_clone_root` configuration in your .gemrc
|
42
47
|
|
43
48
|
For example,
|
44
49
|
|
45
|
-
%
|
46
|
-
|
50
|
+
% echo "gemsrc_clone_root: ~/src" >> ~/.gemrc
|
51
|
+
% gem i active_decorator
|
52
|
+
will clone the source Git repo into `~/src/active_decorator` directory if not exists.
|
47
53
|
|
48
|
-
Now, the whole directory structure will
|
54
|
+
Now, the whole directory structure will look like this.
|
49
55
|
|
50
56
|
~
|
51
57
|
├── src
|
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.
|
7
|
+
gem.version = '0.3.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` }'
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -3,6 +3,8 @@ require 'rubygems'
|
|
3
3
|
Gem.post_install do |installer|
|
4
4
|
clone_dir = if ENV['GEMSRC_CLONE_ROOT']
|
5
5
|
File.join ENV['GEMSRC_CLONE_ROOT'], installer.spec.name
|
6
|
+
elsif Gem.configuration[:gemsrc_clone_root]
|
7
|
+
File.join Gem.configuration[:gemsrc_clone_root], installer.spec.name
|
6
8
|
else
|
7
9
|
gem_dir = installer.respond_to?(:gem_dir) ? installer.gem_dir : File.join(installer.gem_home, 'gems', installer.spec.full_name)
|
8
10
|
File.join gem_dir, 'src'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem-src
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Akira Matsuda
|