motion-takeoff 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 892428cb8adf421a5e32d48ec69fc0fe9e577388
4
- data.tar.gz: 350b88873a1d02a82c04d2c725d9e52782dfdc52
3
+ metadata.gz: 63e9c4e2d87bf7844403cdb939abf2ca394a40ca
4
+ data.tar.gz: 23133aae28e1202524cafc424483f8b0b0335f39
5
5
  SHA512:
6
- metadata.gz: 0abd181eafbc8aff7ae8420eca855434e66682fce004f886843cbb677fad6070ace6c6e4da9cc84b3adc6e9f16f4b94a4d4be501f5a4301813688111222e1b20
7
- data.tar.gz: 1a281344fe8d4b767810d13b2968435c13be18a9ce742aee2816a0caff32a70c3c47f89110c922eb69f90d1711c1fbb4c3bf2a59897f8eb1e857ed25057d00bb
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.message launch:1, title:"Welcome to #{App.name}!", message:"Thanks for checking it out!"
27
- messages.message launch:3, title:"Quick Tip:", message:"This is the 3rd time you've launched this application!"
28
- messages.message launch:500, title:"Quick Tip:", message:"This is the 500th time you've launched this application!"
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
  ```
@@ -1,18 +1,23 @@
1
1
  module MotionTakeoff
2
2
  class Messages
3
+ attr_accessor :messages
3
4
 
4
5
  def initialize
5
- @messages = []
6
+ self.messages = []
6
7
  @launch_key = 'motion_takeoff_launch_count'
7
8
  handle_launch
8
9
  end
9
10
 
10
- def message(opts={})
11
- @messages << opts
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
- @messages.each do |message|
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
@@ -1,3 +1,3 @@
1
1
  module MotionTakeoff
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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.2
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: