redpotion 0.8.0 → 0.9.9

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: 5b2339609cecb6f72f5ee17ffb562162cf2b5dfe
4
- data.tar.gz: fafd090fbf3e52072d532dcd40b4a434d0a4a08f
3
+ metadata.gz: 0ce83e9bdb3ee96d1c3d24c9fcb5ab3ded6d0fcb
4
+ data.tar.gz: ad6c9c0bd404a4259d76d85ef45229e2cc6b178d
5
5
  SHA512:
6
- metadata.gz: 799de6061b23e2ed4b7489d510107ae316c8dd9d6209c0aad1c5a68ac50e33a88115e493d936e6a0bea14c027a28007e679d5d846dda09892197c1d41c599e9e
7
- data.tar.gz: d76d97fc557548140b7da2178e902d824b00c76b0a255da4e2a054b6b3c0963acb72fd1225caed196106bac3a7a3dc2a60b3edea905091e8cf732db917c091d0
6
+ metadata.gz: f7ccdb616b3333f2f919cfde89838ebac19412e2f09922f3d5fa15eb286aa86e9d60c7de9329b990e572b5fd286541db095d24e11d4fc5fabdfa278dd94f7fe3
7
+ data.tar.gz: 8f14b41597a104113ead9b9c28e7ba9f2c2349d263a1de4bc524bb1219c5b0af418137823b4775000ae360704eb005bab8bb1c2a5094e36979bd8776ae806c89
data/README.md CHANGED
@@ -2,9 +2,14 @@
2
2
 
3
3
  # RedPotion
4
4
 
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**
5
+ [![Dependency Status](https://gemnasium.com/infinitered/redpotion.png)](https://gemnasium.com/infinitered/redpotion)
6
+ [![Build Status](https://travis-ci.org/infinitered/redpotion.png?branch=master)](https://travis-ci.org/infinitered/redpotion)
7
+ [![Gem Version](https://badge.fury.io/rb/redpotion.png)](http://badge.fury.io/rb/redpotion)
8
+ [![Code Quality](https://codeclimate.com/github/infinitered/redpotion/badges/gpa.svg)](https://codeclimate.com/github/infinitered/redpotion)
6
9
 
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.
10
+ We believe iPhone development should be clean, scalable, and fast with a language 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**
11
+
12
+ RedPotion combines [RMQ](http://rubymotionquery.com/), [ProMotion](https://github.com/clearsightstudio/ProMotion), [CDQ](https://github.com/infinitered/cdq), [AFMotion](https://github.com/clayallsopp/afmotion), [MotionPrint](https://github.com/OTGApps/motion_print) and [MORE!](#full-listing-of-gems-and-pods-for-redpotion). 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
13
 
9
14
  =========
10
15
 
@@ -51,7 +56,7 @@ Do **NOT** use RedPotion from github, we don't know why, but it will throw excep
51
56
 
52
57
  ## New generators to integrate RMQ & ProMotion nicely ##
53
58
 
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:
59
+ Our new generators allow you to create your ProMotion screen and stylesheet template to let you hit the ground running. Currently the following RedPotion generators exist:
55
60
 
56
61
  ```
57
62
  potion create screen foo
@@ -145,6 +150,31 @@ class Section < UIView
145
150
  end
146
151
  ```
147
152
 
153
+ ### Remote image loading for UIImageView styler
154
+
155
+ You can set `remote_image` to a URL string or an instance of `NSURL` and it will automatically fetch the image and set the image (with caching) using the power of [JMImageCache](https://github.com/jakemarsh/JMImageCache).
156
+
157
+ ```ruby
158
+ class MyStylesheet < ApplicationStylesheet
159
+ def my_ui_image_view(st)
160
+ # placeholder_image= is just an alias to image=
161
+ # Set the placeholder image you want from your resources directory
162
+ st.placeholder_image = image.resource("my_placeholder")
163
+ # Set the remote URL. It will be applied to the UIImageView
164
+ # when downloaded or retrieved from the local cache.
165
+ st.remote_image = "http://www.rubymotion.com/img/rubymotion-logo.png"
166
+ # or st.remote_image = NSURL.urlWithString(...)
167
+ end
168
+ end
169
+ ```
170
+
171
+ In order to use this feature, you must add the `JMIMageCache` cocoapod to your project:
172
+
173
+ ```ruby
174
+ app.pods do
175
+ pod 'JMImageCache'
176
+ end
177
+ ```
148
178
 
149
179
  ## New features for ProMotion
150
180
 
@@ -159,6 +189,20 @@ UIColor has a `with` method. Allowing you to build a color from an existing col
159
189
  color.my_custom_color.with(a: 0.5)
160
190
  ```
161
191
 
192
+ ## Full listing of Gems and Pods for RedPotion
193
+ **Gems**
194
+ * [RMQ](http://rubymotionquery.com/)
195
+ * [ProMotion](https://github.com/clearsightstudio/ProMotion)
196
+ * [CDQ](https://github.com/infinitered/cdq)
197
+ * [AFMotion](https://github.com/clayallsopp/afmotion)
198
+ * [motion_print](https://github.com/OTGApps/motion_print)
199
+ * [motion-cocoapods](https://github.com/HipByte/motion-cocoapods)
200
+ * (DEV) [webstub](https://github.com/nathankot/webstub)
201
+ * (DEV) [newclear](https://github.com/IconoclastLabs/newclear)
202
+
203
+ **Pods**
204
+ * [JMImageCache](https://github.com/jakemarsh/JMImageCache)
205
+
162
206
  ## Contributing
163
207
 
164
208
  0. Create an issue in GitHub to make sure your PR will be accepted.
data/bin/potion CHANGED
@@ -151,6 +151,9 @@ class PotionCommandLine
151
151
  elsif template_name =~ /.*screen/
152
152
  @screen_base = template_name.split('_').collect(&:capitalize).join
153
153
  template_name = 'screen'
154
+ elsif template_name == "model" && cdq_included?
155
+ puts `cdq create model #{name}`
156
+ return
154
157
  else
155
158
  # we dont have templates for these fallback to RMQ
156
159
  puts `rmq create #{template_name} #{name}`
@@ -232,6 +235,12 @@ class PotionCommandLine
232
235
  end
233
236
  end
234
237
  end
238
+
239
+ def cdq_included?
240
+ return false unless File.exist?("Gemfile.lock")
241
+ data = IO.readlines("Gemfile.lock")
242
+ data.any?{|l| l.match(/\s.cdq\s\(/) }
243
+ end
235
244
  end
236
245
  end
237
246
 
@@ -0,0 +1,21 @@
1
+ module RubyMotionQuery
2
+ module Stylers
3
+
4
+ class UIImageViewStyler < UIViewStyler
5
+
6
+ def remote_image=(value)
7
+ if @view.respond_to?("setImageWithURL:placeholder:")
8
+ value = NSURL.URLWithString(value) unless value.is_a?(NSURL)
9
+ @view.setImageWithURL(value, placeholder:@view.image)
10
+ else
11
+ puts "\n[RedPotion ERROR] tried to set remote_image without JMImageCache cocoapod. Please add this to your Rakefile: \n\napp.pods do\n pod \"JMImageCache\"\nend\n"
12
+ end
13
+ end
14
+
15
+ # This is the same functionality as image=
16
+ def placeholder_image=(value)
17
+ @view.image = value
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module RedPotion
2
- VERSION = "0.8.0"
2
+ VERSION = "0.9.9"
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.8.0
4
+ version: 0.9.9
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: 2015-02-23 00:00:00.000000000 Z
12
+ date: 2015-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby_motion_query
@@ -81,6 +81,34 @@ dependencies:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: webstub
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: newclear
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
84
112
  description: RedPotion - The best combination of RubyMotion tools and libraries
85
113
  email:
86
114
  - hello@infinitered.com
@@ -99,6 +127,7 @@ files:
99
127
  - lib/project/pro_motion/data_table_screen.rb
100
128
  - lib/project/pro_motion/table.rb
101
129
  - lib/project/ruby_motion_query/app.rb
130
+ - lib/project/ruby_motion_query/stylers/ui_image_view.rb
102
131
  - lib/project/ruby_motion_query/traverse.rb
103
132
  - lib/project/version.rb
104
133
  - lib/redpotion.rb