talk 2.2.3 → 2.2.4

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: 606cb2bb6a2dc72d6f6db89867297d026f578bdd
4
- data.tar.gz: 1db8eb90789c6d80da7a463190a216b839c6c544
3
+ metadata.gz: 963aee9e434631bd8d20cd86f11645b6478425e9
4
+ data.tar.gz: 364d02b88f3a18aa97c40001314140453b34f00d
5
5
  SHA512:
6
- metadata.gz: eb356dbd149a96bb2b1d0a9aaa5fa5e4c5a09f1a94d046e7d92663bbf1b9ecb11ab2b1e5ae96b8ef550c3037ea8b01c88b63a97ba1a94f45a6343477cc40578f
7
- data.tar.gz: 5d065ce7e1ccca753206de6ab57ad9d535d1142b14b76acfc6300d08c9dc38aee3b6823c1b2ceab4e7dd181539114a1ec82db56d0641968860729360950080dd
6
+ metadata.gz: 9bd86f190ae3dc6863b78620bd484ef63b78f7481569c04ea8ecac4c895eb5dbf6728c460affb2a55d506d747be72181b235662ac5367a1bc4ee2593f10f24c9
7
+ data.tar.gz: e526a3c98a908f0c3dc9c638ebf9bc51084a933fc9edb0ad91ecf08d7ccb4e1dc86fc0540cd4167f94005b3182b88600e546b638131234e0e0ca68ca18038fa2
data/bin/maketalk CHANGED
@@ -10,7 +10,7 @@ require 'trollop'
10
10
  require 'pp'
11
11
 
12
12
  $opts = Trollop::options do
13
- version "Talk 2.0 (c) 2013 Jonas Acres"
13
+ version "Talk #{Talk::VERSION} (c) 2013 Jonas Acres"
14
14
  banner <<-EOS
15
15
  Talk is a compile-to-source protocol specification language.
16
16
 
@@ -26,6 +26,7 @@ EOS
26
26
  opt :no, "Do not render specified tag type at any level", :type => :string, :multi => true
27
27
  opt :json, "Dump raw JSON to console"
28
28
  opt :upgrade, "Upgrade old-style protocols to new-style"
29
+ opt :version, "Show Talk version"
29
30
  end
30
31
 
31
32
  Trollop::die :omit, "cannot be combined with include" if $opts[:omit].length > 0 and $opts[:include].length > 0
@@ -142,6 +142,11 @@ TalkObject.prototype.__validateInteger = function(key, param, unsigned, size)
142
142
  var def = this.__definition[key];
143
143
 
144
144
  // Validate number
145
+ if(typeof(param) == 'string')
146
+ {
147
+ if(param.match(new RegExp("^(0x)?[0-9]+$"))) param = parseInt(param);
148
+ }
149
+
145
150
  if(typeof(param) != 'number')
146
151
  {
147
152
  var errMsg = "Expected " + key + " to be a number";
@@ -226,6 +231,10 @@ TalkObject.prototype.__validateInteger = function(key, param, unsigned, size)
226
231
  TalkObject.prototype.__validateReal = function(key, param)
227
232
  {
228
233
  var def = this.__definition[key];
234
+ if(typeof(param) == 'string')
235
+ {
236
+ if(param.match(new RegExp("^[0-9]+(\.[0-9]+)?$"))) param = parseFloat(param);
237
+ }
229
238
  if(typeof(param) != 'number') return "Expected numeric value for " + key;
230
239
  if(def.minValue !== undefined && def.minValue !== null && param < def.minValue)
231
240
  {
data/lib/talk.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
+ require 'version.rb'
3
4
  require 'parser'
4
5
  require 'languages/language.rb'
5
-
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module Talk
2
+ VERSION = "2.2.4"
3
+ end
data/talk.gemspec CHANGED
@@ -1,7 +1,11 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'version'
4
+
1
5
  Gem::Specification.new do |s|
2
6
  s.name = 'talk'
3
7
  s.executables << 'maketalk'
4
- s.version = '2.2.3'
8
+ s.version = Talk::VERSION
5
9
  s.date = '2014-06-12'
6
10
  s.summary = "Compile-to-source protocol contract specification language"
7
11
  s.description = "A lightweight language for specifying protocol contracts. Compiles to source in Java, Javascript, ObjC and Ruby."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Acres
@@ -118,6 +118,7 @@ files:
118
118
  - lib/parser.rb
119
119
  - lib/registry.rb
120
120
  - lib/talk.rb
121
+ - lib/version.rb
121
122
  - talk.gemspec
122
123
  homepage: http://github.com/jonasacres/talk
123
124
  licenses: