stark-rack 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ ---
2
+ script: rake travis
3
+ after_script:
4
+ - rake travis:after -t
5
+ before_script:
6
+ - gem install hoe-travis --no-rdoc --no-ri
7
+ - rake travis:before -t
8
+ language: ruby
9
+ rvm:
10
+ - 1.8.7
11
+ - 1.9.2
12
+ - 1.9.3
@@ -1,3 +1,7 @@
1
+ === 1.0.3 / 2013-09-03
2
+
3
+ * Fill in Thrift::ApplicationException#backtrace from cause
4
+
1
5
  === 1.0.2 / 2013-08-21
2
6
 
3
7
  * Propagate root cause exception to env['rack.exception']
@@ -1,5 +1,6 @@
1
1
  .autotest
2
2
  .gemtest
3
+ .travis.yml
3
4
  History.txt
4
5
  Manifest.txt
5
6
  README.txt
data/Rakefile CHANGED
@@ -9,6 +9,7 @@ Hoe::RUBY_FLAGS.sub! /-w/, ''
9
9
  stark_local_path = File.expand_path('../../stark/lib', __FILE__)
10
10
  Hoe::RUBY_FLAGS.concat " -I#{stark_local_path}" if File.directory?(stark_local_path)
11
11
 
12
+ Hoe.plugin :travis
12
13
  Hoe.plugin :git
13
14
  Hoe.plugin :gemspec
14
15
 
@@ -5,7 +5,7 @@ require 'stark/rack/verbose_protocol'
5
5
 
6
6
  class Stark::Rack
7
7
 
8
- VERSION = '1.0.2'
8
+ VERSION = '1.0.3'
9
9
 
10
10
  FORMAT = %{when: %0.4f, client: "%s", path: "%s%s", type: "%s", name: "%s", seqid: %d, error: %s\n}
11
11
 
@@ -1,5 +1,10 @@
1
1
  class Thrift::ApplicationException
2
- attr_accessor :cause
2
+ attr_reader :cause
3
+
4
+ def cause=(e)
5
+ @cause = e
6
+ set_backtrace e.backtrace unless backtrace && !backtrace.empty?
7
+ end
3
8
  end
4
9
 
5
10
  class Stark::Rack
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "stark-rack"
5
- s.version = "1.0.2"
5
+ s.version = "1.0.3"
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-21"
9
+ s.date = "2013-09-04"
10
10
  s.description = "Provides middleware for mounting Stark/Thrift services as Rack endpoints."
11
11
  s.email = ["evan@phx.io"]
12
12
  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
13
- s.files = [".autotest", ".gemtest", "History.txt", "Manifest.txt", "README.txt", "Rakefile", "lib/stark/rack.rb", "lib/stark/rack/content_negotiation.rb", "lib/stark/rack/logging_processor.rb", "lib/stark/rack/metadata.rb", "lib/stark/rack/rest.rb", "lib/stark/rack/verbose_protocol.rb", "stark-rack.gemspec", "test/calc-opt.rb", "test/calc.thrift", "test/config.ru", "test/gen-rb/calc.rb", "test/gen-rb/calc_constants.rb", "test/gen-rb/calc_types.rb", "test/helper.rb", "test/test_metadata.rb", "test/test_rack.rb", "test/test_rest.rb"]
13
+ s.files = [".autotest", ".gemtest", ".travis.yml", "History.txt", "Manifest.txt", "README.txt", "Rakefile", "lib/stark/rack.rb", "lib/stark/rack/content_negotiation.rb", "lib/stark/rack/logging_processor.rb", "lib/stark/rack/metadata.rb", "lib/stark/rack/rest.rb", "lib/stark/rack/verbose_protocol.rb", "stark-rack.gemspec", "test/calc-opt.rb", "test/calc.thrift", "test/config.ru", "test/gen-rb/calc.rb", "test/gen-rb/calc_constants.rb", "test/gen-rb/calc_types.rb", "test/helper.rb", "test/test_metadata.rb", "test/test_rack.rb", "test/test_rest.rb"]
14
14
  s.homepage = "https://github.com/evanphx/stark-rack"
15
15
  s.licenses = ["MIT"]
16
16
  s.rdoc_options = ["--main", "README.txt"]
@@ -110,7 +110,9 @@ class TestREST < Test::Unit::TestCase
110
110
  end.join
111
111
 
112
112
  json = '{"result":{"_struct_":"State","1:last_result":4,"2:vars":{"a":42}}}'
113
- assert_equal json, out.join
113
+ expected_result = Rack::Utils::OkJson.decode json
114
+
115
+ assert_equal expected_result, Rack::Utils::OkJson.decode(out.join)
114
116
  end
115
117
 
116
118
  def test_set_state_with_GET
@@ -170,6 +172,8 @@ class TestREST < Test::Unit::TestCase
170
172
  end.join
171
173
 
172
174
  json = '{"result":{"version":"1.0 baby","name":"This is a sweet service"}}'
173
- assert_equal json, out.join
175
+ expected_result = Rack::Utils::OkJson.decode json
176
+
177
+ assert_equal expected_result, Rack::Utils::OkJson.decode(out.join)
174
178
  end
175
179
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stark-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
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-21 00:00:00.000000000 Z
12
+ date: 2013-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: stark
@@ -87,6 +87,7 @@ extra_rdoc_files:
87
87
  files:
88
88
  - .autotest
89
89
  - .gemtest
90
+ - .travis.yml
90
91
  - History.txt
91
92
  - Manifest.txt
92
93
  - README.txt