ruby_motion_query 1.3.5 → 1.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: 06135a6091495e91324d14b0618089880d6aa351
4
- data.tar.gz: 67755dca95594e80099768f3fc59020ed6cdd9e2
3
+ metadata.gz: 4974e8d15973e3c9779f9e52c15cfa6c6f0d0eff
4
+ data.tar.gz: f2786a5a374492f1b1a5fa8cc4ceb158f6ae3c47
5
5
  SHA512:
6
- metadata.gz: 2c5a21dbe01295ee3a7f3b132f33c49a11baf6074788bb2349c68a7b9920faaac99cf6d52544452b784da32787f939db17e1b94ee947edbf81da0bcd93b9f23d
7
- data.tar.gz: 6b282403f1eaf0a2b2a00ac22f37bac65f6dcc3472ee78e696d7da5f2197bc71c286503f1424faef08571ddbcf8b27f4e8dbf2bd33c07fbf70b62caf66392a1b
6
+ metadata.gz: 45e66f4112a717f3bc2a3f731350272b50c9005862a6e8e98140e4364925e8160c91b99480f72c75f3e7f573a58bd240303a607e4f46f8c6e9b3f1ea6a096c0b
7
+ data.tar.gz: 50a949f8719b931def023c917a5a1101eed61ea143a3b1d66927046ce2280d1bf677a3c9589123c16fcb6985826367eb9e4b76461e076abc8c33e7bc22f1eae0
data/README.md CHANGED
@@ -22,9 +22,9 @@ One of RMQ's goals is to have the best [documentation][1] of any RubyMotion UI l
22
22
 
23
23
  [![image](http://ir_wp.s3.amazonaws.com/wp-content/uploads/sites/19/2015/04/rmq_docs1.png)](http://rubymotionquery.com)
24
24
 
25
- **Read the [RMQ Documentation][1] here**<-
25
+ **Read the [RMQ Documentation][1] here**
26
26
 
27
- **If you like RMQ, check out [RedPotion](http://redpotion.org), the ultimate gem for RubyMotion.**<-
27
+ **If you like RMQ, check out [RedPotion](http://redpotion.org), the ultimate gem for RubyMotion.**
28
28
 
29
29
  <br />
30
30
  <br />
data/motion/ext.rb CHANGED
@@ -73,7 +73,7 @@ if RUBYMOTION_ENV == "development"
73
73
  return unless root_path = RubyMotionQuery::RMQ.project_path
74
74
 
75
75
  # Get list of stylesheet files
76
- path_query = "#{root_path}/app/stylesheets/*.rb"
76
+ path_query = "#{root_path}/app/stylesheets/**/*.rb"
77
77
  stylesheet_file_paths = Dir.glob(path_query)
78
78
 
79
79
  stylesheets = stylesheet_file_paths.inject({}) do |out, stylesheet_path_file|
@@ -113,6 +113,13 @@ if RUBYMOTION_ENV == "development"
113
113
  if style_changed
114
114
  rmq_live_current_view_controllers.each do |vc|
115
115
  vc.rmq.all.and_self.reapply_styles
116
+ if vc.is_a? UITableViewController
117
+ if vc.respond_to?(:update_table_data)
118
+ vc.update_table_data # ProMotion-based
119
+ else
120
+ vc.tableView.reloadData # straight-up UITableView
121
+ end
122
+ end
116
123
  end
117
124
  end
118
125
  end
@@ -69,12 +69,16 @@ module RubyMotionQuery
69
69
 
70
70
  # @return [String] Version
71
71
  def version
72
- NSBundle.mainBundle.infoDictionary['CFBundleVersion']
72
+ info_plist['CFBundleVersion']
73
73
  end
74
74
 
75
75
  # @return [String] Short version
76
76
  def short_version
77
- NSBundle.mainBundle.infoDictionary['CFBundleShortVersionString']
77
+ info_plist['CFBundleShortVersionString']
78
+ end
79
+
80
+ def info_plist
81
+ NSBundle.mainBundle.infoDictionary
78
82
  end
79
83
 
80
84
  # @return [String] Name of app
@@ -80,7 +80,7 @@ module RubyMotionQuery
80
80
  # foo: foo,
81
81
  # bar: bar
82
82
  # })
83
- def self.assert(truthy, label = nil, objects = nil)
83
+ def assert(truthy, label = nil, objects = nil)
84
84
  if (RMQ.app.development? || RMQ.app.test?) && !truthy
85
85
  label ||= 'Assert failed'
86
86
  if block_given? && !objects
@@ -87,6 +87,18 @@ module RubyMotionQuery
87
87
  end
88
88
  end
89
89
 
90
+ # TODO, make rmq.format.date work with strings as well as templates
91
+ def formatter_from_string(s)
92
+ @_date_formatters ||= {}
93
+
94
+ # Caching here is very important for performance
95
+ @_date_formatters[s] ||= begin
96
+ date_formatter = NSDateFormatter.alloc.init
97
+ date_formatter.setDateFormat(s)
98
+ date_formatter
99
+ end
100
+ end
101
+
90
102
  def formatter_from_format(format)
91
103
  @_date_formatters ||= {}
92
104
 
@@ -112,7 +124,6 @@ module RubyMotionQuery
112
124
  @_date_formatters[styles.to_s] ||= begin
113
125
  date_formatter = NSDateFormatter.alloc.init
114
126
 
115
- date_formatter.setDateStyle(NSDateFormatterNoStyle)
116
127
  date_formatter.setDateStyle(NSDateFormatterNoStyle)
117
128
 
118
129
  styles.each do |style|
@@ -107,7 +107,7 @@ module RubyMotionQuery
107
107
  # app.info_plist["ProjectRootPath"] = File.dirname(__FILE__)
108
108
  # end
109
109
  def project_path
110
- if ppath = NSBundle.mainBundle.infoDictionary["ProjectRootPath"]
110
+ if ppath = app.info_plist["ProjectRootPath"]
111
111
  else
112
112
  puts %(
113
113
  [RMQ Warning] The project_path method requires that this code is in your RakeFile:
@@ -124,7 +124,7 @@ end)
124
124
  # app.info_plist["ProjectBuildTime"] = Time.now
125
125
  # end
126
126
  def build_time
127
- if btime = NSBundle.mainBundle.infoDictionary["ProjectBuildTime"]
127
+ if btime = app.info_plist["ProjectBuildTime"]
128
128
  else
129
129
  puts %(
130
130
  [RMQ Warning] The build_time method requires that this code is in your RakeFile:
@@ -139,4 +139,3 @@ end)
139
139
 
140
140
  end
141
141
  end
142
-
@@ -1,5 +1,5 @@
1
1
  module RubyMotionQuery
2
- VERSION = "1.3.5"
2
+ VERSION = "1.4.0"
3
3
 
4
4
  class RMQ
5
5
  def version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_motion_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Werth
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-29 00:00:00.000000000 Z
12
+ date: 2015-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bacon
@@ -152,3 +152,4 @@ signing_key:
152
152
  specification_version: 4
153
153
  summary: RubyMotionQuery - RMQ
154
154
  test_files: []
155
+ has_rdoc: