development 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -6,3 +6,5 @@ Update for Docs.
6
6
  Update for preventing multiple-load.
7
7
  Oops! Configuration-file enabling was commented out. So 1.0.3 is the first working version!
8
8
  ... And then left comments in.
9
+ Fix for enabling by gemset.
10
+
data/lib/development.rb CHANGED
@@ -214,9 +214,12 @@ module ::Development
214
214
  @enabled_gems.clear
215
215
  @disabled_gems.clear
216
216
  @gemsets.clear
217
+ @gem_locations.clear
217
218
  @general_load_paths.clear
218
219
  @loaded_gems.clear
219
220
  @named_directories.clear
221
+ @locations.clear
222
+ @enable_for_all = false
220
223
 
221
224
  return self
222
225
 
@@ -749,9 +752,17 @@ module ::Development
749
752
  when :enable
750
753
 
751
754
  if gems
752
- gems.each do |this_gem, true_value|
753
- @enabled_gems.push( this_gem )
754
- @disabled_gems.delete( this_gem )
755
+ gems.each do |this_gem_or_gemset, true_value|
756
+ if gemset = @gemsets[ this_gem_or_gemset ]
757
+ gemset.each do |this_gem|
758
+ @enabled_gems.push( this_gem )
759
+ @disabled_gems.delete( this_gem )
760
+ end
761
+ else
762
+ this_gem = this_gem_or_gemset
763
+ @enabled_gems.push( this_gem )
764
+ @disabled_gems.delete( this_gem )
765
+ end
755
766
  end
756
767
  else
757
768
  @disabled_gems.delete_if do |this_gem, true_value|
@@ -764,9 +775,17 @@ module ::Development
764
775
  when :disable
765
776
 
766
777
  if gems
767
- gems.each do |this_gem, true_value|
768
- @disabled_gems.push( this_gem )
769
- @enabled_gems.delete( this_gem )
778
+ gems.each do |this_gem_or_gemset, true_value|
779
+ if gemset = @gemsets[ this_gem_or_gemset ]
780
+ gemset.each do |this_gem|
781
+ @disabled_gems.push( this_gem )
782
+ @enabled_gems.delete( this_gem )
783
+ end
784
+ else
785
+ this_gem = this_gem_or_gemset
786
+ @disabled_gems.push( this_gem )
787
+ @enabled_gems.delete( this_gem )
788
+ end
770
789
  end
771
790
  else
772
791
  @enabled_gems.delete_if do |this_gem, true_value|
@@ -49,6 +49,8 @@ describe ::Development do
49
49
 
50
50
  it 'can parse an enable/disable expression' do
51
51
 
52
+ ::Development.parse_gemset_expression( '=some_gemset some_gem, some_other_gem, some_gemset' )
53
+
52
54
  ::Development.parse_enable_disable_expression( '!enable some_gem, some_other_gem, some_gemset' )
53
55
  ::Development.enabled_for_all?.should == false
54
56
  ::Development.enabled_gems.should == [ :some_gem, :some_other_gem, :some_gemset ]
@@ -78,6 +80,16 @@ describe ::Development do
78
80
  ::Development.enabled_for_all?.should == false
79
81
  ::Development.enabled_gems.should == [ ]
80
82
  ::Development.disabled_gems.should == [ :some_gemset, :some_gem, :some_other_gem ]
83
+
84
+ ::Development.parse_enable_disable_expression( '!enable some_gemset' )
85
+ ::Development.enabled_for_all?.should == false
86
+ ::Development.enabled_gems.should == [ :some_gem, :some_other_gem, :some_gemset ]
87
+ ::Development.disabled_gems.should == [ ]
88
+
89
+ ::Development.parse_enable_disable_expression( '!disable' )
90
+ ::Development.enabled_for_all?.should == false
91
+ ::Development.enabled_gems.should == [ ]
92
+ ::Development.disabled_gems.should == [ :some_gem, :some_other_gem, :some_gemset ]
81
93
 
82
94
  end
83
95
 
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.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: