ib 0.2.7 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/ib/generator.rb +1 -1
- data/lib/ib/outlets.rb +1 -1
- data/lib/ib/parser.rb +7 -4
- data/lib/ib/version.rb +1 -1
- data/spec/fixtures/custom_view.rb +4 -0
- data/spec/generator_spec.rb +2 -0
- data/spec/parser_spec.rb +7 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e294dc4222e7afc58e33850727fdfe7c8196fbc
|
4
|
+
data.tar.gz: f478bc0484d46085a22c95f7d62902af044faf9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58437fdd08f5a13cebcaee22f160f776a58970490e7a12c80705f65998189b2286a76e6073481e48ece01001f6f79fbc21fff46aef3b8396fedbf34eb0f3f084
|
7
|
+
data.tar.gz: e19cf4f40b619f307f619edcd5961594a0c8c4a52c39081b3eb2f231fe30b7c673cdae521fd47d976b063b0ac4be410b4fdeceddd1f9349542ed40b5740a5077
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
rubymotion interface builder support (yes, with outlets)
|
4
4
|
|
5
|
-
|
5
|
+
<a href='http://spellhub.com/projects/project/7'><img src="http://spellhub.com/projects/status/7" height="18"></a>
|
6
6
|
|
7
7
|
[**Change Log**](https://github.com/yury/ib/wiki/Change-Log)
|
8
8
|
|
data/lib/ib/generator.rb
CHANGED
data/lib/ib/outlets.rb
CHANGED
data/lib/ib/parser.rb
CHANGED
@@ -3,10 +3,13 @@ class IB::Parser
|
|
3
3
|
CLASS_REGEX = /^[ \t]*class[ \t]+(#{NAME_REGEX})([ \t]*<[ \t]*(#{NAME_REGEX}))?/
|
4
4
|
OUTLET_REGEX = /^[ \t]+(ib_)?outlet(_accessor)?[ \t]+:(#{NAME_REGEX})[ \t]*?(,[ \t]*['"]?(#{NAME_REGEX}))?/
|
5
5
|
OUTLET_COLLECTION_REGEX = /^[ \t]+(ib_)?outlet_collection(_accessor)?[ \t]+:(#{NAME_REGEX})[ \t]*?(,[ \t]*['"]?(#{NAME_REGEX}))?/
|
6
|
-
|
7
|
-
|
6
|
+
METHOD_ARGUMENT_REGEX = /(#{NAME_REGEX})(?:[ \t]*=[^,#)]*)?/
|
7
|
+
METHOD_REF_REGEX = /^[ \t]+(ib_action)[ \t]:(#{NAME_REGEX})[ \t]*?(,[ \t]*['"]?(#{NAME_REGEX}))?/
|
8
|
+
METHOD_DEF_REGEX = /^[ \t]+(def)[ \t]#{METHOD_ARGUMENT_REGEX}([ \t(]+)?#{METHOD_ARGUMENT_REGEX}?([ \t)]*)(#.*)?$/
|
8
9
|
ACTION_REGEX = Regexp.union METHOD_DEF_REGEX, METHOD_REF_REGEX
|
9
10
|
|
11
|
+
p METHOD_DEF_REGEX
|
12
|
+
|
10
13
|
def find_all(dir_or_files)
|
11
14
|
all = {}
|
12
15
|
files = case dir_or_files
|
@@ -81,9 +84,9 @@ class IB::Parser
|
|
81
84
|
def find_actions src
|
82
85
|
src.scan(ACTION_REGEX).map do |groups|
|
83
86
|
if groups[0] == "def"
|
84
|
-
[groups[1], groups[3]]
|
87
|
+
[groups[1], groups[3], nil]
|
85
88
|
elsif groups[6] == "ib_action"
|
86
|
-
[groups[7], 'sender']
|
89
|
+
[groups[7], 'sender', groups[9]]
|
87
90
|
else
|
88
91
|
nil
|
89
92
|
end
|
data/lib/ib/version.rb
CHANGED
@@ -16,6 +16,7 @@ class CustomView < UIView
|
|
16
16
|
outlet_collection :yellowLabelCollection
|
17
17
|
|
18
18
|
ib_action :someAction
|
19
|
+
ib_action :segueAction, UIStoryboardSegue
|
19
20
|
|
20
21
|
def anotherAction button
|
21
22
|
end
|
@@ -32,4 +33,7 @@ class CustomView < UIView
|
|
32
33
|
def actionWithoutArgs
|
33
34
|
end
|
34
35
|
|
36
|
+
def actionWithDefaultedArgs(sender = nil) #comment
|
37
|
+
end
|
38
|
+
|
35
39
|
end
|
data/spec/generator_spec.rb
CHANGED
@@ -32,10 +32,12 @@ describe IB::Generator do
|
|
32
32
|
@property IBOutletCollection(id) NSArray * yellowLabelCollection;
|
33
33
|
|
34
34
|
-(IBAction) someAction:(id) sender;
|
35
|
+
-(IBAction) segueAction:(UIStoryboardSegue*) sender;
|
35
36
|
-(IBAction) anotherAction:(id) button;
|
36
37
|
-(IBAction) actionWithComment:(id) sender;
|
37
38
|
-(IBAction) actionWithBrackets:(id) sender;
|
38
39
|
-(IBAction) actionWithoutArgs;
|
40
|
+
-(IBAction) actionWithDefaultedArgs:(id) sender;
|
39
41
|
|
40
42
|
@end
|
41
43
|
|
data/spec/parser_spec.rb
CHANGED
@@ -19,11 +19,13 @@ describe IB::Parser do
|
|
19
19
|
["yellowLabelCollection", "id"]
|
20
20
|
]
|
21
21
|
info[:actions].should == [
|
22
|
-
["someAction",
|
23
|
-
["
|
24
|
-
["
|
25
|
-
["
|
26
|
-
["
|
22
|
+
["someAction", "sender", nil],
|
23
|
+
["segueAction", "sender", "UIStoryboardSegue"],
|
24
|
+
["anotherAction", "button", nil],
|
25
|
+
["actionWithComment", "sender", nil],
|
26
|
+
["actionWithBrackets", "sender", nil],
|
27
|
+
["actionWithoutArgs", nil, nil],
|
28
|
+
["actionWithDefaultedArgs", "sender", nil]
|
27
29
|
]
|
28
30
|
end
|
29
31
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Korolev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: xcodeproj
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.0.0
|
110
|
+
rubygems_version: 2.0.0
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Small portion of love to interface builder with rubymotion
|