sugarcube 1.5.6 → 1.5.7

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: 2a55500123df09c7c936933927ec5c409d90b8f1
4
- data.tar.gz: 82797a0f5287912218353408e62b5838d2489f2a
3
+ metadata.gz: b5a26a34821f7e128fc77deb73d1d9f1c299383d
4
+ data.tar.gz: 3f21df5e08d4bff1541d7ef7da121e94c398fd61
5
5
  SHA512:
6
- metadata.gz: 77c73ffdae08cea117e13c6e91194165ee56a8105ced60a7e78bb73ffb6acd9f6dab44955b6a27daeffbe5be2809fa189724ea7244254aebdb3182b08ca21b2e
7
- data.tar.gz: 138fc138dd5d752051ffae176555ca48880898145076c0b122b33b52620bfd0feedb0194eef2f3485e16a1724be4a9aa7476bcc03de02192a45d8b48d34379a1
6
+ metadata.gz: 6da549843226fa1e4eb3c01da1372b62fc260ac809550777fb1c508b32abf97f70b24c8d0b7c92a4ccc0bbdea8c63fbbf810a8659ac33433cd6fd76e48a88dd6
7
+ data.tar.gz: 43e4e72088762944ee9379cc5d2fb86183c5034c85943442f05c9136e840863490723d6b97f6ca47bc80895893f047e76a2d1744ae174d00acfacb8eef7f20b8
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sugarcube (1.5.6)
4
+ sugarcube (1.5.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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.uialignment # => UITextAlignmentCenter
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.uialignment => UITextAlignmentLeft
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
- SugarCube.look_in(self, Symbol.uitextalignment)
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
- @uitextalignment = {
401
- left: UITextAlignmentLeft,
402
- right: UITextAlignmentRight,
403
- center: UITextAlignmentCenter,
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.uitextalignment[] instead.")
41
- uitextalignment
40
+ SugarCube::Legacy.log("Symbol.textalignments[] is deprecated. Use Symbol.nstextalignment[] instead.")
41
+ nstextalignment
42
42
  end
43
43
 
44
44
  def linebreakmodes
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '1.5.6'
2
+ Version = '1.5.7'
3
3
  end
@@ -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.uitextalignment
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 `uitextalignment`' do
97
- :left.uitextalignment.should == UITextAlignmentLeft
98
- :right.uitextalignment.should == UITextAlignmentRight
99
- :center.uitextalignment.should == UITextAlignmentCenter
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.6
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-10 00:00:00.000000000 Z
14
+ date: 2014-04-16 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: |
17
17
  == Description