sugarcube 1.5.6 → 1.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/sugarcube-constants/symbol.rb +18 -6
- data/lib/sugarcube-legacy/symbol.rb +2 -2
- data/lib/sugarcube/version.rb +1 -1
- data/spec/sugarcube_legacy.rb +1 -1
- data/spec/symbol_constants_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5a26a34821f7e128fc77deb73d1d9f1c299383d
|
4
|
+
data.tar.gz: 3f21df5e08d4bff1541d7ef7da121e94c398fd61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6da549843226fa1e4eb3c01da1372b62fc260ac809550777fb1c508b32abf97f70b24c8d0b7c92a4ccc0bbdea8c63fbbf810a8659ac33433cd6fd76e48a88dd6
|
7
|
+
data.tar.gz: 43e4e72088762944ee9379cc5d2fb86183c5034c85943442f05c9136e840863490723d6b97f6ca47bc80895893f047e76a2d1744ae174d00acfacb8eef7f20b8
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -191,7 +191,7 @@ write these as symbols instead of UILongConstantNames. This package adds
|
|
191
191
|
methods to `Symbol`s to convert them into a UIKit or Foundation constant.
|
192
192
|
|
193
193
|
```ruby
|
194
|
-
:center.
|
194
|
+
:center.nsalignment # => NSTextAlignmentCenter (formerly UITextAlignmentCenter)
|
195
195
|
:upside_down.uiorientation # => UIDeviceOrientationPortraitUpsideDown
|
196
196
|
:rounded.uibuttontype # => UIButtonTypeRoundedRect
|
197
197
|
:highlighted.uicontrolstate # => UIControlStateHighlighted
|
@@ -3,7 +3,7 @@ Adds some UI classes to the Symbol class. These methods are prefixed with `ui`
|
|
3
3
|
to make their intent clear, and to provide a little bit of "namespacing"
|
4
4
|
|
5
5
|
# alignment
|
6
|
-
:left.
|
6
|
+
:left.nsalignment => NSTextAlignmentLeft
|
7
7
|
|
8
8
|
# uicolors
|
9
9
|
:black.uicolor => UIColor.blackColor
|
@@ -51,10 +51,21 @@ class Symbol
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def uitextalignment
|
54
|
-
|
54
|
+
message = "uitextalignment is deprecated. Use nstextalignment instead."
|
55
|
+
if defined?(SugarCube::Legacy)
|
56
|
+
SugarCube::Legacy.log(message)
|
57
|
+
else
|
58
|
+
NSLog(message)
|
59
|
+
end
|
60
|
+
SugarCube.look_in(self, Symbol.nstextalignment)
|
55
61
|
end
|
56
62
|
alias uialignment uitextalignment
|
57
63
|
|
64
|
+
def nstextalignment
|
65
|
+
SugarCube.look_in(self, Symbol.nstextalignment)
|
66
|
+
end
|
67
|
+
alias nsalignment nstextalignment
|
68
|
+
|
58
69
|
def uilinebreakmode
|
59
70
|
SugarCube.look_in(self, Symbol.uilinebreakmode, Symbol.uilinebreakmode__deprecated)
|
60
71
|
end
|
@@ -232,6 +243,7 @@ class Symbol
|
|
232
243
|
attr :uikeyboardtype
|
233
244
|
attr :uikeyboardtype__deprecated
|
234
245
|
attr :uitextalignment
|
246
|
+
attr :nstextalignment
|
235
247
|
attr :uilinebreakmode
|
236
248
|
attr :uilinebreakmode__deprecated
|
237
249
|
attr :uibaselineadjustment
|
@@ -397,10 +409,10 @@ class Symbol
|
|
397
409
|
email: UIKeyboardTypeEmailAddress,
|
398
410
|
}
|
399
411
|
|
400
|
-
@
|
401
|
-
left:
|
402
|
-
right:
|
403
|
-
center:
|
412
|
+
@nstextalignment = {
|
413
|
+
left: NSTextAlignmentLeft,
|
414
|
+
right: NSTextAlignmentRight,
|
415
|
+
center: NSTextAlignmentCenter,
|
404
416
|
}
|
405
417
|
|
406
418
|
@uilinebreakmode__deprecated = {
|
@@ -37,8 +37,8 @@ class << Symbol
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def textalignments
|
40
|
-
SugarCube::Legacy.log("Symbol.textalignments[] is deprecated. Use Symbol.
|
41
|
-
|
40
|
+
SugarCube::Legacy.log("Symbol.textalignments[] is deprecated. Use Symbol.nstextalignment[] instead.")
|
41
|
+
nstextalignment
|
42
42
|
end
|
43
43
|
|
44
44
|
def linebreakmodes
|
data/lib/sugarcube/version.rb
CHANGED
data/spec/sugarcube_legacy.rb
CHANGED
@@ -17,7 +17,7 @@ describe "Legacy code" do
|
|
17
17
|
Symbol.autoresizemasks.should == Symbol.uiautoresizemask
|
18
18
|
Symbol.returnkeys.should == Symbol.uireturnkey
|
19
19
|
Symbol.keyboardtypes.should == Symbol.uikeyboardtype
|
20
|
-
Symbol.textalignments.should == Symbol.
|
20
|
+
Symbol.textalignments.should == Symbol.nstextalignment
|
21
21
|
Symbol.linebreakmodes.should == Symbol.uilinebreakmode
|
22
22
|
Symbol.baselineadjustments.should == Symbol.uibaselineadjustment
|
23
23
|
Symbol.border_types.should == Symbol.uibordertype
|
@@ -93,10 +93,10 @@ describe "Symbol - constants" do
|
|
93
93
|
:email.uikeyboardtype.should == UIKeyboardTypeEmailAddress
|
94
94
|
end
|
95
95
|
|
96
|
-
it 'should support `
|
97
|
-
:left.
|
98
|
-
:right.
|
99
|
-
:center.
|
96
|
+
it 'should support `nstextalignment`' do
|
97
|
+
:left.nstextalignment.should == NSTextAlignmentLeft
|
98
|
+
:right.nstextalignment.should == NSTextAlignmentRight
|
99
|
+
:center.nstextalignment.should == NSTextAlignmentCenter
|
100
100
|
end
|
101
101
|
|
102
102
|
it 'should support `uilinebreakmode`' do
|
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: 1.5.
|
4
|
+
version: 1.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin T.A. Gray
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-04-
|
14
|
+
date: 2014-04-16 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: |
|
17
17
|
== Description
|