rmq_alerts 0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c756b5dd110b7c02cee7b037e0a40a40b7e475ee
4
+ data.tar.gz: 375c68ac2d859becf2eb7f4c63b4ae89f475b878
5
+ SHA512:
6
+ metadata.gz: 5b30a5632092dd7c242d173bb210c9fb8b0327d29788dd93195ae7b4387e226e5ad91655cdc50828575329d42177f09adf6de635722fe78a53f32f22fce76259
7
+ data.tar.gz: 6579c7b428b8716648b11094b5ec4079f8ebe2dc0d5dc8e7e1da203a41bb49da464446ef62c0dc390ab4de56a83ca4fd4707becf69f8462b4c989fa2abfd08bb
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ [![image](http://ir_wp.s3.amazonaws.com/wp-content/uploads/sites/19/2014/09/rmq_plugin.png)](http://rubymotionquery.com)
2
+
3
+ # rmq_alerts
4
+
5
+ rmq_alerts is an RMQ plugin that makes it very easy to create alert messages in iOS.
6
+
7
+ rmq_alerts intends to stay very light and provide specific functionality (to display alerts easily). This is a very early version and I will be adding more related functionality hopefully in the near future.
8
+
9
+ On my to-do list:
10
+
11
+ * Action sheets
12
+
13
+ That's it so far. You are more than welcome to submit PRs and suggest features in the issues section.
14
+
15
+ ## Installation
16
+
17
+ **Requires RMQ 0.9.0 or later, and iOS 7 or later**
18
+
19
+ To install rmq_alerts, write the following in your terminal:
20
+
21
+ `gem install rmq_alerts`
22
+
23
+ Or you can just include it in your RubyMotion app's Gemfile:
24
+
25
+ `gem 'rmq_alerts'`
26
+
27
+ ## Usage
28
+
29
+ The plugin adds an 'alert' method to RMQ. It has two required arguments (title and message).
30
+
31
+ ```ruby
32
+ rmq.alert('Title goes here', 'Message goes here')
33
+ ```
34
+
35
+ ```ruby
36
+ rmq.alert('Ops!', 'No connectivity!', cancel_button = 'Fine')
37
+ ```
38
+
39
+ The full method looks like this:
40
+
41
+ ```ruby
42
+ rmq.alert('title', 'message', cancel_button='Yes', other_buttons=['No'], delegate=self)
43
+ ```
44
+
45
+ It returns an rmq instance of the alert view.
46
+
47
+ ## Contributing
48
+
49
+ 1. Fork it
50
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
51
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
52
+ 4. Push to the branch (`git push origin my-new-feature`)
53
+ 5. Create new Pull Request
@@ -0,0 +1,22 @@
1
+ module RubyMotionQuery
2
+ class RMQ
3
+ # Creates and shows a UIAlertView.
4
+ # The first two parameters are required (title and message).
5
+ # It returns an rmq object.
6
+ # @return [RMQ]
7
+ def alert(title, message, cancel_button = 'OK', other_buttons = [], delegate = nil)
8
+ # TODO UIAlertView is deprecated in iOS 8. Should use UIAlertController for the future.
9
+ alert_view = UIAlertView.new
10
+ alert_view.title = title
11
+ alert_view.message = message
12
+ alert_view.addButtonWithTitle(cancel_button)
13
+ alert_view.cancelButtonIndex = 0
14
+ other_buttons.each do |b|
15
+ alert_view.addButtonWithTitle(b)
16
+ end
17
+ alert_view.delegate = delegate
18
+ alert_view.show
19
+ rmq(alert_view)
20
+ end
21
+ end
22
+ end
data/lib/rmq_alerts.rb ADDED
@@ -0,0 +1,10 @@
1
+ # encoding: utf-8
2
+
3
+ unless defined?(Motion::Project::Config)
4
+ raise "This file must be required within a RubyMotion project Rakefile."
5
+ end
6
+
7
+ lib_dir_path = File.dirname(File.expand_path(__FILE__))
8
+ Motion::Project::App.setup do |app|
9
+ app.files.unshift(Dir.glob(File.join(lib_dir_path, "project/**/*.rb")))
10
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rmq_alerts
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Abdullah Esmail
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby_motion_query
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: rmq_alerts is an RMQ plugin that makes it very easy to create alert messages
42
+ in iOS
43
+ email:
44
+ - abdullah.esmail@gmail.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - README.md
50
+ - lib/project/rmq_alerts.rb
51
+ - lib/rmq_alerts.rb
52
+ homepage: https://github.com/aesmail/rmq_alerts
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.2.2
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: rmq_alerts is an RMQ plugin that makes it very easy to create alert messages
76
+ in iOS
77
+ test_files: []