stark 0.9.1 → 0.9.2

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.
@@ -1,3 +1,10 @@
1
+ === 0.9.2 / 2013-10-29
2
+
3
+ * 1 bugfix:
4
+
5
+ * more conservative Struct#to_hash, doesn't try to call #to_hash on Strings
6
+ (Greg Vaughn)
7
+
1
8
  === 0.9.1 / 2013-08-29
2
9
 
3
10
  * 1 bugfix:
@@ -2,7 +2,7 @@ require 'thrift'
2
2
  require 'logger'
3
3
 
4
4
  module Stark
5
- VERSION = '0.9.1'
5
+ VERSION = '0.9.2'
6
6
 
7
7
  def self.logger
8
8
  @logger ||= ::Logger.new($stdout)
@@ -29,7 +29,7 @@ module Stark
29
29
  v = send name
30
30
  case v
31
31
  when Array
32
- hash[name] = v.map(&:to_hash)
32
+ hash[name] = v.map {|e| e.respond_to?(:to_hash) ? e.to_hash : e}
33
33
  when Struct
34
34
  hash[name] = v.to_hash
35
35
  else
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "stark"
5
- s.version = "0.9.1"
5
+ s.version = "0.9.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Phoenix"]
9
- s.date = "2013-08-29"
9
+ s.date = "2013-10-29"
10
10
  s.description = "Optimized thrift bindings for ruby."
11
11
  s.email = ["evan@phx.io"]
12
12
  s.executables = ["stark"]
@@ -145,6 +145,7 @@ struct Bar {
145
145
  }
146
146
  struct Quux {
147
147
  1: i32 int
148
+ 2: list<string> words
148
149
  }
149
150
  struct Foo {
150
151
  1:string str
@@ -160,8 +161,8 @@ EOM
160
161
 
161
162
  foo = ns::Foo.new :str => "hi", :int => 20
162
163
  foo.bars = [ns::Bar.new(:blah => "baz")]
163
- foo.q = ns::Quux.new(:int => 42)
164
- assert_equal({:str => "hi", :int => 20, :bars => [{:blah => "baz"}], :q => {:int => 42}}, foo.to_hash)
164
+ foo.q = ns::Quux.new(:int => 42, :words => %w[a an the])
165
+ assert_equal({:str => "hi", :int => 20, :bars => [{:blah => "baz"}], :q => {:int => 42, :words => %w[a an the]}}, foo.to_hash)
165
166
  end
166
167
 
167
168
  def test_to_struct_aref
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-29 00:00:00.000000000 Z
12
+ date: 2013-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thrift