gemist 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,3 +1,9 @@
1
+ v0.0.5 - May 15, 2011
2
+ ---------------------
3
+
4
+ ### Added:
5
+ * Allow require:false
6
+
1
7
  v0.0.4 - May 15, 2011
2
8
  ---------------------
3
9
 
data/lib/gemist.rb CHANGED
@@ -2,7 +2,7 @@ require 'ostruct'
2
2
 
3
3
  # Gem environment manager.
4
4
  module Gemist
5
- VERSION = "0.0.4"
5
+ VERSION = "0.0.5"
6
6
 
7
7
  def self.version
8
8
  VERSION
@@ -148,7 +148,8 @@ class Gemist::Gem
148
148
  self.name ||= options[:name]
149
149
  self.versions ||= options[:version]
150
150
  self.group ||= options[:group]
151
- self.require ||= options[:require] || self.name
151
+ self.require ||= options[:require]
152
+ self.require = self.name if self.require.nil?
152
153
  end
153
154
 
154
155
  # Activates the gem; returns +false+ if it's not available.
@@ -163,7 +164,7 @@ class Gemist::Gem
163
164
  # Loads the gem via +require+. Make sure you load! it first.
164
165
  # Returns true if loaded.
165
166
  def require!
166
- [*require].each { |r| Kernel.require r }
167
+ [*require].each { |r| Kernel.require r if r }
167
168
  end
168
169
 
169
170
  # Returns the +gem install+ paramaters needed to install the gem.
@@ -0,0 +1 @@
1
+ gem "yard", require: false
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../test_helper', __FILE__)
2
+
3
+ class RequireTest < Test::Unit::TestCase
4
+ test "require: false" do
5
+ Gem.expects(:activate).with('yard').returns(true)
6
+ Kernel.expects(:require).with('yard').never
7
+
8
+ use_gemfile 'require.gemfile'
9
+
10
+ Gemist.require
11
+ end
12
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gemist
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.4
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rico Sta. Cruz
@@ -29,8 +29,10 @@ files:
29
29
  - lib/gemist.rb
30
30
  - test/bogus_test.rb
31
31
  - test/fixtures/bogus.gemfile
32
+ - test/fixtures/require.gemfile
32
33
  - test/fixtures/sample.gemfile
33
34
  - test/gemist_test.rb
35
+ - test/require_test.rb
34
36
  - test/test_helper.rb
35
37
  - HISTORY.md
36
38
  - README.md