development 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -1
- data/lib/development.rb +6 -6
- metadata +1 -1
data/README.md
CHANGED
@@ -14,6 +14,14 @@ Intercept gem-require expression (require 'gem') and require version at alternat
|
|
14
14
|
|
15
15
|
* sudo gem install development
|
16
16
|
|
17
|
+
# Why? #
|
18
|
+
|
19
|
+
Use cases include:
|
20
|
+
|
21
|
+
1. Development work on a gem in the context of another gem that requires it and provides a problem context - cause development version to load without changing any code. This is particularly useful when the require statement is nested in other gems than the one providing the problem context.
|
22
|
+
2. Development of multiple side-by-side gems that are not yet released - use require 'gem-name' even before the gem has been installed.
|
23
|
+
3. Test development code for deployment contexts (and debug tests) before building/installing gem.
|
24
|
+
|
17
25
|
# Usage #
|
18
26
|
|
19
27
|
Enabling Development requires two things:
|
@@ -129,7 +137,6 @@ require 'bundler'
|
|
129
137
|
Bundler.require
|
130
138
|
```
|
131
139
|
|
132
|
-
|
133
140
|
# License #
|
134
141
|
|
135
142
|
(The MIT License)
|
data/lib/development.rb
CHANGED
@@ -563,7 +563,7 @@ module ::Development
|
|
563
563
|
gem_location = ::File.join( gem_location, gem_directory_name )
|
564
564
|
end
|
565
565
|
|
566
|
-
load_gem_in_path( gem_location,
|
566
|
+
load_gem_in_path( gem_location, gem_require_name )
|
567
567
|
@loaded_gems[ gem_require_name.to_sym ] = true
|
568
568
|
|
569
569
|
return self
|
@@ -598,7 +598,7 @@ module ::Development
|
|
598
598
|
|
599
599
|
if path_is_gem_directory?( this_load_path, gem_require_name )
|
600
600
|
|
601
|
-
load_gem_in_path( this_load_path,
|
601
|
+
load_gem_in_path( this_load_path, gem_require_name )
|
602
602
|
@loaded_gems[ gem_require_name ] = true
|
603
603
|
did_load = true
|
604
604
|
break
|
@@ -607,7 +607,7 @@ module ::Development
|
|
607
607
|
|
608
608
|
gem_location = ::File.join( this_load_path, gem_directory_name )
|
609
609
|
|
610
|
-
load_gem_in_path( gem_location,
|
610
|
+
load_gem_in_path( gem_location, gem_require_name )
|
611
611
|
@loaded_gems[ gem_require_name ] = true
|
612
612
|
did_load = true
|
613
613
|
break
|
@@ -702,13 +702,13 @@ module ::Development
|
|
702
702
|
#
|
703
703
|
# Path where gem directory might be located.
|
704
704
|
#
|
705
|
-
# @param
|
705
|
+
# @param gem_require_name
|
706
706
|
#
|
707
|
-
# Name of gem. Assumes gem
|
707
|
+
# Name of gem. Assumes gem/subname is used rather than gem-subname.
|
708
708
|
#
|
709
709
|
# @return [true,false] Whether gem name is present.
|
710
710
|
#
|
711
|
-
def self.load_gem_in_path( load_path,
|
711
|
+
def self.load_gem_in_path( load_path, gem_require_name )
|
712
712
|
|
713
713
|
gem_require_file = ::File.join( load_path, 'lib', gem_directory_name ) + '.rb'
|
714
714
|
require_relative( ::File.expand_path( gem_require_file ) )
|