bubble-wrap 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
1
  .rake_tasks~
2
+ pkg/*
3
+ Gemfile.lock
2
4
  build/
3
5
  .DS_Store
data/README.md CHANGED
@@ -14,7 +14,9 @@ gem install bubble-wrap
14
14
  ```ruby
15
15
  require 'bubble-wrap'
16
16
  ```
17
+
17
18
  2. Now, you can use BubbleWrap extension in your app:
19
+
18
20
  ```ruby
19
21
  class AppDelegate
20
22
  def application(application, didFinishLaunchingWithOptions:launchOptions)
data/Rakefile CHANGED
@@ -1 +1,14 @@
1
- require "bundler/gem_tasks"
1
+ require "bundler/gem_tasks"
2
+ $:.unshift("/Library/RubyMotion/lib")
3
+ require 'motion/project'
4
+
5
+ Motion::Project::App.setup do |app|
6
+ app.name = 'MotionLibTestSuite'
7
+
8
+ app.development do
9
+ app.files << './lib/tests/test_suite_delegate.rb'
10
+ app.delegate_class = 'TestSuiteDelegate'
11
+ end
12
+
13
+ app.files += Dir.glob('./lib/bubble-wrap/**.rb')
14
+ end
@@ -31,19 +31,19 @@ module App
31
31
 
32
32
  def self.[]=(key, value)
33
33
  defaults = NSUserDefaults.standardUserDefaults
34
- defaults.setObject(value, forKey: storage_key(key))
34
+ defaults.setObject(value, forKey: storage_key(key.to_s))
35
35
  defaults.synchronize
36
36
  end
37
37
 
38
38
  def self.[](key)
39
39
  defaults = NSUserDefaults.standardUserDefaults
40
- defaults.objectForKey storage_key(key)
40
+ defaults.objectForKey storage_key(key.to_s)
41
41
  end
42
42
 
43
43
  private
44
44
 
45
45
  def self.storage_key(key)
46
- app_key + '_' + key
46
+ app_key + '_' + key.to_s
47
47
  end
48
48
  end
49
49
 
@@ -12,6 +12,16 @@ module Kernel
12
12
  UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad
13
13
  end
14
14
 
15
+ # Certifies that the device running the app has a Retina display
16
+ # @return [TrueClass, FalseClass] true will be returned if the device has a Retina display, false otherwise.
17
+ def retina?
18
+ if UIScreen.mainScreen.respondsToSelector('displayLinkWithTarget:selector:') && UIScreen.mainScreen.scale == 2.0
19
+ true
20
+ else
21
+ false
22
+ end
23
+ end
24
+
15
25
  # Verifies that the device running has a front facing camera.
16
26
  # @return [TrueClass, FalseClass] true will be returned if the device has a front facing camera, false otherwise.
17
27
  def front_camera?
@@ -4,12 +4,12 @@ class NSUserDefaults
4
4
 
5
5
  # Retrieves the object for the passed key
6
6
  def [](key)
7
- self.objectForKey(key)
7
+ self.objectForKey(key.to_s)
8
8
  end
9
9
 
10
10
  # Sets the value for a given key and save it right away.
11
11
  def []=(key, val)
12
- self.setObject(val, forKey: key)
12
+ self.setObject(val, forKey: key.to_s)
13
13
  self.synchronize
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module BubbleWrap
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bubble-wrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-22 00:00:00.000000000 Z
13
+ date: 2012-05-25 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: RubyMotion wrappers and helpers (Ruby for iOS) - Making Cocoa APIs more
16
16
  Ruby like, one API at a time. Fork away and send your pull request.
@@ -39,10 +39,10 @@ files:
39
39
  - lib/bubble-wrap/ui_button.rb
40
40
  - lib/bubble-wrap/ui_view_controller.rb
41
41
  - lib/bubble-wrap/version.rb
42
+ - lib/tests/test_suite_delegate.rb
42
43
  - spec/http_spec.rb
43
44
  - spec/json_spec.rb
44
45
  - spec/ns_notification_center_spec.rb
45
- - spec/spec_helper.rb
46
46
  - spec_helper_patch.diff
47
47
  homepage: https://github.com/mattetti/BubbleWrap
48
48
  licenses: []
@@ -73,4 +73,3 @@ test_files:
73
73
  - spec/http_spec.rb
74
74
  - spec/json_spec.rb
75
75
  - spec/ns_notification_center_spec.rb
76
- - spec/spec_helper.rb