redpotion 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/bin/potion +3 -2
- data/lib/project/ruby_motion_query/ext.rb +12 -2
- data/lib/project/version.rb +1 -1
- data/templates/screen/app/screens/name_screen.rb +6 -0
- data/templates/view/app/stylesheets/name_stylesheet.rb +20 -0
- data/templates/view/app/views/name.rb +24 -0
- data/templates/view/spec/views/name.rb +9 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd0e461a2ce76f04e1b7034a8400b35bdd96b870
|
4
|
+
data.tar.gz: af9e7270ff4cb610d94a1c1a13bd9305d9eed8d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4a5913d0a7a2485c85b4a4396c716ed8c0637c7f8cd27eec29688205b5fd6f8206a046af51b5fe0083f2431106d5f86c896b81093e8e7b52c892a38327ef1b4
|
7
|
+
data.tar.gz: 6aea0c18be56964dbf9dfea89679ad299118374ec7675a67c765808607e3c99e30abfaa52b16d869499fc2b1ebfe70557ed61338ff2525ac0bcbe6fc576fce28
|
data/README.md
CHANGED
@@ -34,6 +34,26 @@ rake pod:install
|
|
34
34
|
rake
|
35
35
|
```
|
36
36
|
|
37
|
+
## New generators to integrate RMQ & ProMotion nicely ##
|
38
|
+
|
39
|
+
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:
|
40
|
+
|
41
|
+
```
|
42
|
+
potion create screen foo
|
43
|
+
potion create table_screen foo
|
44
|
+
# All rmq generators work with the potion command as well
|
45
|
+
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
|
49
|
+
|
50
|
+
# rmq controller generators also still exist
|
51
|
+
# but screens are preferred to get the redpotion value
|
52
|
+
potion create controller foo
|
53
|
+
potion create collection_view_controller foos
|
54
|
+
potion create table_view_controller bars
|
55
|
+
```
|
56
|
+
|
37
57
|
## New features for RMQ
|
38
58
|
|
39
59
|
### `find` is aliased to `rmq` so you can use it for a more natural reading code:
|
data/bin/potion
CHANGED
@@ -17,11 +17,12 @@ class PotionCommandLine
|
|
17
17
|
> potion create model foo
|
18
18
|
> potion create screen foo
|
19
19
|
> potion create table_screen foo
|
20
|
-
> potion create controller foos
|
21
20
|
> potion create view bar
|
22
21
|
> potion create shared some_class_used_app_wide
|
23
22
|
> potion create lib some_class_used_by_multiple_apps
|
24
23
|
|
24
|
+
You can still create controllers, but you should create screens instead
|
25
|
+
> potion create controller foos
|
25
26
|
> potion create collection_view_controller foos
|
26
27
|
> potion create table_view_controller bars
|
27
28
|
|
@@ -116,7 +117,7 @@ class PotionCommandLine
|
|
116
117
|
end
|
117
118
|
|
118
119
|
def insert_from_template(template_name, name)
|
119
|
-
unless %w{screen table_screen}.include? template_name
|
120
|
+
unless %w{screen table_screen view}.include? template_name
|
120
121
|
puts `rmq create #{template_name} #{name}`
|
121
122
|
return
|
122
123
|
else
|
@@ -7,6 +7,16 @@ class Object
|
|
7
7
|
end
|
8
8
|
|
9
9
|
class UIView
|
10
|
+
# You can use either rmq_build or on_load, not both. If you have both, on_load will be ignored,
|
11
|
+
# you can however call it from rmq_build. They are the same, on_load follows the ProMotion style
|
12
|
+
# and is recommended.
|
13
|
+
def rmq_build
|
14
|
+
on_load
|
15
|
+
end
|
16
|
+
|
17
|
+
def on_load
|
18
|
+
end
|
19
|
+
|
10
20
|
def append(view_or_constant, style=nil, opts = {})
|
11
21
|
rmq(self).append(view_or_constant, style, opts)
|
12
22
|
end
|
@@ -100,10 +110,10 @@ class ProMotion::ScreenModule
|
|
100
110
|
end
|
101
111
|
|
102
112
|
def color
|
103
|
-
|
113
|
+
rmq.color
|
104
114
|
end
|
105
115
|
|
106
116
|
def font
|
107
|
-
|
117
|
+
rmq.font
|
108
118
|
end
|
109
119
|
end
|
data/lib/project/version.rb
CHANGED
@@ -5,6 +5,12 @@ class <%= @name_camel_case %>Screen < PM::<%= @screen_base %>
|
|
5
5
|
def on_load
|
6
6
|
end
|
7
7
|
|
8
|
+
<% if @screen_base == 'TableScreen' %>
|
9
|
+
def table_data
|
10
|
+
[]
|
11
|
+
end
|
12
|
+
<% end %>
|
13
|
+
|
8
14
|
# You don't have to reapply styles to all UIViews, if you want to optimize,
|
9
15
|
# another way to do it is tag the views you need to restyle in your stylesheet,
|
10
16
|
# then only reapply the tagged views, like so:
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# To style this view include its stylesheet at the top of each controller's
|
2
|
+
# stylesheet that is going to use it:
|
3
|
+
# class SomeStylesheet < ApplicationStylesheet
|
4
|
+
# include <%= @name_camel_case %>Stylesheet
|
5
|
+
|
6
|
+
# Another option is to use your controller's stylesheet to style this view. This
|
7
|
+
# works well if only one controller uses it. If you do that, delete the
|
8
|
+
# view's stylesheet with:
|
9
|
+
# rm app/stylesheets/views/<%= @name %>_stylesheet.rb
|
10
|
+
|
11
|
+
module <%= @name_camel_case %>Stylesheet
|
12
|
+
|
13
|
+
def <%= @name %>(st)
|
14
|
+
st.frame = {l: 5, t: 100, w: 80, h: 40}
|
15
|
+
st.background_color = color.light_gray
|
16
|
+
|
17
|
+
# Style overall view here
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class <%= @name_camel_case %> < UIView
|
2
|
+
|
3
|
+
def on_load
|
4
|
+
apply_style :<%= @name %>
|
5
|
+
|
6
|
+
# Add subviews here, like so:
|
7
|
+
# append UILabel, :label_style_here
|
8
|
+
# -or-
|
9
|
+
# @submit_button = append(UIButton, :submit).get
|
10
|
+
# -or-
|
11
|
+
# @submit_button = append! UIButton, :submit
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
# To style this view include its stylesheet at the top of each controller's
|
17
|
+
# stylesheet that is going to use it:
|
18
|
+
# class SomeStylesheet < ApplicationStylesheet
|
19
|
+
# include <%= @name_camel_case %>Stylesheet
|
20
|
+
|
21
|
+
# Another option is to use your controller's stylesheet to style this view. This
|
22
|
+
# works well if only one controller uses it. If you do that, delete the
|
23
|
+
# view's stylesheet with:
|
24
|
+
# rm app/stylesheets/<%= @name %>_stylesheet.rb
|
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.
|
4
|
+
version: 0.4.2
|
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-
|
12
|
+
date: 2014-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby_motion_query
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '2.
|
34
|
+
version: '2.2'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '2.
|
41
|
+
version: '2.2'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: motion_print
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,6 +102,9 @@ files:
|
|
102
102
|
- templates/screen/app/screens/name_screen.rb
|
103
103
|
- templates/screen/app/stylesheets/name_screen_stylesheet.rb
|
104
104
|
- templates/screen/spec/screens/name_screen_spec.rb
|
105
|
+
- templates/view/app/stylesheets/name_stylesheet.rb
|
106
|
+
- templates/view/app/views/name.rb
|
107
|
+
- templates/view/spec/views/name.rb
|
105
108
|
homepage: https://github.com/infinitered/redpotion
|
106
109
|
licenses:
|
107
110
|
- MIT
|