teacup 2.1.11 → 2.1.12

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- teacup (2.1.11)
4
+ teacup (2.1.12)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/teacup/layout.rb CHANGED
@@ -165,7 +165,6 @@ module Teacup
165
165
  # one is not explicitly assigned to the view
166
166
  if view.is_a? Layout
167
167
  view.teacup_next_responder = WeakRef.new(self)
168
- # view.teacup_next_responder = self
169
168
  end
170
169
 
171
170
  if block_given?
@@ -125,19 +125,23 @@ module Teacup
125
125
  # @stylesheet_cache object is manipulated directly (to invalidate entries,
126
126
  # or the entire cache)
127
127
  def stylesheet_cache
128
- @stylesheet_cache ||= Hash.new do |cache,_stylename|
129
- cache[_stylename] = Hash.new do |_target,_orientation|
130
- _target[_orientation] = {}
131
- end
132
- end
128
+ return nil
129
+ # @stylesheet_cache ||= Hash.new do |by_stylename,_stylename|
130
+ # by_stylename[_stylename] = Hash.new do |by_target,_target|
131
+ # by_orientation = {}
132
+ # by_target[_target] = by_orientation
133
+ # end
134
+ # end
133
135
  end
134
136
 
135
137
  def get_stylesheet_cache(stylename, target, orientation)
136
- self.stylesheet_cache[stylename][target][orientation]
138
+ return nil
139
+ # self.stylesheet_cache[stylename][target][orientation]
137
140
  end
138
141
 
139
142
  def set_stylesheet_cache(stylename, target, orientation, value)
140
- self.stylesheet_cache[stylename][target][orientation] = value
143
+ return
144
+ # self.stylesheet_cache[stylename][target][orientation] = value
141
145
  end
142
146
 
143
147
  # Include another Stylesheet into this one, the rules defined
@@ -211,15 +215,17 @@ module Teacup
211
215
  return {} if seen[self]
212
216
  return {} unless stylename
213
217
 
214
- unless get_stylesheet_cache(stylename, target, orientation)
218
+ p stylename: stylename, target: target, orientation: orientation
219
+ if cached = get_stylesheet_cache(stylename, target, orientation)
220
+ return cached.dup
221
+ else
215
222
  run_block
216
223
  seen[self] = true
217
224
 
218
- set_stylesheet_cache(stylename, target, orientation, styles[stylename].build(target, orientation, seen))
225
+ built = styles[stylename].build(target, orientation, seen)
226
+ set_stylesheet_cache(stylename, target, orientation, built)
227
+ return built.dup
219
228
  end
220
-
221
- # mutable hashes could mess with our cache, so return a duplicate
222
- get_stylesheet_cache(stylename, target, orientation).dup
223
229
  end
224
230
 
225
231
  # Add a set of properties for a given stylename or multiple stylenames.
@@ -101,6 +101,8 @@ module Teacup
101
101
  layout(top_level_view, stylename, properties, &block)
102
102
  end
103
103
 
104
+ layoutDidLoad
105
+
104
106
  if should_restyle
105
107
  Teacup.should_restyle!
106
108
  self.top_level_view.restyle!
@@ -109,12 +111,9 @@ module Teacup
109
111
  if defined? NSLayoutConstraint
110
112
  self.top_level_view.apply_constraints
111
113
  end
112
-
113
- layoutDidLoad
114
114
  end
115
115
 
116
116
  def layoutDidLoad
117
- true
118
117
  end
119
118
 
120
119
  end
@@ -1,5 +1,5 @@
1
1
  module Teacup
2
2
 
3
- VERSION = '2.1.11'
3
+ VERSION = '2.1.12'
4
4
 
5
5
  end
@@ -25,9 +25,9 @@ describe "Application 'Teacup'" do
25
25
  it "root view should be styled as :root" do
26
26
  @root_view.stylename.should == :root
27
27
  @root_view.frame.origin.x.should == 0
28
- @root_view.frame.origin.y.should == 20
29
- @root_view.frame.size.width.should == 320
30
- @root_view.frame.size.height.should == 460
28
+ @root_view.frame.origin.y.should == 0
29
+ @root_view.frame.size.width.should == UIApplication.sharedApplication.keyWindow.frame.size.width
30
+ @root_view.frame.size.height.should == UIApplication.sharedApplication.keyWindow.frame.size.height
31
31
  @root_view.backgroundColor.should == UIColor.yellowColor
32
32
  end
33
33
 
@@ -19,7 +19,6 @@ describe "Memory leaks" do
19
19
 
20
20
  def controller
21
21
  unless @controller
22
- puts("=============== memory_leak_spec.rb line #{__LINE__} ===============")
23
22
  root = UIViewController.new
24
23
  @controller = UINavigationController.alloc.initWithRootViewController(root)
25
24
  end
@@ -31,7 +30,6 @@ describe "Memory leaks" do
31
30
  detector = LeakDetector.new
32
31
 
33
32
  memory_leak = MemoryLeakController.new
34
- p memory_leak.view
35
33
 
36
34
  NSNotificationCenter.defaultCenter.addObserver(detector,
37
35
  selector: :'did_dealloc:',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teacup
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.11
4
+ version: 2.1.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-04 00:00:00.000000000 Z
12
+ date: 2013-10-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'Teacup is a community-driven DSL for making CSS-like styling, and
15
15
  layouts for