Skip to content
This repository
Browse code

Stasis.register doesn't blow up if no Stasis instances, prerelease

  • Loading branch information...
commit 17861b1e10e55b0489d76071e4a3872937424df8 1 parent 36d659b
Winton Welsh authored

Showing 2 changed files with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. +4 2 lib/stasis.rb
  2. +1 1  stasis.gemspec
6 lib/stasis.rb
@@ -296,8 +296,10 @@ def add_plugin(plugin)
296 296 # Add a plugin to all existing controller instances. This method should be called by
297 297 # all external plugins.
298 298 def self.register(plugin)
299   - @instances.each do |stasis|
300   - stasis.add_plugin(plugin)
  299 + if @instances
  300 + @instances.each do |stasis|
  301 + stasis.add_plugin(plugin)
  302 + end
301 303 end
302 304 end
303 305
2  stasis.gemspec
@@ -6,7 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6 6
7 7 Gem::Specification.new do |s|
8 8 s.name = "stasis"
9   - s.version = '0.1.23'
  9 + s.version = '0.2.0.pre'
10 10 s.platform = Gem::Platform::RUBY
11 11 s.authors = [ 'Winton Welsh' ]
12 12 s.email = [ 'mail@wintoni.us' ]

0 comments on commit 17861b1

Please sign in to comment.
Something went wrong with that request. Please try again.