sugarcube 0.20.6 → 0.20.7

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,2 @@
1
+ language: objective-c
2
+ before_install: rvm use 1.9.3
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rake'
4
+
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,16 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sugarcube (0.20.6)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.0.4)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ rake
16
+ sugarcube!
data/README.md CHANGED
@@ -3,6 +3,8 @@ SugarCube
3
3
 
4
4
  Some sugar for your cocoa, or your [tea][sweettea].
5
5
 
6
+ [![Build Status](https://travis-ci.org/rubymotion/sugarcube.png)](https://travis-ci.org/rubymotion/sugarcube)
7
+
6
8
  About
7
9
  -----
8
10
 
@@ -991,13 +993,13 @@ verbs and SugarCube symbols.
991
993
  button = UIButton.alloc.initWithFrame([0, 0, 10, 10])
992
994
 
993
995
  button.on(:touch) { my_code }
994
- button.on(:touchupoutside, :touchcancel) { |event|
996
+ button.on(:touch_up_outside, :touch_cancel) { |event|
995
997
  puts event.inspect
996
998
  # my_code...
997
999
  }
998
1000
 
999
1001
  # remove handlers
1000
- button.off(:touch, :touchupoutside, :touchcancel)
1002
+ button.off(:touch, :touch_up_outside, :touch_cancel)
1001
1003
  button.off(:all)
1002
1004
  ```
1003
1005
 
@@ -1570,7 +1572,7 @@ You can analyze `UIViewController` hierarchies, too. There's even a handy
1570
1572
  3: | `-- #<ScheduleCalendarController:0x131bba90>
1571
1573
  4: +-- #<CameraViewController:0x13191380>
1572
1574
  5: +-- #<UINavigationController:0xac01ea0>
1573
- 6: | `-- #<UITableController:0xac04e30>
1575
+ 6: | `-- #<UITableViewController:0xac04e30>
1574
1576
  7: +-- #<PicturesViewController:0x1403ede0>
1575
1577
  8: `-- #<MessagesViewController:0x131a1bc0>
1576
1578
  => #<MainScreenController:0xac23b80>
@@ -2,7 +2,7 @@ module SugarCube
2
2
  module Modal
3
3
  module_function
4
4
  def present_modal(view_ctlr, options={}, &block)
5
- target = options.fetch(:target, UIApplication.sharedApplication.keyWindow.rootViewController)
5
+ target = options[:target] || UIApplication.sharedApplication.keyWindow.rootViewController
6
6
  animated = options.fetch(:animated, true)
7
7
  target.presentViewController(view_ctlr, animated:animated, completion:block)
8
8
  end
@@ -27,17 +27,17 @@ class UIViewController
27
27
 
28
28
  def present_modal(view_ctlr, options={}, &block)
29
29
  options = options.merge(target: self)
30
- super(view_ctlr, options, &block)
30
+ SugarCube::Modal.present_modal(view_ctlr, options, &block)
31
31
  end
32
32
 
33
33
  def present_modal_in_nav(view_ctlr, options={}, &block)
34
34
  options = options.merge(target: self)
35
- super(view_ctlr, options, &block)
35
+ SugarCube::Modal.present_modal_in_nav(view_ctlr, options, &block)
36
36
  end
37
37
 
38
38
  def dismiss_modal(view_ctlr, options={}, &block)
39
39
  options = options.merge(target: self)
40
- super(view_ctlr, options, &block)
40
+ SugarCube::Modal.dismiss_modal(view_ctlr, options, &block)
41
41
  end
42
42
 
43
43
  end
@@ -63,6 +63,9 @@ class Symbol
63
63
  yellow: 0xffff00,
64
64
  white: 0xffffff,
65
65
 
66
+ # uikit colors
67
+ placeholder: 0xb2b2b2, # UITextField placeholder color
68
+
66
69
  aliceblue: 0xf0f8ff,
67
70
  antiquewhite: 0xfaebd7,
68
71
  aqua: 0x00ffff,
@@ -600,10 +600,10 @@ class Symbol
600
600
  end
601
601
  alias uitableviewcellstyle uitablecellstyle
602
602
 
603
- def uitablecellaccessory
603
+ def uitableviewcellaccessorytype
604
604
  sugarcube_look_in(Symbol.tableview_cellaccessorytype)
605
605
  end
606
- alias uitableviewcellaccessorytype uitablecellaccessory
606
+ alias uitablecellaccessory uitableviewcellaccessorytype
607
607
 
608
608
  def uitablecellselectionstyle
609
609
  sugarcube_look_in(Symbol.tableview_cellselectionstyle)
@@ -0,0 +1,14 @@
1
+ class NSNotification
2
+
3
+ def to_s
4
+ name
5
+ end
6
+
7
+ def inspect
8
+ "#<#{self.class.name}:0x#{self.object_id.to_s(16)}, "+
9
+ "name=#{self.name.inspect}, object=#{object.inspect}, "+
10
+ "userInfo=#{userInfo.inspect}"+
11
+ ">"
12
+ end
13
+
14
+ end
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '0.20.6'
2
+ Version = '0.20.7'
3
3
  end
@@ -122,7 +122,7 @@ class NSAttributedString
122
122
  end
123
123
 
124
124
  def foreground_color(value)
125
- with_attributes({NSForegroundColorAttributeName => value})
125
+ with_attributes({NSForegroundColorAttributeName => value.uicolor})
126
126
  end
127
127
  alias color foreground_color
128
128
 
@@ -135,7 +135,7 @@ class NSAttributedString
135
135
  end
136
136
 
137
137
  def background_color(value)
138
- with_attributes({NSBackgroundColorAttributeName => value})
138
+ with_attributes({NSBackgroundColorAttributeName => value.uicolor})
139
139
  end
140
140
  alias bg_color background_color
141
141
 
@@ -164,11 +164,11 @@ class NSAttributedString
164
164
  end
165
165
 
166
166
  def stroke_color(value)
167
- with_attributes({NSStrokeColorAttributeName => value})
167
+ with_attributes({NSStrokeColorAttributeName => value.uicolor})
168
168
  end
169
169
 
170
170
  def underline_color(value)
171
- with_attributes({NSUnderlineColorAttributeName => value})
171
+ with_attributes({NSUnderlineColorAttributeName => value.uicolor})
172
172
  end
173
173
 
174
174
  def strikethrough_style(value)
@@ -176,7 +176,7 @@ class NSAttributedString
176
176
  end
177
177
 
178
178
  def strikethrough_color(value)
179
- with_attributes({NSStrikethroughColorAttributeName => value})
179
+ with_attributes({NSStrikethroughColorAttributeName => value.uicolor})
180
180
  end
181
181
 
182
182
  def shadow(value)
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.20.6
4
+ version: 0.20.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-04-04 00:00:00.000000000 Z
16
+ date: 2013-04-13 00:00:00.000000000 Z
17
17
  dependencies: []
18
18
  description: ! '== Description
19
19
 
@@ -43,7 +43,10 @@ extensions: []
43
43
  extra_rdoc_files: []
44
44
  files:
45
45
  - .gitignore
46
+ - .travis.yml
46
47
  - .yardopts
48
+ - Gemfile
49
+ - Gemfile.lock
47
50
  - LICENSE
48
51
  - README.md
49
52
  - Rakefile
@@ -91,6 +94,7 @@ files:
91
94
  - lib/sugarcube/timer.rb
92
95
  - lib/sugarcube/to_s/nserror.rb
93
96
  - lib/sugarcube/to_s/nslayoutconstraint.rb
97
+ - lib/sugarcube/to_s/nsnotification.rb
94
98
  - lib/sugarcube/to_s/nsset.rb
95
99
  - lib/sugarcube/to_s/nsurl.rb
96
100
  - lib/sugarcube/to_s/uicolor.rb
@@ -229,4 +233,3 @@ test_files:
229
233
  - spec/uiview_spec.rb
230
234
  - spec/uiviewcontroller_spec.rb
231
235
  - spec/unholy_spec.rb
232
- has_rdoc: