Module: BubbleWrap

Defined in:
motion/core/app.rb,
motion/core.rb,
motion/reactor.rb,
motion/core/json.rb,
motion/core/string.rb,
motion/core/device.rb,
motion/reactor/queue.rb,
motion/reactor/timer.rb,
motion/reactor/future.rb,
lib/bubble-wrap/loader.rb,
motion/core/persistence.rb,
lib/bubble-wrap/version.rb,
motion/reactor/eventable.rb,
motion/core/device/screen.rb,
motion/reactor/deferrable.rb,
lib/bubble-wrap/requirement.rb,
motion/reactor/periodic_timer.rb,
motion/reactor/default_deferrable.rb,
lib/bubble-wrap/ext/motion_project_app.rb,
lib/bubble-wrap/ext/motion_project_config.rb,
lib/bubble-wrap/requirement/path_manipulation.rb

Overview

Persistence module built on top of NSUserDefaults

Defined Under Namespace

Modules: App, Device, Ext, JSON, Persistence, Reactor, String Classes: Requirement

Constant Summary

LOADER_PRESENT =
true
VERSION =
'1.1.0.dev'

Class Method Summary (collapse)

Class Method Details

+ (Object) create_uuid



23
24
25
26
27
28
# File 'motion/core.rb', line 23

def create_uuid
  uuid = CFUUIDCreate(nil)
  uuid_string = CFUUIDCreateString(nil, uuid)
  CFRelease(uuid)
  uuid_string
end

+ (Object) localized_string(key, value)



14
15
16
# File 'motion/core.rb', line 14

def localized_string(key, value)
  NSBundle.mainBundle.localizedStringForKey(key, value:value, table:nil)
end

+ (Object) p(arg)

I had issues with #p on the device, this is a temporary workaround



19
20
21
# File 'motion/core.rb', line 19

def p(arg)
  NSLog arg.inspect
end

+ (Object) require(file_spec, &block)



20
21
22
# File 'lib/bubble-wrap/loader.rb', line 20

def require(file_spec, &block)
  Requirement.scan(caller.first, file_spec, &block)
end

+ (UIcolor) rgb_color(r, g, b)

Returns:

  • (UIcolor)


5
6
7
# File 'motion/core.rb', line 5

def rgb_color(r,g,b)
  rgba_color(r,g,b,1)
end

+ (UIcolor) rgba_color(r, g, b, a)

Returns:

  • (UIcolor)


10
11
12
# File 'motion/core.rb', line 10

def rgba_color(r,g,b,a)
  UIColor.colorWithRed((r/255.0), green:(g/255.0), blue:(b/255.0), alpha:a)
end

+ (Object) root



16
17
18
# File 'lib/bubble-wrap/loader.rb', line 16

def root
  File.expand_path('../../../', __FILE__)
end