redpotion 0.4.3 → 0.4.4

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: 73d8326b26ae6284ae9c6c58476f80507e244896
4
- data.tar.gz: 74d67d9d664a05e3757b0f16a95f746b76c0962b
3
+ metadata.gz: a82cd8a16ab8d593ccaf23b3229b124fff375b01
4
+ data.tar.gz: ce2f2d42f787af50b6f6728c9c630bf144097bf1
5
5
  SHA512:
6
- metadata.gz: 0818aae920f87967947b14df4b4031f53ac90c11afd998200f25eb8bbf916c345341b23673168f6773466bddcbbfbdda92321d8b417e84bce47cf45a59e8362e
7
- data.tar.gz: e4d3e57273d8743d9127de66fb9e9e8e0bffa0ccbecdab8c28b0c74f6a72882a0ade42807236183b969788f9c77155395012dab47e0c4b54098d539f8077fad2
6
+ metadata.gz: ce38d4c0d433364e742d991c66f4894ecd7f9b15e41dad4b637ccb88dc2aa622d6b86664d7e5819c35fd61a5ef3c92989adbb7b8950b5385b5933cef785899e6
7
+ data.tar.gz: cf6dd82b2f44346df83f223761cdac133e58ed7952d956d0cd8761d1a74dc23b31f593e63eb4103c2a5d3e2c2ce198119b150849a6ae53e86ddcae3313b21ba6
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # RedPotion
4
4
 
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.
5
+ We believe iPhone development should be clean, scalable, and fast with a langauge that developers not only enjoy, but actively choose. With the advent of Ruby for iPhone development the RubyMotion community has combined and tested the most active and powerful gems into a single package called **RedPotion**
6
6
 
7
- Its goals are to choose standard libraries and promote best practices, allowing you to develop iOS apps in record time.
7
+ 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 [MotionPrint](https://github.com/MohawkApps/motion_print). It also adds new features to better integrate RMQ with ProMotion. The goal is simply to choose standard libraries and promote best practices, allowing you to develop iOS apps in record time.
8
8
 
9
9
  =========
10
10
 
@@ -34,6 +34,21 @@ rake pod:install
34
34
  rake
35
35
  ```
36
36
 
37
+ ## Installation
38
+
39
+ - `gem install redpotion`
40
+
41
+ If you use rbenv
42
+
43
+ - `rbenv rehash`
44
+
45
+ add it to your `Gemfile`:
46
+
47
+ - `gem 'redpotion'`
48
+
49
+ Do **NOT** use RedPotion from github, we don't know why, but it will throw exceptions if you do; we're currently investigating why.
50
+
51
+
37
52
  ## New generators to integrate RMQ & ProMotion nicely ##
38
53
 
39
54
  Our new generates allow you to create your ProMotion screen and stylesheet template to let you hit the ground running. Currently the following RedPotion generators exist:
@@ -41,11 +56,12 @@ Our new generates allow you to create your ProMotion screen and stylesheet templ
41
56
  ```
42
57
  potion create screen foo
43
58
  potion create table_screen foo
59
+ potion create view foo
60
+
44
61
  # All rmq generators work with the potion command as well
45
62
  potion create model foo
46
- potion create view bar
47
- potion create shared some_class_used_app_wide
48
- potion create lib some_class_used_by_multiple_apps
63
+ potion create shared foo
64
+ potion create lib foo
49
65
 
50
66
  # rmq controller generators also still exist
51
67
  # but screens are preferred to get the redpotion value
@@ -104,13 +120,31 @@ class HomeScreen < PM::Screen
104
120
  end
105
121
  ```
106
122
 
123
+ ### rmq_build can now be called on_load
124
+
125
+ You can use either rmq_build or on_load, they do exactly the same thing. You can only use one or the other. `on_load` is preferred as it matches the screen's onload.
126
+
127
+ ```ruby
128
+ class Section < UIView
129
+ def on_load
130
+ apply_style :section
131
+
132
+ append(UIButton, :section_button).on(:touch) do
133
+ mp "Button touched"
134
+ end
135
+ end
136
+ end
137
+ ```
138
+
139
+
107
140
  ## New features for ProMotion
108
141
 
109
- None so far. ProMotion is perfect just as it is :-)
142
+ ProMotion 2.2.0 added on_load and on_styled to match RedPotion
110
143
 
111
144
 
112
145
  ## Contributing
113
146
 
147
+ 0. Create an issue in GitHub to make sure your PR will be accepted.
114
148
  1. Fork it
115
149
  2. Create your feature branch (`git checkout -b my-new-feature`)
116
150
  3. Commit your changes (`git commit -am 'Add some feature'`)
@@ -1,9 +1,7 @@
1
1
  module ProMotion
2
2
  module ScreenModule
3
3
  def view_did_load
4
- if self.class.rmq_style_sheet_class.nil?
5
- puts "[Redpotion Error] Stylesheet should be set in #{self.class}, ex: 'stylesheet #{self.class}Stylesheet'"
6
- else
4
+ if self.class.rmq_style_sheet_class
7
5
  self.rmq.stylesheet = self.class.rmq_style_sheet_class
8
6
  self.view.rmq.apply_style :root_view
9
7
  end
@@ -17,6 +17,16 @@ class UIView
17
17
  def on_load
18
18
  end
19
19
 
20
+ def on_styled
21
+ end
22
+
23
+ # You can user either rmq_style_applied or on_styled, not both. If you have both on_styled will be ignored,
24
+ # you can however call it from rmq_style_applied. They are the same, on_styled follows the Promotion style
25
+ # and is recommended.
26
+ def rmq_style_applied
27
+ on_styled
28
+ end
29
+
20
30
  def append(view_or_constant, style=nil, opts = {})
21
31
  rmq(self).append(view_or_constant, style, opts)
22
32
  end
@@ -68,6 +78,17 @@ class UIView
68
78
  def font
69
79
  rmq.font
70
80
  end
81
+
82
+ def image
83
+ rmq.image
84
+ end
85
+
86
+ def stylesheet
87
+ rmq.stylesheet
88
+ end
89
+ def stylesheet=(value)
90
+ rmq.stylesheet = value
91
+ end
71
92
  end
72
93
 
73
94
  class UIViewController
@@ -116,4 +137,15 @@ class ProMotion::ScreenModule
116
137
  def font
117
138
  rmq.font
118
139
  end
140
+
141
+ def image
142
+ rmq.image
143
+ end
144
+
145
+ def stylesheet
146
+ rmq.stylesheet
147
+ end
148
+ def stylesheet=(value)
149
+ rmq.stylesheet = value
150
+ end
119
151
  end
@@ -1,3 +1,3 @@
1
1
  module RedPotion
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
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.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfiniteRed
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-06 00:00:00.000000000 Z
12
+ date: 2014-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby_motion_query