Module: BubbleWrap
- Defined in:
- motion/core/app.rb,
lib/bubble-wrap/loader.rb,
lib/bubble-wrap/version.rb,
lib/bubble-wrap/requirement.rb,
lib/bubble-wrap/ext/motion_project_app.rb,
lib/bubble-wrap/requirement/path_manipulation.rb,
motion/core.rb,
motion/sms/sms.rb,
motion/reactor.rb,
motion/shortcut.rb,
motion/core/kvo.rb,
motion/font/font.rb,
motion/core/json.rb,
motion/mail/mail.rb,
motion/sms/result.rb,
motion/rss_parser.rb,
motion/core/string.rb,
motion/media/media.rb,
motion/mail/result.rb,
motion/core/device.rb,
motion/core/osx/app.rb,
motion/core/ios/app.rb,
motion/media/player.rb,
motion/reactor/queue.rb,
motion/reactor/timer.rb,
motion/motion/motion.rb,
motion/util/constants.rb,
motion/reactor/future.rb,
motion/util/deprecated.rb,
motion/core/ios/device.rb,
motion/core/osx/device.rb,
motion/core/persistence.rb,
motion/reactor/eventable.rb,
motion/location/location.rb,
motion/ui/ui_view_wrapper.rb,
motion/core/device/screen.rb,
motion/reactor/deferrable.rb,
motion/ui/ui_control_wrapper.rb,
motion/core/device/osx/screen.rb,
motion/core/device/ios/camera.rb,
motion/core/device/ios/screen.rb,
motion/reactor/periodic_timer.rb,
motion/reactor/default_deferrable.rb,
motion/ui/ui_view_controller_wrapper.rb,
motion/core/device/ios/camera_wrapper.rb,
motion/reactor/thread_aware_deferrable.rb,
motion/network-indicator/network-indicator.rb
Overview
Provides a nice DSL for interacting with the standard
UIImagePickerController
Defined Under Namespace
Modules: App, CLLocationWrap, Constants, Deprecated, Device, Ext, Font, JSON, KVO, Location, Mail, Media, Motion, NetworkIndicator, Persistence, Reactor, SMS, String, UIControlWrapper, UIViewControllerWrapper, UIViewWrapper
Classes: RSSParser, Requirement
Constant Summary
collapse
- LOADER_PRESENT =
true
- VERSION =
'1.8.0'
- MIN_MOTION_VERSION =
'2.17'
- SETTINGS =
{}
Class Method Summary
collapse
-
.after_config(config) ⇒ Object
-
.before_config(app) ⇒ Object
-
.create_uuid ⇒ Object
-
.debug=(val) ⇒ Object
-
.debug? ⇒ Boolean
-
.localized_string(key, value = nil) ⇒ Object
-
.p(arg) ⇒ Object
I had issues with #p on the device, this is a temporary workaround.
-
.require(file_spec, &block) ⇒ Object
-
.require_ios(requirement = nil, &callback) ⇒ Object
-
.require_osx(requirement = nil, &callback) ⇒ Object
-
.rgb_color(r, g, b) ⇒ UIcolor
-
.rgba_color(r, g, b, a) ⇒ UIcolor
-
.root ⇒ Object
-
.use_weak_callbacks=(val) ⇒ Object
-
.use_weak_callbacks? ⇒ Boolean
Instance Method Summary
collapse
Class Method Details
.after_config(config) ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/bubble-wrap/loader.rb', line 49
def after_config(config)
BubbleWrap.require_ios do
ios7_files = 'motion/ios/7/uiactivity_view_controller_constants.rb'
if config.send(:deployment_target).to_f >= 7.0
::BubbleWrap.require(ios7_files)
before_config(config)
else
config.files = config.files.reject {|s|
s.include?(ios7_files)
}
end
end
end
|
.before_config(app) ⇒ Object
43
44
45
46
47
|
# File 'lib/bubble-wrap/loader.rb', line 43
def before_config(app)
app.files = ::BubbleWrap::Requirement.files(app.files)
app.files_dependencies ::BubbleWrap::Requirement.files_dependencies
app.frameworks = ::BubbleWrap::Requirement.frameworks(app.frameworks)
end
|
.create_uuid ⇒ Object
31
32
33
34
|
# File 'motion/core.rb', line 31
def create_uuid
uuid = CFUUIDCreate(nil)
CFUUIDCreateString(nil, uuid)
end
|
.debug=(val) ⇒ Object
8
9
10
|
# File 'motion/shortcut.rb', line 8
def self.debug=(val)
BubbleWrap::SETTINGS[:debug] = val
end
|
.debug? ⇒ Boolean
12
13
14
|
# File 'motion/shortcut.rb', line 12
def self.debug?
BubbleWrap::SETTINGS[:debug]
end
|
.localized_string(key, value = nil) ⇒ Object
22
23
24
|
# File 'motion/core.rb', line 22
def localized_string(key, value=nil)
NSBundle.mainBundle.localizedStringForKey(key, value:value, table:nil)
end
|
.p(arg) ⇒ Object
I had issues with #p on the device, this is a temporary workaround
27
28
29
|
# File 'motion/core.rb', line 27
def p(arg)
NSLog arg.inspect
end
|
.require(file_spec, &block) ⇒ Object
23
24
25
|
# File 'lib/bubble-wrap/loader.rb', line 23
def require(file_spec, &block)
Requirement.scan(caller.first, file_spec, &block)
end
|
.require_ios(requirement = nil, &callback) ⇒ Object
27
28
29
30
31
32
33
|
# File 'lib/bubble-wrap/loader.rb', line 27
def require_ios(requirement = nil, &callback)
if !Motion::Project::App.osx?
callback.call
else
puts "bubble-wrap/#{requirement} requires iOS to use." if requirement
end
end
|
.require_osx(requirement = nil, &callback) ⇒ Object
35
36
37
38
39
40
41
|
# File 'lib/bubble-wrap/loader.rb', line 35
def require_osx(requirement = nil, &callback)
if Motion::Project::App.osx?
callback.call
else
puts "bubble-wrap/#{requirement} requires OS X to use." if requirement
end
end
|
.rgb_color(r, g, b) ⇒ UIcolor
5
6
7
|
# File 'motion/core.rb', line 5
def rgb_color(r,g,b)
rgba_color(r,g,b,1)
end
|
.rgba_color(r, g, b, a) ⇒ UIcolor
10
11
12
13
14
15
16
17
18
19
20
|
# File 'motion/core.rb', line 10
def rgba_color(r,g,b,a)
r,g,b = [r,g,b].map { |i| i / 255.0}
if a > 1.0
a = a / 255.0
end
if App.osx?
NSColor.colorWithDeviceRed(r, green: g, blue: b, alpha: a)
else
UIColor.colorWithRed(r, green: g, blue:b, alpha:a)
end
end
|
.root ⇒ Object
19
20
21
|
# File 'lib/bubble-wrap/loader.rb', line 19
def root
File.expand_path('../../../', __FILE__)
end
|
.use_weak_callbacks=(val) ⇒ Object
16
17
18
|
# File 'motion/shortcut.rb', line 16
def self.use_weak_callbacks=(val)
BubbleWrap::SETTINGS[:use_weak_callbacks] = val
end
|
.use_weak_callbacks? ⇒ Boolean
20
21
22
|
# File 'motion/shortcut.rb', line 20
def self.use_weak_callbacks?
BubbleWrap::SETTINGS[:use_weak_callbacks]
end
|
Instance Method Details
#version ⇒ Object
24
25
26
|
# File 'motion/shortcut.rb', line 24
def version
BubbleWrap::VERSION
end
|