excursion 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10e27967761eabfa3c0ab9171d110843e12ef43b
4
- data.tar.gz: ee24fcd73c5c7e82a5a167c1f5e671470a71c4b1
3
+ metadata.gz: afc2e332b1df6c603e7e2c5596430886f3925eb9
4
+ data.tar.gz: cc082a7b38e4d20d3e78150cfdfd88f396d53bbc
5
5
  SHA512:
6
- metadata.gz: b63db66a73f60c23f1e682e3ff9c0cf0b16ae8a39b34922400386678a8b51ca35c87e2f6b5078abdf8df176ef0ce4a5707a47df68851c078fdc4c58a1f1a9968
7
- data.tar.gz: 3b34cdf6ddd60b0dcb2724c80b3bf106e9b43689aa8e6e3b58e7eb895743040cc4f6f81cd0c6d77280bac3ccd62cac34b1413313c16020d6a16ff314c01027bc
6
+ metadata.gz: 706d2a0913e6bce13e45f51cd027f208ab5b83354cf87c8569da32704b79a35dce1eb64598b5204a78a8b0998f34b04d2bc41a0d9a71c3e13d9cf8f43720c4d7
7
+ data.tar.gz: 91cafc284a1acf904370c6447ef98dc668d76de45cd680b56026e2a8bc95badd5aa77199308efe82de9e7a1d991be85cbb1e7521dda08fcf148d6e950eafb175
@@ -2,6 +2,11 @@ module Excursion
2
2
  module Datastores
3
3
  class Datastore
4
4
 
5
+
6
+ def app(key)
7
+ Excursion::Pool::Application.from_cache(read(key))
8
+ end
9
+
5
10
  def read(key); end
6
11
  alias_method :get, :read
7
12
  def write(key, value); end
@@ -8,7 +8,8 @@ module Excursion
8
8
  attr_accessor :pool
9
9
 
10
10
  def read(key)
11
- @pool[key.to_sym] ||= Excursion::Pool::DummyApplication.new(key, {host: 'test.local'}, ActionDispatch::Routing::RouteSet::NamedRouteCollection.new)
11
+ return unless Excursion.configuration.test_providers.nil? || Excursion.configuration.test_providers.map(&:to_sym).include?(key.to_sym)
12
+ @pool[key.to_sym] ||= Excursion::Pool::DummyApplication.new(key, {host: 'test.local'}, ActionDispatch::Routing::RouteSet::NamedRouteCollection.new).to_cache
12
13
  end
13
14
  alias_method :get, :read
14
15
 
@@ -4,7 +4,7 @@ module Excursion
4
4
  attr_reader :name, :default_url_options
5
5
 
6
6
  def self.from_cache(cached)
7
- new(cached[:name], cached)
7
+ new(cached[:name], cached) unless cached.nil?
8
8
  end
9
9
 
10
10
  def route(key)
@@ -7,10 +7,9 @@ module Excursion
7
7
  @@applications = {}
8
8
 
9
9
  def self.application(name)
10
- return @@applications[name] if @@applications.has_key?(name)
10
+ return @@applications[name] if @@applications.has_key?(name) && !@@applications[name].nil?
11
11
 
12
- app_yaml = datastore.get(name)
13
- @@applications[name] = Application.from_cache(app_yaml) unless app_yaml.nil?
12
+ @@applications[name] = datastore.app(name)
14
13
  end
15
14
 
16
15
  def self.register_application(app)
@@ -1,3 +1,3 @@
1
1
  module Excursion
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end