Module: Prelaunch

Defined in:
lib/prelaunch.rb,
lib/prelaunch/engine.rb,
lib/prelaunch/helpers.rb,
lib/prelaunch/version.rb,
lib/prelaunch/functions.rb,
lib/prelaunch/constraints.rb,
lib/generators/prelaunch/view_generator.rb,
lib/generators/prelaunch/prelaunch_generator.rb,
app/controllers/prelaunch/prelaunch_controller.rb

Defined Under Namespace

Modules: Generators, Helpers Classes: Engine, PrelaunchController, SessionConstraint, TokenConstraint

Constant Summary collapse

VERSION =
'0.0.6'
@@path =
'prelaunch'
@@token =
'letmein'
@@redirect_url =
nil
@@environments =
['production']

Class Method Summary collapse

Class Method Details

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Prelaunch)

    the object that the method was called on



34
35
36
# File 'lib/prelaunch.rb', line 34

def self.setup
  yield self
end

.valid?(token) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
23
24
25
26
27
28
# File 'lib/prelaunch.rb', line 20

def self.valid? token
  if @@token.is_a? Proc
    @@token.call token
  elsif @@token.is_a? Array
    @@token.include? token
  else
    @@token == token
  end
end

.valid_env?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/prelaunch.rb', line 30

def self.valid_env?
  @@environments.include? Rails.env
end