redpotion 0.2.2 → 0.2.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: bb03398985a0332c5dad7504fda2dc5b4dbcaa23
4
- data.tar.gz: 610227da65e2617d7df7cca5d694cfec7b7aa8a5
3
+ metadata.gz: 756184a2533ad4369d815d53d3ae71ec32e7157c
4
+ data.tar.gz: 75c3450c780ec77e6f4a539ddea4f8ed84768a1f
5
5
  SHA512:
6
- metadata.gz: edd653ab74017815a1c5406ec9ad585b632efa88ff8ef99922925225cb16c1d0d0e4d1c7a9ff872547af37a36a597f1bf4c56c0f8a3b64c85d87e4ff34f27272
7
- data.tar.gz: 5d9034267124e08c4ac445abbe0d72e7c2c738e304899eb12685a7777225558611f7538c02d35fee827d9485603920aba065b5105f45f9e683d8f70b1aac64fb
6
+ metadata.gz: 8163e4135e1c555b0b4e32e3857b926a4fe0c312f38a372a1a89782fca6dde6ca0bbcaeb0ccba80d7dcca5aa2ba32ecfa9b014341a5f1651c8add8fbdc416fff
7
+ data.tar.gz: dcc44512449649ed775ac236345de6fef279953d7b188b90e8d08c212ba7d3f9506449d1c7b978dfdd3f50a00d654b322316ec0c475d16435d37eba8a469ee34
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  RedPotion combines [RMQ](http://rubymotionquery.com/), [ProMotion](https://github.com/clearsightstudio/ProMotion), [CDQ](https://github.com/infinitered/cdq), [AFMotion](https://github.com/clayallsopp/afmotion), and other libraries. It also adds new features to better integrate RMQ with ProMotion.
6
6
 
7
- Its goals are to choose standard libraries and promote best practices, allowing you to developed iOS apps in record time.
7
+ Its goals are to choose standard libraries and promote best practices, allowing you to develop iOS apps in record time.
8
8
 
9
9
  =========
10
10
 
@@ -37,12 +37,65 @@ potion create screen table states # This doesn't work yet
37
37
  rake
38
38
  ```
39
39
 
40
- ![image](http://ir_wp.s3.amazonaws.com/wp-content/uploads/sites/11/2014/11/pm_table.png)
40
+ ## New features for RMQ
41
+
42
+ ### You can use `find` instead of `rmq` in your views or screens
43
+
44
+ ```ruby
45
+ find.all.hide
46
+ find(my_view).children.nudge(right: 10)
47
+ ```
48
+
49
+ ### You can use `app` directly in code, which is the same as `rmq.app`
50
+
51
+ So you also get window, device, and delegate from that.
52
+
53
+ ```
54
+ app.device
55
+ app.window
56
+ app.delegate
57
+ ```
58
+
59
+ ### You can use the folling in a UIView or Screen or UIViewController without prefacing it with `rmq`:
60
+
61
+ ```ruby
62
+ append
63
+ append!
64
+ prepend
65
+ prepend!
66
+ create
67
+ create!
68
+ build
69
+ build!
70
+ on
71
+ apply_style
72
+ reapply_styles
73
+ style
74
+ ```
75
+
76
+ ### Stylesheet in your screens
77
+
78
+ You can specify the stylesheet in your screen like so:
79
+
80
+ ```ruby
81
+ class HomeScreen < PM::Screen
82
+ title "RedPotion"
83
+ stylesheet HomeStylesheet
84
+
85
+ def on_load
86
+ end
87
+ end
88
+ ```
89
+
90
+ ## New features for ProMotion
91
+
92
+ None so far. ProMotion is perfect just as it is :-)
93
+
41
94
 
42
95
  ## Contributing
43
96
 
44
97
  1. Fork it
45
- 2. Create your feature branch (`git checkoutut -b my-new-feature`)
98
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
46
99
  3. Commit your changes (`git commit -am 'Add some feature'`)
47
100
  4. Push to the branch (`git push origin my-new-feature`)
48
101
  5. Create new Pull Request
data/bin/potion CHANGED
@@ -64,6 +64,7 @@ class PotionCommandLine
64
64
  Complete. Things you should do:
65
65
  > cd #{app_name}
66
66
  > bundle
67
+ > rake pod:install
67
68
  > rake spec
68
69
  > rake
69
70
  (main)> exit
@@ -0,0 +1,28 @@
1
+ module ProMotion
2
+ module ScreenModule
3
+ def view_did_load
4
+ self.rmq.stylesheet = self.class.rmq_style_sheet_class
5
+ self.view.rmq.apply_style :root_view
6
+
7
+ self.on_load
8
+ end
9
+
10
+ module RedPotionClassMethods
11
+ def stylesheet(style_sheet_class)
12
+ @rmq_style_sheet_class = style_sheet_class
13
+ end
14
+
15
+ def rmq_style_sheet_class
16
+ @rmq_style_sheet_class
17
+ end
18
+ end
19
+
20
+ def self.included(base)
21
+ base.extend(ClassMethods)
22
+ base.extend(TabClassMethods) # TODO: Is there a better way?
23
+ base.extend(RedPotionClassMethods)
24
+ end
25
+
26
+ end
27
+
28
+ end
@@ -0,0 +1,9 @@
1
+ module RubyMotionQuery
2
+ class App
3
+ class << self
4
+ def current_screen(root_view_controller = nil)
5
+ current_view_controller root_view_controller
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,93 @@
1
+ class Object
2
+ def app
3
+ rmq.app
4
+ end
5
+
6
+ alias :find :rmq
7
+ end
8
+
9
+ class UIView
10
+ def append(view_or_constant, style=nil, opts = {})
11
+ rmq(self).append(view_or_constant, style, opts)
12
+ end
13
+ def append!(view_or_constant, style=nil, opts = {})
14
+ rmq(self).append!(view_or_constant, style, opts)
15
+ end
16
+
17
+ def prepend(view_or_constant, style=nil, opts = {})
18
+ rmq(self).prepend(view_or_constant, style, opts)
19
+ end
20
+ def prepend!(view_or_constant, style=nil, opts = {})
21
+ rmq(self).prepend!(view_or_constant, style, opts)
22
+ end
23
+
24
+ def create(view_or_constant, style=nil, opts = {})
25
+ rmq(self).create(view_or_constant, style, opts)
26
+ end
27
+ def create!(view_or_constant, style=nil, opts = {})
28
+ rmq(self).create!(view_or_constant, style, opts)
29
+ end
30
+
31
+ def build(view, style = nil, opts = {})
32
+ rmq(self).build(view, style, opts)
33
+ end
34
+ def build!(view, style = nil, opts = {})
35
+ rmq(self).build!(view, style, opts)
36
+ end
37
+
38
+ def on(event, args = {}, &block)
39
+ rmq(self).on(event, args, block)
40
+ end
41
+
42
+ def apply_style(style_name)
43
+ rmq(self).apply_style(style_name)
44
+ end
45
+
46
+ def reapply_styles
47
+ rmq(self).reapply_styles
48
+ end
49
+
50
+ def style(&block)
51
+ rmq(self).style(block)
52
+ end
53
+ end
54
+
55
+ class UIViewController
56
+ def on_load
57
+ # Abstract
58
+ end
59
+ end
60
+
61
+ class ProMotion::Screen
62
+ def append(view_or_constant, style=nil, opts = {})
63
+ rmq(view).append(view_or_constant, style, opts)
64
+ end
65
+ def append!(view_or_constant, style=nil, opts = {})
66
+ rmq(view).append!(view_or_constant, style, opts)
67
+ end
68
+
69
+ def prepend(view_or_constant, style=nil, opts = {})
70
+ rmq(view).prepend(view_or_constant, style, opts)
71
+ end
72
+ def prepend!(view_or_constant, style=nil, opts = {})
73
+ rmq(view).prepend!(view_or_constant, style, opts)
74
+ end
75
+
76
+ def create(view_or_constant, style=nil, opts = {})
77
+ rmq(view).create(view_or_constant, style, opts)
78
+ end
79
+ def create!(view_or_constant, style=nil, opts = {})
80
+ rmq(view).create!(view_or_constant, style, opts)
81
+ end
82
+
83
+ def build(view, style = nil, opts = {})
84
+ rmq(view).build(view, style, opts)
85
+ end
86
+ def build!(view, style = nil, opts = {})
87
+ rmq(view).build!(view, style, opts)
88
+ end
89
+
90
+ def reapply_styles
91
+ rmq.all.reapply_styles
92
+ end
93
+ end
@@ -0,0 +1,9 @@
1
+ module RubyMotionQuery
2
+ class RMQ
3
+ # TODO Why doesn't this work?
4
+ #alias :screen :view_controller
5
+ def screen
6
+ view_controller
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module RedPotion
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redpotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfiniteRed
@@ -78,7 +78,11 @@ extra_rdoc_files: []
78
78
  files:
79
79
  - README.md
80
80
  - bin/potion
81
+ - lib/project/pro_motion/screen_module.rb
81
82
  - lib/project/redpotion.rb
83
+ - lib/project/ruby_motion_query/app.rb
84
+ - lib/project/ruby_motion_query/ext.rb
85
+ - lib/project/ruby_motion_query/traverse.rb
82
86
  - lib/project/version.rb
83
87
  - lib/redpotion.rb
84
88
  homepage: https://github.com/infinitered/redpotion