redpotion 0.3.3 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8e4d048a7e5125b990c3f6561a68735f347a580
4
- data.tar.gz: e0e211d6791c47c6ecc80c6da00827538365f5d5
3
+ metadata.gz: b0deea12cefd00811de29eb3d9ae59da6b0bca9b
4
+ data.tar.gz: cbe219de2dcc3feac16fe920fa00bf89dd0125b7
5
5
  SHA512:
6
- metadata.gz: b9ea227eafa37228db1f1ce476a8b158c4a9b99476a8b6009591439ebf4660854b9c90715c28e02692bb58eac03309fa37675ea1ccbd7f24e1e6a08d516347ca
7
- data.tar.gz: 584cbf839500ff1c50572ca6690929a86765a3583a896879d3ad6194cdb6961a308ff484d42f0b54b6f43d6ae2e01fc1f6bdc9f446ea25c9f0ff4d3cc5464511
6
+ metadata.gz: 44f1b86f590eba11d47f3a25031b57104c6f57466641354d376bd1b7026107a0ea294adcfd9974a43ea0e8ce2eb31fe7f0c6d4a267c6d95c042528040e055ab2
7
+ data.tar.gz: a8f733ae1ba00bf1d1d4ca5ae91539f6a4ea35d25ae835aaf7cccb2da0e0d7d78725e551f7bc8a37bdb7ae9d3ce9ae7a9e95f27424e05708d4e2cd2df85a1300
@@ -50,6 +50,14 @@ class UIView
50
50
  def style(&block)
51
51
  rmq(self).style(&block)
52
52
  end
53
+
54
+ def color
55
+ rmq.color
56
+ end
57
+
58
+ def font
59
+ rmq.font
60
+ end
53
61
  end
54
62
 
55
63
  class UIViewController
@@ -60,34 +68,42 @@ end
60
68
 
61
69
  class ProMotion::Screen
62
70
  def append(view_or_constant, style=nil, opts = {})
63
- rmq(view).append(view_or_constant, style, opts)
71
+ view.append(view_or_constant, style, opts)
64
72
  end
65
73
  def append!(view_or_constant, style=nil, opts = {})
66
- rmq(view).append!(view_or_constant, style, opts)
74
+ view.append!(view_or_constant, style, opts)
67
75
  end
68
76
 
69
77
  def prepend(view_or_constant, style=nil, opts = {})
70
- rmq(view).prepend(view_or_constant, style, opts)
78
+ view.prepend(view_or_constant, style, opts)
71
79
  end
72
80
  def prepend!(view_or_constant, style=nil, opts = {})
73
- rmq(view).prepend!(view_or_constant, style, opts)
81
+ view.prepend!(view_or_constant, style, opts)
74
82
  end
75
83
 
76
84
  def create(view_or_constant, style=nil, opts = {})
77
- rmq(view).create(view_or_constant, style, opts)
85
+ view.create(view_or_constant, style, opts)
78
86
  end
79
87
  def create!(view_or_constant, style=nil, opts = {})
80
- rmq(view).create!(view_or_constant, style, opts)
88
+ view.create!(view_or_constant, style, opts)
81
89
  end
82
90
 
83
- def build(view, style = nil, opts = {})
84
- rmq(view).build(view, style, opts)
91
+ def build(view_or_constant, style = nil, opts = {})
92
+ view.build(view_or_constant, style, opts)
85
93
  end
86
- def build!(view, style = nil, opts = {})
87
- rmq(view).build!(view, style, opts)
94
+ def build!(view_or_constant, style = nil, opts = {})
95
+ view.build!(view_or_constant, style, opts)
88
96
  end
89
97
 
90
98
  def reapply_styles
91
99
  rmq.all.reapply_styles
92
100
  end
101
+
102
+ def color
103
+ view.color
104
+ end
105
+
106
+ def font
107
+ view.font
108
+ end
93
109
  end
@@ -1,3 +1,3 @@
1
1
  module RedPotion
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/redpotion.rb CHANGED
@@ -4,7 +4,10 @@ unless defined?(Motion::Project::Config)
4
4
  raise "This file must be required within a RubyMotion project Rakefile."
5
5
  end
6
6
 
7
+ require 'ruby_motion_query'
8
+ require 'ProMotion'
9
+
7
10
  lib_dir_path = File.dirname(File.expand_path(__FILE__))
8
11
  Motion::Project::App.setup do |app|
9
- app.files.unshift(Dir.glob(File.join(lib_dir_path, "project/**/*.rb")))
12
+ app.files.push(Dir.glob(File.join(lib_dir_path, "project/**/*.rb")))
10
13
  end
@@ -0,0 +1,23 @@
1
+ class <%= @name_camel_case %>Screen < PM::<%= @screen_base %>
2
+ title "Your title here"
3
+ stylesheet <%= @name_camel_case %>ScreenStylesheet
4
+
5
+ def on_load
6
+ end
7
+
8
+ # You don't have to reapply styles to all UIViews, if you want to optimize,
9
+ # another way to do it is tag the views you need to restyle in your stylesheet,
10
+ # then only reapply the tagged views, like so:
11
+ # def logo(st)
12
+ # st.frame = {t: 10, w: 200, h: 96}
13
+ # st.centered = :horizontal
14
+ # st.image = image.resource('logo')
15
+ # st.tag(:reapply_style)
16
+ # end
17
+ #
18
+ # # Then in willAnimateRotationToInterfaceOrientation
19
+ # find(:reapply_style).reapply_styles
20
+ def willAnimateRotationToInterfaceOrientation(orientation, duration: duration)
21
+ find.all.reapply_styles
22
+ end
23
+ end
@@ -0,0 +1,14 @@
1
+ class <%= @name_camel_case %>ScreenStylesheet < ApplicationStylesheet
2
+ # Add your view stylesheets here. You can then override styles if needed,
3
+ # example:
4
+ # # include FooStylesheet
5
+
6
+ def setup
7
+ # Add sytlesheet specific setup stuff here.
8
+ # Add application specific setup stuff in application_stylesheet.rb
9
+ end
10
+
11
+ def root_view(st)
12
+ st.background_color = color.white
13
+ end
14
+ end
@@ -0,0 +1,8 @@
1
+ describe '<%= @name_camel_case %>Screen' do
2
+
3
+ before do
4
+ end
5
+
6
+ after do
7
+ end
8
+ 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.3.3
4
+ version: 0.4.0
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-11-22 00:00:00.000000000 Z
12
+ date: 2014-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby_motion_query
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: motion-cocoapods
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: rake
58
72
  requirement: !ruby/object:Gem::Requirement
@@ -85,6 +99,9 @@ files:
85
99
  - lib/project/ruby_motion_query/traverse.rb
86
100
  - lib/project/version.rb
87
101
  - lib/redpotion.rb
102
+ - templates/screen/app/screens/name_screen.rb
103
+ - templates/screen/app/stylesheets/name_screen_stylesheet.rb
104
+ - templates/screen/spec/screens/name_screen_spec.rb
88
105
  homepage: https://github.com/infinitered/redpotion
89
106
  licenses:
90
107
  - MIT