jettywrapper 2.0.2 → 2.0.3

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: bd615b5894ae53105f6abfebb4631fb96d99530e
4
- data.tar.gz: 67aa692a2180259b925218c854701a6077200e92
3
+ metadata.gz: 41090c9b128c286ef7693a2cea00c70de5896f1d
4
+ data.tar.gz: 869ac3689c8c830a01a3f3a6582f75010c3a3848
5
5
  SHA512:
6
- metadata.gz: c1689a3e0d63505018f1824196872b179a83110adf2bb328e5e439d48f3eb60d3b9d7103fe876acd1e7ea53e3fb128160695111a7dae46a2ef641a42f59d4566
7
- data.tar.gz: 65aa972099f95f6afb84101f425b7b1d0c1554f0b94687623e5616f1668f887b551f9f6cf41a4b22c77ee4af1693d8197a26cac6a75569e174510d5313715c06
6
+ metadata.gz: 88128ee21fe30aadce3a2b8ec72bda31879c98aca9e298a9ae520e42edfd8daf9256f4faf52e5bb3e771c8f214592acfb5410c1ce79b0dc5cc4b7a5fb0d2273c
7
+ data.tar.gz: 3123a2564cbd8e24f2650b74bf47517b048fe2a259159732c1fc210482ac52fdd1151975d10e52d9a65ec5ecb93752f18787ffd1f8686b7266789aacb2b34dce
@@ -0,0 +1,70 @@
1
+ # Jettywrapper [![Version](https://badge.fury.io/gh/projecthydra%2Fjettywrapper.png)](http://badge.fury.io/gh/projecthydra%2Fjettywrapper) [![Build Status](https://travis-ci.org/projecthydra/jettywrapper.png?branch=master)](https://travis-ci.org/projecthydra/jettywrapper)
2
+
3
+ This gem is designed to make it easier to integrate a jetty servlet container into a rails project.
4
+ Jettywrapper provides rake tasks for starting and stopping jetty, as well as the method `Jettywrapper.wrap` that will start
5
+ the server before the block and stop the server after the block, which is useful for automated testing.
6
+
7
+ By default, Jettywrapper is designed to work with Rails projects that use the Hydra gem, and downloads an instance of a
8
+ [hydra-jetty](https://github.com/projecthydra/hydra-jetty) project zipfile. However, it can be configured to
9
+ download any Jetty-based project on Github.
10
+
11
+ Jettywrapper supports
12
+
13
+ * ruby 2.0.0
14
+ * ruby 1.9.3
15
+ * ruby 1.8.7
16
+ * ree 1.8.7
17
+ * jruby 1.6.6+
18
+
19
+ ## Configuring Jettywrapper
20
+
21
+ Jettywrapper starts the process with a list of options that you can specify in `config/jetty.yml`, otherwise a default is used.
22
+ You can provide a per-environment configuration, or you can have a default configuration which will be used when a per-environment
23
+ configuration is not specified. Such a configuration might look like:
24
+
25
+ default:
26
+  jetty_port: 8983
27
+  java_opts:
28
+    - "-XX:MaxPermSize=128m"
29
+    - "-Xmx256m"
30
+
31
+ You can also configure a specific version of hydra-jetty. This is placed in your codebase, usually in a rake task
32
+
33
+ Jettywrapper.hydra_jetty_version = "v1.2.3"
34
+
35
+ Alternatively, you can use a completely different Jetty-based repository, Hydra-related or not
36
+
37
+ Jettywrapper.url = "https://github.com/myorg/my-jetty/archive/master.zip"
38
+
39
+ The name of the zip file can either be a branch name, such as master or develop, or the tag name of a released version.
40
+ Basically, any url that Github provides as a *.zip file will work.
41
+
42
+ ## Example rake task
43
+
44
+ ```ruby
45
+ require 'jettywrapper'
46
+ Jettywrapper.url = "https://github.com/myorg/my-jetty/archive/testing-feature-branch.zip"
47
+ desc "Hudson build"
48
+ task :hudson do
49
+ jetty_params = Jettywrapper.load_config.merge({:jetty_home => File.expand_path(File.dirname(__FILE__) + '/../jetty')})
50
+ error = Jettywrapper.wrap(jetty_params) do
51
+ Rake::Task["spec"].invoke
52
+ end
53
+ raise "test failures: #{error}" if error
54
+ end
55
+ ```
56
+
57
+ ## Testing the gem
58
+
59
+ If you haven't already, clone the git repository
60
+
61
+ git clone git@github.com:projecthydra/jettywrapper.git
62
+ cd jettywrapper
63
+
64
+ Install the gems
65
+
66
+ bundle install
67
+
68
+ Run the tests
69
+
70
+ rake
@@ -42,7 +42,7 @@ class Jettywrapper
42
42
  attr_writer :hydra_jetty_version, :url, :tmp_dir, :jetty_dir, :env
43
43
 
44
44
  def hydra_jetty_version
45
- @hydra_jetty_version ||= 'v8.1.1'
45
+ @hydra_jetty_version ||= 'master'
46
46
  end
47
47
 
48
48
  def url
@@ -1,3 +1,3 @@
1
1
  class Jettywrapper
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
@@ -21,13 +21,13 @@ require 'fileutils'
21
21
 
22
22
  before do
23
23
  Jettywrapper.reset_config
24
- FileUtils.rm "tmp/v8.1.1.zip", force: true
24
+ FileUtils.rm "tmp/master.zip", force: true
25
25
  end
26
26
 
27
27
  context "downloading" do
28
28
  context "with default file" do
29
29
  it "should download the zip file" do
30
- expect(Jettywrapper).to receive(:open).with('https://github.com/projecthydra/hydra-jetty/archive/v8.1.1.zip').and_return(system ('true'))
30
+ expect(Jettywrapper).to receive(:open).with('https://github.com/projecthydra/hydra-jetty/archive/master.zip').and_return(system ('true'))
31
31
  Jettywrapper.download
32
32
  end
33
33
  end
@@ -56,7 +56,7 @@ require 'fileutils'
56
56
  it "should download the zip file" do
57
57
  expect(File).to receive(:exists?).and_return(true)
58
58
  expect(Jettywrapper).to receive(:expanded_zip_dir).and_return('tmp/jetty_generator/interal_dir')
59
- expect(Zip::File).to receive(:open).with('tmp/v8.1.1.zip').and_return(true)
59
+ expect(Zip::File).to receive(:open).with('tmp/master.zip').and_return(true)
60
60
  expect(FileUtils).to receive(:remove_dir).with('jetty',true).and_return(true)
61
61
  expect(FileUtils).to receive(:mv).with('tmp/jetty_generator/interal_dir','jetty').and_return(true)
62
62
  Jettywrapper.unzip
@@ -99,7 +99,7 @@ require 'fileutils'
99
99
  its(:url) {should == 'http://example.com/bar.zip'}
100
100
  end
101
101
  context "when url is not set" do
102
- its(:url) {should == 'https://github.com/projecthydra/hydra-jetty/archive/v8.1.1.zip'}
102
+ its(:url) {should == 'https://github.com/projecthydra/hydra-jetty/archive/master.zip'}
103
103
  end
104
104
  end
105
105
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jettywrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-09 00:00:00.000000000 Z
13
+ date: 2015-02-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: logger
@@ -154,7 +154,7 @@ files:
154
154
  - Gemfile
155
155
  - History.txt
156
156
  - LICENSE
157
- - README.textile
157
+ - README.md
158
158
  - Rakefile
159
159
  - TODO.txt
160
160
  - config/jetty.yml
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: 1.3.6
189
189
  requirements: []
190
190
  rubyforge_project:
191
- rubygems_version: 2.2.2
191
+ rubygems_version: 2.4.5
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: Convenience tasks for working with jetty from within a ruby project.
@@ -1,64 +0,0 @@
1
- h1. jettywrapper
2
-
3
- !https://travis-ci.org/projecthydra/jettywrapper.png?branch=master!:https://travis-ci.org/projecthydra/jettywrapper
4
-
5
- This gem is designed to make it easier to integrate a jetty servlet container into a rails project.
6
- Jettywrapper provides rake tasks for starting and stopping jetty, as well as a method (Jettywrapper.wrap) that will start the server before the block and stop the server after the block, which is useful for automated testing.
7
-
8
- jettywrapper supports
9
- ruby 2.0.0
10
- ruby 1.9.3
11
- ruby 1.8.7
12
- ree 1.8.7
13
- jruby 1.6.6+
14
-
15
- h2. Configuring Jettywrapper
16
-
17
- Jettywrapper starts the process with a list of options that you can specify in config/jetty.yml (otherwise a default is used). You can provide a per environment configuration, or you can have a default configuration which will be used when a per-environment configuration is not specified.
18
-
19
- <pre>default:
20
-  jetty_port: 8983
21
-  java_opts:
22
-    - "-XX:MaxPermSize=128m"
23
-    - "-Xmx256m"
24
- </pre>
25
-
26
-
27
-
28
- h2. Example rake task:
29
-
30
- bc.. require 'jettywrapper'
31
- desc "Hudson build"
32
- task :hudson do
33
- jetty_params = Jettywrapper.load_config.merge({:jetty_home => File.expand_path(File.dirname(__FILE__) + '/../jetty')})
34
- error = Jettywrapper.wrap(jetty_params) do
35
- Rake::Task["spec"].invoke
36
- end
37
- raise "test failures: #{error}" if error
38
- end
39
-
40
- h2. Testing the gem
41
-
42
- If you haven't already, clone the git repository
43
-
44
- <pre>
45
- git clone git@github.com:projecthydra/jettywrapper.git
46
- cd jettywrapper
47
- </pre>
48
-
49
-
50
- Install the gems
51
-
52
- <pre>
53
- bundle install
54
- </pre>
55
-
56
- Run the tests
57
-
58
- <pre>
59
- rake
60
- </pre>
61
-
62
-
63
-
64
-