talk 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a843b0b7332c8a0077104150b582af27057b0e90
4
- data.tar.gz: 55c4d50a067310de4052c24c992d804473aee9de
3
+ metadata.gz: 47ce5983a7162f33cd2b2ede78b20d5e2a456047
4
+ data.tar.gz: afe02ff186a9e44749bc746147521b7af2537205
5
5
  SHA512:
6
- metadata.gz: 89d037e1022295cfd10e42d18cc01829a768a274668de3e9d3208f72e927f51649f4ede8db08f966cb93c7a2d72cd8c24b231def50423c33746d66a7e5455301
7
- data.tar.gz: 179538eace67644bcf51c62b4896f6ed01e718882c8f1577e0ecfaf58d26315c0f2453e6284f64a3a4448c246a68d0113138f42759037eec505bcad33e5b1436
6
+ metadata.gz: bc2872575d0307819fa67a7ad2cb498a09ed87c5fa199d2c33f2cc49a42a2f7f6a9879f83f4c4057e5a5eb5292897cd682cf833c2a3b6892a756e5be9407484e
7
+ data.tar.gz: 76ad99b4fdbc1efe914eb12ac0ecc8bc1a1586656181ec1396d75ad0982d5191e2adf6ee67bdfcc5a1553f1f7c8b187a07edcaa01db79257584aa185e0b8dea1
@@ -110,7 +110,14 @@ def assist_line(field)
110
110
  end
111
111
  end
112
112
 
113
- elements.join(".")
113
+ stringified = elements.map { |e| "@\"#{e}\"" }
114
+ "@[#{stringified.join(",")}]"
115
+ end
116
+
117
+ def protocol_method_name(p_name, m_name)
118
+ p_name = p_name[0].upcase + p_name[1..-1]
119
+ m_name = m_name[0].upcase + m_name[1..-1]
120
+ "kProto#{p_name}Method#{m_name}"
114
121
  end
115
122
 
116
123
  def class_field_maps(cls)
@@ -20,3 +20,16 @@ enum <%= truncated_name(enumeration[:name]) %>
20
20
  };
21
21
 
22
22
  <% end # enumeration %>
23
+
24
+ <% @base[:protocol].each do |protocol| %>
25
+
26
+ // @protocol <%= protocol[:name] %>
27
+ <%= comment_block(protocol) %>
28
+
29
+ <% protocol[:method].each do |method| %>
30
+ <%= comment_block(method) %>
31
+ #define <%= protocol_method_name(protocol[:name], method[:name]) %> @"<%= method[:name] %>"
32
+
33
+ <% end %>
34
+
35
+ <% end # protocol %>
@@ -29,17 +29,20 @@
29
29
  <% end %>
30
30
 
31
31
  <% unless (@current_class[:field].reject { |f| assist_line(f).nil? }).length == 0 then %>
32
- -(NSString *) containerStructureForLocalKey: (NSString *) localKey
33
- {<%
34
- @current_class[:field].each do |field|
35
- assist = assist_line(field)
36
- unless assist.nil? %>
37
- if([localKey isEqualToString:@"<%= mapped_name(@current_class, field[:name], :field) %>"]) return @"<%= assist %>";
38
- <%
39
- end
40
- end
41
- %>
42
- return [super containerStructureForLocalKey:localKey];
32
+ -(NSDictionary *) containerStructure
33
+ {
34
+ NSDictionary *local = @{
35
+ <%
36
+ @current_class[:field].each do |field|
37
+ assist = assist_line(field)
38
+ next if assist.nil?
39
+ %> @"<%= mapped_name(@current_class, field[:name], :field) %>": <%= assist %>,
40
+ <% end %>
41
+ };
42
+
43
+ NSMutableDictionary *merged = [[super containerStructure] mutableCopy];
44
+ [merged addEntriesFromDictionary:local];
45
+ return merged;
43
46
  }
44
47
  <% end %>
45
48
  +(NSString *) fullyQualifiedClassName
data/talk.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'talk'
3
3
  s.executables << 'talk'
4
- s.version = '2.0.3'
5
- s.date = '2014-05-15'
4
+ s.version = '2.0.4'
5
+ s.date = '2014-05-16'
6
6
  s.summary = "Compile-to-source protocol contract specification language"
7
7
  s.description = "A lightweight language for specifying protocol contracts. Compiles to source in Java, Javascript, ObjC and Ruby."
8
8
  s.authors = ["Jonas Acres"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Acres
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-15 00:00:00.000000000 Z
11
+ date: 2014-05-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A lightweight language for specifying protocol contracts. Compiles to
14
14
  source in Java, Javascript, ObjC and Ruby.