development 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -0,0 +1,6 @@
1
+
2
+ == 7/09/2012
3
+
4
+ Initial release.
5
+ Update for Docs.
6
+ Update for preventing multiple-load.
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 = false
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
- # ensure we have 'gem-subname' rather than 'gem/subname'
873
- # we really just need one or the other consistently
874
- gem_directory_name = gem_name.gsub( '/', '-' )
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
- # look for gem name in enabled gems/gemsets
877
- if @enabled_gems.include?( gem_name.to_sym ) or
878
- @enable_for_all && ! @disabled_gems.include?( gem_name.to_sym )
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
- if directory_name = @gem_locations[ gem_name.to_sym ] and
881
- load_path = directory( directory_name ) and
882
- gem_name_at_load_path?( load_path, gem_directory_name, true )
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
- load_gem_from_path( load_path, gem_directory_name )
885
- did_load = true
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
- else
888
- # look in each path for gem - use first to match
889
- @general_load_paths.each do |this_load_path|
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
- # look for gem name at load path
892
- if gem_name_at_load_path?( this_load_path, gem_name )
893
- load_gem_from_path( this_load_path, gem_name )
894
- did_load = true
895
- end
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
- end
902
+ end
898
903
 
899
- end
904
+ end
900
905
 
906
+ end
907
+
901
908
  end
902
-
909
+
903
910
  end
904
911
 
905
912
  return did_load
@@ -22,9 +22,9 @@ module ::Development::Require
22
22
  #
23
23
  def require( gem_name_or_path )
24
24
 
25
- did_load = false
25
+ did_load = ::Development.require( gem_name_or_path )
26
26
 
27
- unless did_load = ::Development.require( gem_name_or_path )
27
+ if did_load.nil?
28
28
  did_load = super
29
29
  end
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: development
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: