sugarcube 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -346,11 +346,21 @@ Makes it easy to post a notification to some or all objects.
346
346
  @view.shake
347
347
  end
348
348
 
349
- # if you have a better name, I'll use it ;-)
350
349
  1.second.every do
351
350
  @view.shake
352
351
  end
353
352
 
353
+ # since that looks funny, an every method is available in the SugarCube::Timer module
354
+ include SugarCube::Timer
355
+ every 1.minute do
356
+ puts "tick"
357
+ end
358
+
359
+ # might as well make an alias
360
+ after 1.minute do
361
+ puts "ding!"
362
+ end
363
+
354
364
  # other time-related methods
355
365
  1.second || 2.seconds
356
366
  1.minute || 2.minutes # 60 seconds
@@ -21,7 +21,7 @@ module SugarCube
21
21
 
22
22
  view
23
23
  end
24
- alias :a :adjust
24
+ alias a adjust
25
25
 
26
26
  ##| FRAME
27
27
  def frame f=nil
@@ -32,13 +32,13 @@ module SugarCube
32
32
 
33
33
  @@sugarcube_view.frame = f
34
34
  end
35
- alias :f :frame
35
+ alias f frame
36
36
 
37
37
  ##| ORIGIN
38
38
  def left val=1
39
39
  SugarCube::Adjust::right -val
40
40
  end
41
- alias :l :left
41
+ alias l left
42
42
 
43
43
  def right val=1
44
44
  @@sugarcube_view ||= nil
@@ -48,12 +48,12 @@ module SugarCube
48
48
  f.origin.x += val
49
49
  @@sugarcube_view.frame = f
50
50
  end
51
- alias :r :right
51
+ alias r right
52
52
 
53
53
  def up val=1
54
54
  SugarCube::Adjust::down -val
55
55
  end
56
- alias :u :up
56
+ alias u up
57
57
 
58
58
  def down val=1
59
59
  @@sugarcube_view ||= nil
@@ -63,7 +63,7 @@ module SugarCube
63
63
  f.origin.y += val
64
64
  @@sugarcube_view.frame = f
65
65
  end
66
- alias :d :down
66
+ alias d down
67
67
 
68
68
  def origin x=nil, y=nil
69
69
  @@sugarcube_view ||= nil
@@ -80,13 +80,13 @@ module SugarCube
80
80
  end
81
81
  @@sugarcube_view.frame = f
82
82
  end
83
- alias :o :origin
83
+ alias o origin
84
84
 
85
85
  ##| SIZE
86
86
  def thinner val=1
87
87
  SugarCube::Adjust::wider -val
88
88
  end
89
- alias :n :thinner
89
+ alias n thinner
90
90
 
91
91
  def wider val=1
92
92
  @@sugarcube_view ||= nil
@@ -96,12 +96,12 @@ module SugarCube
96
96
  f.size.width += val
97
97
  @@sugarcube_view.frame = f
98
98
  end
99
- alias :w :wider
99
+ alias w wider
100
100
 
101
101
  def shorter val=1
102
102
  SugarCube::Adjust::taller -val
103
103
  end
104
- alias :s :shorter
104
+ alias s shorter
105
105
 
106
106
  def taller val=1
107
107
  @@sugarcube_view ||= nil
@@ -111,7 +111,7 @@ module SugarCube
111
111
  f.size.height += val
112
112
  @@sugarcube_view.frame = f
113
113
  end
114
- alias :t :taller
114
+ alias t taller
115
115
 
116
116
  def size w=nil, h=nil
117
117
  @@sugarcube_view ||= nil
@@ -128,7 +128,7 @@ module SugarCube
128
128
  end
129
129
  @@sugarcube_view.frame = f
130
130
  end
131
- alias :z :size
131
+ alias z size
132
132
 
133
133
  ##| SHADOW
134
134
  def shadow shadow=nil
@@ -163,7 +163,7 @@ module SugarCube
163
163
  }
164
164
  end
165
165
  end
166
- alias :h :shadow
166
+ alias h shadow
167
167
 
168
168
  ##| TREE
169
169
  def tree(view=nil, tab=nil, is_last=true, views_index=nil)
@@ -35,6 +35,6 @@ class NSString
35
35
  def localized(value=nil, table=nil)
36
36
  @localized = NSBundle.mainBundle.localizedStringForKey(self, value:value, table:table)
37
37
  end
38
- alias :_ :localized
38
+ alias _ localized
39
39
 
40
40
  end
@@ -7,37 +7,37 @@ class Numeric
7
7
  def seconds
8
8
  self
9
9
  end
10
- alias :second :seconds
10
+ alias second seconds
11
11
 
12
12
  def minutes
13
13
  self * 60
14
14
  end
15
- alias :minute :minutes
15
+ alias minute minutes
16
16
 
17
17
  def hours
18
18
  self * 3600
19
19
  end
20
- alias :hour :hours
20
+ alias hour hours
21
21
 
22
22
  def days
23
23
  self.hours * 24
24
24
  end
25
- alias :day :days
25
+ alias day days
26
26
 
27
27
  def weeks
28
28
  self.days * 7
29
29
  end
30
- alias :week :weeks
30
+ alias week weeks
31
31
 
32
32
  def months
33
33
  self.days * 30
34
34
  end
35
- alias :month :months
35
+ alias month months
36
36
 
37
37
  def years
38
38
  self.days * 365
39
39
  end
40
- alias :year :years
40
+ alias year years
41
41
 
42
42
  def later(user_info=nil, &fire)
43
43
  NSTimer.scheduledTimerWithTimeInterval(self.to_f, target: fire, selector: 'call:', userInfo: user_info, repeats: false)
@@ -48,3 +48,18 @@ class Numeric
48
48
  end
49
49
 
50
50
  end
51
+
52
+
53
+ module SugarCube
54
+ module Timer
55
+ module_function
56
+
57
+ def every(time, user_info=nil, &fire)
58
+ time.every user_info, &fire
59
+ end
60
+
61
+ def after(time, user_info=nil, &fire)
62
+ time.later user_info, &fire
63
+ end
64
+ end
65
+ end
@@ -293,7 +293,8 @@ class Symbol
293
293
  def uitextalignment
294
294
  look_in(Symbol.textalignments)
295
295
  end
296
- alias :uialignment :uitextalignment
296
+ alias uialignment uitextalignment
297
+
297
298
 
298
299
  def uilinebreakmode
299
300
  look_in(Symbol.linebreakmodes)
@@ -302,7 +303,8 @@ class Symbol
302
303
  def uibaselineadjustment
303
304
  look_in(Symbol.baselineadjustments)
304
305
  end
305
- alias :uibaseline :uibaselineadjustment
306
+ alias uibaseline uibaselineadjustment
307
+
306
308
 
307
309
  def uiorientation
308
310
  look_in(Symbol.orientations)
@@ -319,7 +321,8 @@ class Symbol
319
321
  def uicontrolstate
320
322
  look_in(Symbol.controlstates)
321
323
  end
322
- alias :uistate :uicontrolstate
324
+ alias uistate uicontrolstate
325
+
323
326
 
324
327
  def uicontrolevent
325
328
  look_in(Symbol.controlevents)
@@ -332,12 +335,14 @@ class Symbol
332
335
  def uiactivityindicatorstyle
333
336
  look_in(Symbol.activityindicator_styles)
334
337
  end
335
- alias :uiactivityindicatorviewstyle :uiactivityindicatorstyle
338
+ alias uiactivityindicatorviewstyle uiactivityindicatorstyle
339
+
336
340
 
337
341
  def uisegmentedstyle
338
342
  look_in(Symbol.segmented_styles)
339
343
  end
340
- alias :uisegmentedcontrolstyle :uisegmentedstyle
344
+ alias uisegmentedcontrolstyle uisegmentedstyle
345
+
341
346
 
342
347
  def uidatepickermode
343
348
  look_in(Symbol.datepicker_modes)
@@ -346,27 +351,32 @@ class Symbol
346
351
  def uitablestyle
347
352
  look_in(Symbol.tableview_styles)
348
353
  end
349
- alias :uitableviewstyle :uitablestyle
354
+ alias uitableviewstyle uitablestyle
355
+
350
356
 
351
357
  def uitablerowanimation
352
358
  look_in(Symbol.tableview_rowanimation)
353
359
  end
354
- alias :uitableviewrowanimation :uitablerowanimation
360
+ alias uitableviewrowanimation uitablerowanimation
361
+
355
362
 
356
363
  def uitablecellstyle
357
364
  look_in(Symbol.tableview_cellstyles)
358
365
  end
359
- alias :uitableviewcellstyle :uitablecellstyle
366
+ alias uitableviewcellstyle uitablecellstyle
367
+
360
368
 
361
369
  def uitablecellaccessory
362
370
  look_in(Symbol.tableview_cellaccessorytype)
363
371
  end
364
- alias :uitableviewcellaccessorytype :uitablecellaccessory
372
+ alias uitableviewcellaccessorytype uitablecellaccessory
373
+
365
374
 
366
375
  def uitablecellselectionstyle
367
376
  look_in(Symbol.tableview_cellselectionstyle)
368
377
  end
369
- alias :uitableviewcellselectionstyle :uitablecellselectionstyle
378
+ alias uitableviewcellselectionstyle uitablecellselectionstyle
379
+
370
380
 
371
381
  def uistatusbarstyle
372
382
  look_in(Symbol.statusbar_styles)
@@ -31,7 +31,7 @@ class UITabBarController
31
31
 
32
32
  def <<(view_controller)
33
33
  view_controllers = [] + self.viewControllers
34
- viewControllers << view_controller
34
+ view_controllers << view_controller
35
35
  self.setViewControllers(view_controllers, animated: true)
36
36
  self
37
37
  end
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '0.7.6'
2
+ Version = '0.7.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugarcube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-26 00:00:00.000000000 Z
13
+ date: 2012-08-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
- requirement: !ruby/object:Gem::Requirement
17
+ requirement: &70351241731560 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,15 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ! '>='
29
- - !ruby/object:Gem::Version
30
- version: '0'
25
+ version_requirements: *70351241731560
31
26
  - !ruby/object:Gem::Dependency
32
27
  name: rspec
33
- requirement: !ruby/object:Gem::Requirement
28
+ requirement: &70351241730920 !ruby/object:Gem::Requirement
34
29
  none: false
35
30
  requirements:
36
31
  - - ! '>='
@@ -38,12 +33,7 @@ dependencies:
38
33
  version: '0'
39
34
  type: :development
40
35
  prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
36
+ version_requirements: *70351241730920
47
37
  description: ! 'CocoaTouch/iOS is a *verbose* framework. These extensions hope to
48
38
  make
49
39
 
@@ -125,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
115
  version: '0'
126
116
  requirements: []
127
117
  rubyforge_project:
128
- rubygems_version: 1.8.19
118
+ rubygems_version: 1.8.11
129
119
  signing_key:
130
120
  specification_version: 3
131
121
  summary: Extensions for Ruby to make Rubymotion development more enjoyable, and hopefully