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.1.0'
@@verify_path =
'prelaunch'
@@logout_path =
'prelaunch/logout'
@@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



37
38
39
# File 'lib/prelaunch.rb', line 37

def self.setup
  yield self
end

.valid?(token) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
27
28
29
30
31
# File 'lib/prelaunch.rb', line 23

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)


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

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