motion-takeoff 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/project/messages.rb +9 -4
- data/lib/project/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63e9c4e2d87bf7844403cdb939abf2ca394a40ca
|
4
|
+
data.tar.gz: 23133aae28e1202524cafc424483f8b0b0335f39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f50f31776a4480a244e7bc9421de3d53675b9437fa45cec8d5b777fcba0179569233bfecd53fed4b657cf0a1076cb7bec3954d8d7c274873f11d57f2efb7876
|
7
|
+
data.tar.gz: d409a0b4a84972eafdad3fc6630bf80d8816253ed1e762351396331d7f49945a40123c91a8d00659abbcd5373be7163c7cec3e757cb058e78fbc00f311a0608a
|
data/README.md
CHANGED
@@ -23,9 +23,9 @@ Open your app delegate and in your `applicationDidBecomeActive:` method do somet
|
|
23
23
|
```ruby
|
24
24
|
def applicationDidBecomeActive(application)
|
25
25
|
messages = MotionTakeoff::Messages.new
|
26
|
-
messages.
|
27
|
-
messages.
|
28
|
-
messages.
|
26
|
+
messages.schedule launch:1, title:"Welcome to #{App.name}!", message:"Thanks for checking it out!"
|
27
|
+
messages.schedule launch:3, title:"Quick Tip:", message:"This is the 3rd time you've launched this application!"
|
28
|
+
messages.schedule launch:500, title:"Quick Tip:", message:"This is the 500th time you've launched this application!"
|
29
29
|
messages.takeoff
|
30
30
|
end
|
31
31
|
```
|
data/lib/project/messages.rb
CHANGED
@@ -1,18 +1,23 @@
|
|
1
1
|
module MotionTakeoff
|
2
2
|
class Messages
|
3
|
+
attr_accessor :messages
|
3
4
|
|
4
5
|
def initialize
|
5
|
-
|
6
|
+
self.messages = []
|
6
7
|
@launch_key = 'motion_takeoff_launch_count'
|
7
8
|
handle_launch
|
8
9
|
end
|
9
10
|
|
10
|
-
def
|
11
|
-
|
11
|
+
def schedule(opts={})
|
12
|
+
raise "You must specify a :launch" unless opts[:launch]
|
13
|
+
raise "You must specify a :title" unless opts[:title]
|
14
|
+
raise "You must specify a :message" unless opts[:message]
|
15
|
+
|
16
|
+
self.messages << opts
|
12
17
|
end
|
13
18
|
|
14
19
|
def takeoff
|
15
|
-
|
20
|
+
self.messages.each do |message|
|
16
21
|
if message[:launch] == App::Persistence[@launch_key]
|
17
22
|
App.alert(message[:title], message:message[:message])
|
18
23
|
end
|
data/lib/project/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-takeoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickert
|
@@ -77,3 +77,4 @@ summary: A RubyMotion specific iOS gem that helps you do things at launch. You c
|
|
77
77
|
use this gem to display messages at certain launch counts and remind users to use
|
78
78
|
your app.
|
79
79
|
test_files: []
|
80
|
+
has_rdoc:
|