sugarcube 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -0
- data/lib/sugarcube.rb +1 -1
- data/lib/sugarcube/adjust.rb +12 -7
- data/lib/sugarcube/version.rb +1 -1
- metadata +6 -6
data/README.md
CHANGED
@@ -31,6 +31,17 @@ don't even *drink* coffee, if you can imagine that... All I'm saying is: to each
|
|
31
31
|
their own. You should checkout [BubbleWrap][] for another take on
|
32
32
|
Cocoa-wrappage.
|
33
33
|
|
34
|
+
Installation
|
35
|
+
============
|
36
|
+
|
37
|
+
gem install sugarcube
|
38
|
+
|
39
|
+
# or in Gemfile
|
40
|
+
gem 'sugarcube'
|
41
|
+
|
42
|
+
# in Rakefile
|
43
|
+
require 'sugarcube'
|
44
|
+
|
34
45
|
Examples
|
35
46
|
========
|
36
47
|
|
data/lib/sugarcube.rb
CHANGED
data/lib/sugarcube/adjust.rb
CHANGED
@@ -3,6 +3,7 @@ module SugarCube
|
|
3
3
|
module_function
|
4
4
|
|
5
5
|
def adjust view=nil
|
6
|
+
@@sugarcube_view ||= nil
|
6
7
|
return @@sugarcube_view if not view
|
7
8
|
|
8
9
|
@@sugarcube_view = view
|
@@ -36,8 +37,10 @@ module SugarCube
|
|
36
37
|
end
|
37
38
|
alias :d :down
|
38
39
|
|
39
|
-
def origin x, y=nil
|
40
|
+
def origin x=nil, y=nil
|
40
41
|
f = @@sugarcube_view.frame
|
42
|
+
return SugarCube::CoreGraphics::Point(f.origin) if not x
|
43
|
+
|
41
44
|
if y
|
42
45
|
f.origin.x = x
|
43
46
|
f.origin.y = y
|
@@ -61,20 +64,22 @@ module SugarCube
|
|
61
64
|
end
|
62
65
|
alias :w :wider
|
63
66
|
|
64
|
-
def
|
65
|
-
SugarCube::
|
67
|
+
def shorter val=1
|
68
|
+
SugarCube::taller -val
|
66
69
|
end
|
67
|
-
alias :
|
70
|
+
alias :s :shorter
|
68
71
|
|
69
|
-
def
|
72
|
+
def taller val=1
|
70
73
|
f = @@sugarcube_view.frame
|
71
74
|
f.size.height += val
|
72
75
|
@@sugarcube_view.frame = f
|
73
76
|
end
|
74
|
-
alias :
|
77
|
+
alias :t :taller
|
75
78
|
|
76
|
-
def size w, h=nil
|
79
|
+
def size w=nil, h=nil
|
77
80
|
f = @@sugarcube_view.frame
|
81
|
+
return SugarCube::CoreGraphics::Size(f.size) if not w
|
82
|
+
|
78
83
|
if h
|
79
84
|
f.size.width = w
|
80
85
|
f.size.height = h
|
data/lib/sugarcube/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.2
|
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-07-
|
13
|
+
date: 2012-07-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
17
|
-
requirement: &
|
17
|
+
requirement: &70220975252940 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70220975252940
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rspec
|
28
|
-
requirement: &
|
28
|
+
requirement: &70220975268500 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70220975268500
|
37
37
|
description: ! 'CocoaTouch/iOS is a *verbose* framework. These extensions hope to
|
38
38
|
make
|
39
39
|
|