motion-takeoff 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8a0e9931557bb9df3f1f61e5a519993cf56cdb2c
4
+ data.tar.gz: a619ba6d8893df56e0637eb121edb620d437e8d0
5
+ SHA512:
6
+ metadata.gz: 815e386a1ad38f9c3881da40326e0c4080101dd097fb3a0b352f8826f2db5d04277275ffeff44167a826b95ae4954434dffcfa037a5c9f6bcb514ee7a54e9bba
7
+ data.tar.gz: 75beefd0d6262c971af7ab34520b5433288719807e36855e816d2a39dc927d1ffd4c735b04084f610c672be2d9341d0ed5761510cbd1543573d31886bf3edd68
@@ -0,0 +1,42 @@
1
+ # motion-takeoff
2
+
3
+ A RubyMotion specific iOS gem that helps you do things at launch.
4
+
5
+ Currently, there is only one module in this gem: `Messages`. The `Messages` module will allow you to schedule alerts to users at certain launch counts. More modules are planned for the future.
6
+
7
+ This gem is in its infancy. Please help me make it better!
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'motion-takeoff'
14
+
15
+ And run: `bundle`
16
+
17
+ ## Usage: Messages Module
18
+
19
+ Open your app delegate and in your `applicationDidBecomeActive:` method do something like this:
20
+
21
+ ```ruby
22
+ def applicationDidBecomeActive(application)
23
+ messages = MotionTakeoff::Messages.new
24
+ messages.message launch:1, title:"Welcome to #{App.name}!", message:"Thanks for checking it out!"
25
+ messages.message launch:3, title:"Quick Tip:", message:"This is the 3rd time you've launched this application!"
26
+ messages.message launch:500, title:"Quick Tip:", message:"This is the 500th time you've launched this application!"
27
+ messages.takeoff
28
+ end
29
+ ```
30
+ This will display an alert to the user on the 1st, 3rd, and 500th launches of the app.
31
+
32
+ ## Future plans
33
+
34
+ I'd like it to be able to be a multi-purpose tool for doing things at launch other than just alerting users. Things like asking for ratings in the iTunes store and scheduling other activities likes clearing caches on the 10th load or checking a server every load, etc.
35
+
36
+ ## Contributing
37
+
38
+ 1. Fork it
39
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
40
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
41
+ 4. Push to the branch (`git push origin my-new-feature`)
42
+ 5. Create new Pull Request
@@ -0,0 +1,13 @@
1
+ unless defined?(Motion::Project::Config)
2
+ raise "This file must be required within a RubyMotion project Rakefile."
3
+ end
4
+
5
+ require "bubble-wrap/core"
6
+
7
+ module MotionTakeoff
8
+ end
9
+
10
+ lib_dir_path = File.dirname(File.expand_path(__FILE__))
11
+ Motion::Project::App.setup do |app|
12
+ app.files.unshift(Dir.glob(File.join(lib_dir_path, "project/**/*.rb")))
13
+ end
@@ -0,0 +1,33 @@
1
+ module MotionTakeoff
2
+ class Messages
3
+
4
+ def initialize
5
+ @messages = []
6
+ @launch_key = 'motion_takeoff_launch_count'
7
+ handle_launch
8
+ end
9
+
10
+ def message(opts={})
11
+ @messages << opts
12
+ end
13
+
14
+ def takeoff
15
+ @messages.each do |message|
16
+ if message[:launch] == App::Persistence[@launch_key]
17
+ App.alert(message[:title], message:message[:message])
18
+ end
19
+ end
20
+ end
21
+
22
+ private
23
+ def handle_launch
24
+ if App::Persistence[@launch_key].nil?
25
+ App::Persistence[@launch_key] = 1
26
+ else
27
+ App::Persistence[@launch_key] = App::Persistence[@launch_key] + 1
28
+ end
29
+ end
30
+
31
+ end
32
+ end
33
+
@@ -0,0 +1,3 @@
1
+ module MotionTakeoff
2
+ VERSION = '0.0.1'
3
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motion-takeoff
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mark Rickert
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bubble-wrap
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>'
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>'
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.0
41
+ description: A RubyMotion specific iOS gem that helps you do things at launch.
42
+ email:
43
+ - mjar81@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - README.md
49
+ - lib/motion-takeoff.rb
50
+ - lib/project/messages.rb
51
+ - lib/project/version.rb
52
+ homepage: https://www.github.com/MohawkApps/motion-takeoff
53
+ licenses:
54
+ - MIT
55
+ metadata: {}
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 2.0.3
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: A RubyMotion specific iOS gem that helps you do things at launch. You can
76
+ use this gem to display messages at certain launch counts.
77
+ test_files: []