fishwife 1.1.1-java → 1.2.0-java

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.2.0 (2012-1-29)
2
+ * Upgrade, widen to rjack-jetty >= 7.5.4, < 7.7 (incl. 7.6.0.0 release)
3
+ * Fixed, tests passing in 1.9 mode; at least with jruby pre-release
4
+ 1.6.6.RC1, git: 333c503 (Don Werve)
5
+ * Upgrade to tarpit ~> 2.0, bundler Gemfile, gemspec; rspec ~> 2.8.0 (build)
6
+
1
7
  === 1.1.1 (2011-11-5)
2
8
  * Set Content-Type via the setContentType method (#2, Adam Zell)
3
9
  * Split multiple header values on newline before adding (#2, Adam Zell)
data/README.rdoc CHANGED
@@ -69,7 +69,7 @@ will need to load an output provider (see linked docs.)
69
69
 
70
70
  == License
71
71
 
72
- Copyright (c) 2011 David Kellum
72
+ Copyright (c) 2011-2012 David Kellum
73
73
 
74
74
  Licensed under the Apache License, Version 2.0 (the "License"); you
75
75
  may not use this file except in compliance with the License. You
data/Rakefile CHANGED
@@ -1,38 +1,7 @@
1
1
  # -*- ruby -*-
2
2
 
3
- $LOAD_PATH << './lib'
4
-
5
3
  require 'rubygems'
6
- gem 'rjack-tarpit', '~> 1.4'
4
+ require 'bundler/setup'
7
5
  require 'rjack-tarpit'
8
6
 
9
- require 'fishwife/base'
10
-
11
- t = RJack::TarPit.new( 'fishwife', Fishwife::VERSION, :java_platform )
12
-
13
- t.specify do |h|
14
- h.developer( 'David Kellum', 'dek-oss@gravitext.com' )
15
- h.summary = "A hard working Jetty 7 based rack handler."
16
-
17
- h.extra_deps += [ [ 'rack', '~> 1.3.2' ],
18
- [ 'rjack-jetty', '~> 7.5.0' ],
19
- [ 'rjack-slf4j', '~> 1.6.1' ] ]
20
-
21
- h.extra_dev_deps += [ [ 'rjack-logback', '~> 1.2.0' ],
22
- [ 'rspec', '~> 2.6.0' ] ]
23
- end
24
-
25
- # Version/date consistency checks:
26
-
27
- task :check_history_version do
28
- t.test_line_match( 'History.rdoc', /^==/, / #{ t.version } / )
29
- end
30
- task :check_history_date do
31
- t.test_line_match( 'History.rdoc', /^==/, /\([0-9\-]+\)$/ )
32
- end
33
-
34
- task :gem => [ :check_history_version ]
35
- task :tag => [ :check_history_version, :check_history_date ]
36
- task :push => [ :check_history_version, :check_history_date ]
37
-
38
- t.define_tasks
7
+ RJack::TarPit.new( 'fishwife' ).define_tasks
data/bin/fishwife CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env jruby
2
2
  # -*- ruby -*-
3
3
  #--
4
- # Copyright (c) 2011 David Kellum
4
+ # Copyright (c) 2011-2012 David Kellum
5
5
  # Copyright (c) 2010-2011 Don Werve
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
data/lib/fishwife.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011 David Kellum
2
+ # Copyright (c) 2011-2012 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
data/lib/fishwife/base.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011 David Kellum
2
+ # Copyright (c) 2011-2012 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You may
@@ -15,5 +15,5 @@
15
15
  #++
16
16
 
17
17
  module Fishwife
18
- VERSION = '1.1.1'
18
+ VERSION = '1.2.0'
19
19
  end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011 David Kellum
2
+ # Copyright (c) 2011-2012 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You may
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011 David Kellum
2
+ # Copyright (c) 2011-2012 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -31,6 +31,8 @@ module Fishwife
31
31
  java_import 'java.io.FileInputStream'
32
32
  java_import 'org.eclipse.jetty.continuation.ContinuationSupport'
33
33
 
34
+ ASCII_8BIT = Encoding.find( "ASCII-8BIT" ) if defined?( Encoding )
35
+
34
36
  def initialize( app )
35
37
  super()
36
38
  @log = RJack::SLF4J[ self.class ]
@@ -158,7 +160,9 @@ module Fishwife
158
160
  end
159
161
 
160
162
  # The input stream is a wrapper around the Java InputStream.
161
- env['rack.input'] = request.getInputStream.to_io
163
+ input = request.getInputStream.to_io.binmode
164
+ input.set_encoding( ASCII_8BIT ) if input.respond_to?( :set_encoding )
165
+ env['rack.input'] = input
162
166
 
163
167
  # The output stream defaults to stderr.
164
168
  env['rack.errors'] ||= $stderr
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011 David Kellum
2
+ # Copyright (c) 2011-2012 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You may
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011 David Kellum
2
+ # Copyright (c) 2011-2012 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -20,6 +20,7 @@ require 'test_app'
20
20
  require 'thread'
21
21
  require 'digest/md5'
22
22
  require 'base64'
23
+ require 'json'
23
24
 
24
25
  describe Fishwife do
25
26
  def get(path, headers = {})
@@ -69,7 +70,7 @@ describe Fishwife do
69
70
  it "sets Rack headers" do
70
71
  response = get("/echo")
71
72
  response.code.should == "200"
72
- content = YAML.load(response.body)
73
+ content = JSON.parse(response.body)
73
74
  content["rack.version"].should == [ 1, 1 ]
74
75
  content["rack.multithread"].should be_true
75
76
  content["rack.multiprocess"].should be_false
@@ -79,7 +80,7 @@ describe Fishwife do
79
80
  it "passes form variables via GET" do
80
81
  response = get("/echo?answer=42")
81
82
  response.code.should == "200"
82
- content = YAML.load(response.body)
83
+ content = JSON.parse(response.body)
83
84
  content['request.params']['answer'].should == '42'
84
85
  end
85
86
 
@@ -87,14 +88,14 @@ describe Fishwife do
87
88
  question = "What is the answer to life, the universe, and everything?"
88
89
  response = post("/echo", 'question' => question)
89
90
  response.code.should == "200"
90
- content = YAML.load(response.body)
91
+ content = JSON.parse(response.body)
91
92
  content['request.params']['question'].should == question
92
93
  end
93
94
 
94
95
  it "passes custom headers" do
95
96
  response = get("/echo", "X-My-Header" => "Pancakes")
96
97
  response.code.should == "200"
97
- content = YAML.load(response.body)
98
+ content = JSON.parse(response.body)
98
99
  content["HTTP_X_MY_HEADER"].should == "Pancakes"
99
100
  end
100
101
 
@@ -107,7 +108,7 @@ describe Fishwife do
107
108
  it "lets the Rack app know it's running as a servlet" do
108
109
  response = get("/echo", 'answer' => '42')
109
110
  response.code.should == "200"
110
- content = YAML.load(response.body)
111
+ content = JSON.parse(response.body)
111
112
  content['rack.java.servlet'].should be_true
112
113
  end
113
114
 
@@ -118,14 +119,14 @@ describe Fishwife do
118
119
 
119
120
  it "sets the server port and hostname" do
120
121
  response = get("/echo")
121
- content = YAML.load(response.body)
122
+ content = JSON.parse(response.body)
122
123
  content["SERVER_PORT"].should == "9201"
123
124
  content["SERVER_NAME"].should == "127.0.0.1"
124
125
  end
125
126
 
126
127
  it "passes the URI scheme" do
127
128
  response = get("/echo")
128
- content = YAML.load(response.body)
129
+ content = JSON.parse(response.body)
129
130
  content['rack.url_scheme'].should == 'http'
130
131
  end
131
132
 
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011 David Kellum
2
+ # Copyright (c) 2011-2012 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -15,8 +15,8 @@
15
15
  # permissions and limitations under the License.
16
16
  #++
17
17
 
18
- # Load our local copy of Fishwife before anything else.
19
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
18
+ require 'rubygems'
19
+ require 'bundler/setup'
20
20
 
21
21
  # Setup logging
22
22
  require 'rjack-logback'
data/spec/test_app.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011 David Kellum
2
+ # Copyright (c) 2011-2012 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -15,6 +15,8 @@
15
15
  # permissions and limitations under the License.
16
16
  #++
17
17
 
18
+ require 'json'
19
+
18
20
  # A tiny Rack application for testing the Fishwife webserver. Each of
19
21
  # the following paths can be used to test webserver behavior:
20
22
  #
@@ -66,7 +68,7 @@ class TestApp
66
68
  def echo(request)
67
69
  response = Rack::Response.new
68
70
  env = request.env.merge('request.params' => request.params)
69
- response.write(env.to_yaml)
71
+ response.write(env.to_json)
70
72
  response.finish
71
73
  end
72
74
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: fishwife
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.1
5
+ version: 1.2.0
6
6
  platform: java
7
7
  authors:
8
8
  - David Kellum
@@ -10,88 +10,89 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-11-06 00:00:00 Z
13
+ date: 2012-01-30 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ version_requirements: &id001 !ruby/object:Gem::Requirement
19
18
  none: false
20
19
  requirements:
21
20
  - - ~>
22
21
  - !ruby/object:Gem::Version
23
- version: 1.3.2
22
+ version: 1.3.6
23
+ requirement: *id001
24
+ prerelease: false
24
25
  type: :runtime
25
- version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rjack-jetty
28
- prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
28
+ version_requirements: &id002 !ruby/object:Gem::Requirement
30
29
  none: false
31
30
  requirements:
32
- - - ~>
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 7.5.4
34
+ - - <
33
35
  - !ruby/object:Gem::Version
34
- version: 7.5.0
36
+ version: "7.7"
37
+ requirement: *id002
38
+ prerelease: false
35
39
  type: :runtime
36
- version_requirements: *id002
37
40
  - !ruby/object:Gem::Dependency
38
41
  name: rjack-slf4j
39
- prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
42
+ version_requirements: &id003 !ruby/object:Gem::Requirement
41
43
  none: false
42
44
  requirements:
43
45
  - - ~>
44
46
  - !ruby/object:Gem::Version
45
47
  version: 1.6.1
48
+ requirement: *id003
49
+ prerelease: false
46
50
  type: :runtime
47
- version_requirements: *id003
48
51
  - !ruby/object:Gem::Dependency
49
- name: rjack-logback
52
+ name: json
53
+ version_requirements: &id004 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ version: 1.6.4
59
+ requirement: *id004
50
60
  prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
61
+ type: :development
62
+ - !ruby/object:Gem::Dependency
63
+ name: rjack-logback
64
+ version_requirements: &id005 !ruby/object:Gem::Requirement
52
65
  none: false
53
66
  requirements:
54
67
  - - ~>
55
68
  - !ruby/object:Gem::Version
56
- version: 1.2.0
69
+ version: "1.2"
70
+ requirement: *id005
71
+ prerelease: false
57
72
  type: :development
58
- version_requirements: *id004
59
73
  - !ruby/object:Gem::Dependency
60
74
  name: rspec
61
- prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
75
+ version_requirements: &id006 !ruby/object:Gem::Requirement
63
76
  none: false
64
77
  requirements:
65
78
  - - ~>
66
79
  - !ruby/object:Gem::Version
67
- version: 2.6.0
80
+ version: 2.8.0
81
+ requirement: *id006
82
+ prerelease: false
68
83
  type: :development
69
- version_requirements: *id005
70
84
  - !ruby/object:Gem::Dependency
71
85
  name: rjack-tarpit
72
- prerelease: false
73
- requirement: &id006 !ruby/object:Gem::Requirement
86
+ version_requirements: &id007 !ruby/object:Gem::Requirement
74
87
  none: false
75
88
  requirements:
76
89
  - - ~>
77
90
  - !ruby/object:Gem::Version
78
- version: 1.4.0
91
+ version: "2.0"
92
+ requirement: *id007
93
+ prerelease: false
79
94
  type: :development
80
- version_requirements: *id006
81
- description: |-
82
- Researching fishing and salting process is supposed to increase the
83
- fishing jetties output. That is, jetties rack holds 9 fish, with
84
- Fishing (10%) and Salting Process (30%), their rack should hold 12
85
- fish.
86
-
87
- They will go through the motion of placing more fish in the rack, but
88
- the program doesn't count more than 9. So, Fishing and Salting Process
89
- is a waste of research.
90
-
91
- Note: One fishing jetty with one fish monger can feed 33% more people
92
- than one goat farm and one butcher.
93
-
94
- -- {tomnobles}[http://www.civcityforums.com/index.php?topic=1672.20;wap2], 2009-10-23
95
+ description: Researching fishing and salting process is supposed to increase the fishing jetties output. That is, jetties rack holds 9 fish, with Fishing (10%) and Salting Process (30%), their rack should hold 12 fish.
95
96
  email:
96
97
  - dek-oss@gravitext.com
97
98
  executables:
@@ -99,7 +100,6 @@ executables:
99
100
  extensions: []
100
101
 
101
102
  extra_rdoc_files:
102
- - Manifest.txt
103
103
  - History.rdoc
104
104
  - README.rdoc
105
105
  files:
@@ -120,7 +120,6 @@ files:
120
120
  - spec/test_app.rb
121
121
  - spec/data/hello.txt
122
122
  - spec/data/reddit-icon.png
123
- - .gemtest
124
123
  homepage: http://github.com/dekellum/fishwife
125
124
  licenses: []
126
125
 
@@ -135,17 +134,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
134
  requirements:
136
135
  - - ">="
137
136
  - !ruby/object:Gem::Version
137
+ hash: 2
138
+ segments:
139
+ - 0
138
140
  version: "0"
139
141
  required_rubygems_version: !ruby/object:Gem::Requirement
140
142
  none: false
141
143
  requirements:
142
144
  - - ">="
143
145
  - !ruby/object:Gem::Version
146
+ hash: 2
147
+ segments:
148
+ - 0
144
149
  version: "0"
145
150
  requirements: []
146
151
 
147
- rubyforge_project: fishwife
148
- rubygems_version: 1.8.9
152
+ rubyforge_project:
153
+ rubygems_version: 1.8.15
149
154
  signing_key:
150
155
  specification_version: 3
151
156
  summary: A hard working Jetty 7 based rack handler.
data/.gemtest DELETED
File without changes