framework_fixture 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ class FrameworkFixture
14
14
  class <<self
15
15
 
16
16
  attr_accessor :root
17
- attr_reader :app, :build, :config, :exact_version, :loose_version, :framework
17
+ attr_reader :app, :build, :config, :exact_version, :framework, :loose_version
18
18
 
19
19
  def create_build
20
20
  FileUtils.mkdir_p @build = "#{@root}/builds"
@@ -80,6 +80,15 @@ class FrameworkFixture
80
80
  end
81
81
 
82
82
  def require_gem
83
+ set_vars
84
+
85
+ if @framework
86
+ gem @framework, @loose_version
87
+ @exact_version = Gem.loaded_specs[@framework].version.to_s
88
+ end
89
+ end
90
+
91
+ def set_vars
83
92
  if ENV['RAILS']
84
93
  @framework = 'rails'
85
94
  elsif ENV['SINATRA']
@@ -92,14 +101,13 @@ class FrameworkFixture
92
101
  if @loose_version.match(/\d*/)[0].length == @loose_version.length
93
102
  @loose_version = "<#{@loose_version.to_i + 1}"
94
103
  end
95
-
96
- gem @framework, @loose_version
97
- @exact_version = Gem.loaded_specs[@framework].version.to_s
98
104
  end
99
105
  end
100
106
 
101
107
  def sinatra
102
108
  @loose_version if @framework == 'sinatra'
103
109
  end
110
+
111
+ FrameworkFixture.set_vars
104
112
  end
105
113
  end
@@ -1,3 +1,3 @@
1
1
  class FrameworkFixture
2
- VERSION = "0.1.2" unless defined?(::FrameworkFixture::VERSION)
2
+ VERSION = "0.1.3" unless defined?(::FrameworkFixture::VERSION)
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Winton Welsh
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-30 00:00:00 -08:00
17
+ date: 2011-01-02 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency