RedPotion
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
RedPotion combines RMQ, ProMotion, CDQ, AFMotion, and MotionPrint. 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.
=========
The makers of RMQ at InfiniteRed and the creators of ProMotion at ClearSight Studio have teamed up to create the ultimate RubyMotion library.
ProMotion for screens and RMQ for styles, animations, traversing, events, etc.
Plugins and Add-ons
You can use both RMQ Plugins and ProMotion Add-ons
Quick start
gem install redpotion
potion create my_app
bundle
rake pod:install
rake
Installation
gem install redpotion
If you use rbenv
rbenv rehash
add it to your Gemfile
:
gem 'redpotion'
Do NOT use RedPotion from github, we don't know why, but it will throw exceptions if you do; we're currently investigating why.
New generators to integrate RMQ & ProMotion nicely
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:
potion create screen foo
potion create table_screen foo
potion create view foo
# All rmq generators work with the potion command as well
potion create model foo
potion create shared foo
potion create lib foo
# rmq controller generators also still exist
# but screens are preferred to get the redpotion value
potion create controller foo
potion create collection_view_controller foos
potion create table_view_controller
New features for RMQ
find
is aliased to rmq
so you can use it for a more natural reading code:
find.all.hide
find(my_view).children.nudge(right: 10)
You can use app
directly in code, which is the same as rmq.app
So you also get window, device, and delegate from that.
app.device
app.window
app.delegate
You can use the following in a UIView or Screen or UIViewController without prefacing it with rmq
:
append
append!
prepend
prepend!
create
create!
build
build!
on
apply_style
reapply_styles
style
Stylesheet in your screens
You can specify the stylesheet in your screen like so:
class HomeScreen < PM::Screen
title "RedPotion"
stylesheet HomeStylesheet
def on_load
end
end
rmq_build can now be called on_load
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.
class Section < UIView
def on_load
apply_style :section
append(UIButton, :section_button).on(:touch) do
mp "Button touched"
end
end
end
New features for ProMotion
ProMotion 2.2.0 added on_load and on_styled to match RedPotion
Contributing
- Create an issue in GitHub to make sure your PR will be accepted.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request