teacup 0.3.11 → 0.3.12

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- teacup (0.3.11)
4
+ teacup (0.3.12)
5
5
  rake
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -40,7 +40,7 @@ class SomeController < UIViewController
40
40
 
41
41
  @field = UITextField.new
42
42
  @field.frame = [[10, 10], [200, 50]]
43
- @search.textColor = UIColor.redColor
43
+ @field.textColor = UIColor.redColor
44
44
  view.addSubview(@field)
45
45
 
46
46
  @search = UITextField.new
data/lib/dummy.rb CHANGED
@@ -6,6 +6,13 @@ private
6
6
  end
7
7
  end
8
8
 
9
+ class DummyButton < UIButton
10
+ private
11
+ def dummy
12
+ setTitleEdgeInsets(nil)
13
+ end
14
+ end
15
+
9
16
  class DummyScrollView < UIScrollView
10
17
  private
11
18
  def dummy
@@ -1,5 +1,5 @@
1
1
  module Teacup
2
2
 
3
- VERSION = '0.3.11'
3
+ VERSION = '0.3.12'
4
4
 
5
5
  end
@@ -4,14 +4,18 @@ class UIView
4
4
 
5
5
  # get one stylesheet by stylename
6
6
  # my_view[:button] :button => #<UIButton..>
7
- def viewWithStylename name
8
- view = subviews.find {|view| view.stylename == name}
7
+ def viewWithStylename name_or_class
8
+ if name_or_class.is_a? Class
9
+ view = subviews.find { |view| view.is_a? name_or_class }
10
+ else
11
+ view = subviews.find { |view| view.stylename == name_or_class }
12
+ end
9
13
  return view if view
10
14
 
11
15
  # found_subview will get assigned to the view we want, but the subview is
12
16
  # what is returned.
13
17
  found_subview = nil
14
- view = subviews.find {|subview| found_subview = subview.viewWithStylename(name) }
18
+ view = subviews.find {|subview| found_subview = subview.viewWithStylename(name_or_class) }
15
19
  return found_subview if view
16
20
 
17
21
  nil # couldn't find it
@@ -19,13 +23,17 @@ class UIView
19
23
 
20
24
  # get stylesheets by stylename
21
25
  # my_view.all :button => [#<UIButton..>, #<UIButton...>]
22
- def viewsWithStylename name
26
+ def viewsWithStylename name_or_class
23
27
  r = []
24
28
  subviews.each do |view|
25
- if view.stylename == name
26
- r.push name
29
+ if name_or_class.is_a? Class
30
+ if view.is_a? name_or_class
31
+ r << view
32
+ end
33
+ else view.stylename == name_or_class
34
+ r << view
27
35
  end
28
- r += view.viewsWithStylename name
36
+ r += view.viewsWithStylename name_or_class
29
37
  end
30
38
  r
31
39
  end
@@ -85,3 +85,14 @@ Teacup.handler UIView, :frame { |frame|
85
85
  Teacup.handler UIButton, :title { |title|
86
86
  self.setTitle(title, forState: UIControlStateNormal)
87
87
  }
88
+
89
+
90
+ Teacup.handler UIButton, :titleColor { |color|
91
+ self.setTitleColor(color.uicolor, forState: UIControlStateNormal)
92
+ }
93
+
94
+
95
+ Teacup.handler UIButton, :titleFont { |font|
96
+ font = font.uifont
97
+ self.titleLabel.font = font
98
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teacup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-07 00:00:00.000000000 Z
12
+ date: 2012-09-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70310569785840 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70310569785840
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rspec
27
- requirement: &70310569785180 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,7 +37,12 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70310569785180
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  description: ! 'Teacup is a community-driven DSL for making CSS-like styling, and
37
47
  layouts for
38
48
 
@@ -51,7 +61,6 @@ extra_rdoc_files: []
51
61
  files:
52
62
  - .gitignore
53
63
  - CHANGES.md
54
- - Dofile
55
64
  - Gemfile
56
65
  - Gemfile.lock
57
66
  - LICENSE
@@ -112,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
121
  version: '0'
113
122
  requirements: []
114
123
  rubyforge_project:
115
- rubygems_version: 1.8.11
124
+ rubygems_version: 1.8.19
116
125
  signing_key:
117
126
  specification_version: 3
118
127
  summary: A community-driven DSL for creating user interfaces on iOS.
data/Dofile DELETED
@@ -1,6 +0,0 @@
1
- require 'do_it'
2
-
3
- tasks = DoIt.new do
4
- todo 'Make a "nicer looking" sample app (or improve existing app).'
5
- todo 'Extend wiki on Github.'
6
- end