development 1.0.1 → 1.0.2
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.
- data/CHANGELOG.md +6 -0
- data/lib/development.rb +31 -24
- data/lib/development/require.rb +2 -2
- metadata +1 -1
data/CHANGELOG.md
CHANGED
data/lib/development.rb
CHANGED
@@ -21,7 +21,7 @@ module ::Development
|
|
21
21
|
#
|
22
22
|
def loaded?( gem_name )
|
23
23
|
|
24
|
-
return @loaded_gems.include?( gem_name )
|
24
|
+
return @loaded_gems.include?( gem_name.to_sym )
|
25
25
|
|
26
26
|
end
|
27
27
|
|
@@ -862,44 +862,51 @@ module ::Development
|
|
862
862
|
#
|
863
863
|
def self.require( gem_name_or_path )
|
864
864
|
|
865
|
-
did_load =
|
865
|
+
did_load = nil
|
866
866
|
|
867
867
|
# if our path ends with an extension we are not requiring a gem and thus not responsible for managing it
|
868
868
|
if ::File.extname( gem_name_or_path ).empty?
|
869
869
|
|
870
870
|
gem_name = gem_name_or_path.to_s
|
871
871
|
|
872
|
-
|
873
|
-
|
874
|
-
|
872
|
+
if @loaded_gems.include?( gem_name.to_sym )
|
873
|
+
did_load = false
|
874
|
+
else
|
875
|
+
# ensure we have 'gem-subname' rather than 'gem/subname'
|
876
|
+
# we really just need one or the other consistently
|
877
|
+
gem_directory_name = gem_name.gsub( '/', '-' )
|
875
878
|
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
+
# look for gem name in enabled gems/gemsets
|
880
|
+
if @enabled_gems.include?( gem_name.to_sym ) or
|
881
|
+
@enable_for_all && ! @disabled_gems.include?( gem_name.to_sym )
|
879
882
|
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
+
if directory_name = @gem_locations[ gem_name.to_sym ] and
|
884
|
+
load_path = directory( directory_name ) and
|
885
|
+
gem_name_at_load_path?( load_path, gem_directory_name, true )
|
883
886
|
|
884
|
-
|
885
|
-
|
887
|
+
load_gem_from_path( load_path, gem_directory_name )
|
888
|
+
@loaded_gems.push( gem_name.to_sym )
|
889
|
+
did_load = true
|
886
890
|
|
887
|
-
|
888
|
-
|
889
|
-
|
891
|
+
else
|
892
|
+
# look in each path for gem - use first to match
|
893
|
+
@general_load_paths.each do |this_load_path|
|
890
894
|
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
895
|
+
# look for gem name at load path
|
896
|
+
if gem_name_at_load_path?( this_load_path, gem_name )
|
897
|
+
load_gem_from_path( this_load_path, gem_name )
|
898
|
+
@loaded_gems.push( gem_name.to_sym )
|
899
|
+
did_load = true
|
900
|
+
end
|
896
901
|
|
897
|
-
|
902
|
+
end
|
898
903
|
|
899
|
-
|
904
|
+
end
|
900
905
|
|
906
|
+
end
|
907
|
+
|
901
908
|
end
|
902
|
-
|
909
|
+
|
903
910
|
end
|
904
911
|
|
905
912
|
return did_load
|
data/lib/development/require.rb
CHANGED
@@ -22,9 +22,9 @@ module ::Development::Require
|
|
22
22
|
#
|
23
23
|
def require( gem_name_or_path )
|
24
24
|
|
25
|
-
did_load =
|
25
|
+
did_load = ::Development.require( gem_name_or_path )
|
26
26
|
|
27
|
-
|
27
|
+
if did_load.nil?
|
28
28
|
did_load = super
|
29
29
|
end
|
30
30
|
|