Class: MotionSplash

Inherits:
Object
  • Object
show all
Defined in:
lib/motion-splash.rb,
lib/motion-splash/config.rb,
lib/motion-splash/generator.rb

Defined Under Namespace

Classes: Config, Generator

Class Method Summary collapse

Class Method Details

.generate!Object



4
5
6
# File 'lib/motion-splash.rb', line 4

def self.generate!
  @should_generate = true
end

.setup(app) {|config| ... } ⇒ Object

Yields:

  • (config)


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/motion-splash.rb', line 12

def self.setup(app)
  config = Config.new(app)
  yield(config) if block_given?
  config.finish

  splash_delegate = File.join(File.dirname(__FILE__), 'motion-splash/splash_app_delegate.rb')

  if MotionSplash.should_generate?
    app.files << File.join(File.dirname(__FILE__), 'motion-splash/generator.rb')
    app.files << File.join(File.dirname(__FILE__), 'motion-splash/config.rb')
    app.files << splash_delegate

    system("touch \"#{splash_delegate}\"")
  else
    if File.mtime(splash_delegate) >= File.mtime(config.app_delegate_file)
      system("touch \"#{config.app_delegate_file}\"")
    end
  end
end

.should_generate?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/motion-splash.rb', line 8

def self.should_generate?
  @should_generate
end