jettywrapper 1.4.1 → 1.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d5d0b9a04e3888b74d2ff224194e07561b8b585
4
- data.tar.gz: 4ac859cff668c516cf5e09cb28901cecd8878c19
3
+ metadata.gz: 6643f2b0f438bad3aa59c4eb32e4e499dc0287cf
4
+ data.tar.gz: 1edd1684c627c4631646c21709bcd2ab231fdf16
5
5
  SHA512:
6
- metadata.gz: 1b3e543901d470e3d5b101e468d23c86ca71eee5476d4bae0095673364fb7eeef886b77fe2ce8ec9ee1da1a1663008c24c0e13175309f15e5f9011699f18684d
7
- data.tar.gz: bb2ebeac2b6ee3bbe48d31cc03f12742a0db629d7f0381c4db981266267efbe4dcab1daa6c9551849bbd1a65a2ea40b0a8c14a042b7c5b92b99b9713604b2860
6
+ metadata.gz: 2e23ce23bdd43c788090de4771a2db874233885835a6656900ebdd18e5abe9578102b39ab0519754fa1c110333cf77ef68e47987e6bb1f2ae577c6b9e3dc295b
7
+ data.tar.gz: 5a91eeabf34b9fb225c4618a68717ce0534c4363b226eaa59b5a3316c97c4c6c2708dc25a7b1316da0a8dd0c98acac47f7a2566b37e0a481015abd1c8fcde16f
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,113 @@
1
+ # How to Contribute
2
+
3
+ We want your help to make Project Hydra great.
4
+ There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
5
+
6
+ ## Hydra Project Intellectual Property Licensing and Ownership
7
+
8
+ All code contributors must have an Individual Contributor License Agreement (iCLA) on file with the Hydra Project Steering Group.
9
+ If the contributor works for an institution, the institution must have a Corporate Contributor License Agreement (cCLA) on file.
10
+
11
+ https://wiki.duraspace.org/display/hydra/Hydra+Project+Intellectual+Property+Licensing+and+Ownership
12
+
13
+ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the project.
14
+
15
+ ## Contribution Tasks
16
+
17
+ * Reporting Issues
18
+ * Making Changes
19
+ * Submitting Changes
20
+ * Merging Changes
21
+
22
+ ### Reporting Issues
23
+
24
+ * Make sure you have a [GitHub account](https://github.com/signup/free)
25
+ * Submit a [Github issue](./issues) by:
26
+ * Clearly describing the issue
27
+ * Provide a descriptive summary
28
+ * Explain the expected behavior
29
+ * Explain the actual behavior
30
+ * Provide steps to reproduce the actual behavior
31
+
32
+ ### Making Changes
33
+
34
+ * Fork the repository on GitHub
35
+ * Create a topic branch from where you want to base your work.
36
+ * This is usually the master branch.
37
+ * To quickly create a topic branch based on master; `git branch fix/master/my_contribution master`
38
+ * Then checkout the new branch with `git checkout fix/master/my_contribution`.
39
+ * Please avoid working directly on the `master` branch.
40
+ * You may find the [hub suite of commands](https://github.com/defunkt/hub) helpful
41
+ * Make commits of logical units.
42
+ * Your commit should include a high level description of your work in HISTORY.textile
43
+ * Check for unnecessary whitespace with `git diff --check` before committing.
44
+ * Make sure your commit messages are [well formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
45
+ * If you created an issue, you can close it by including "Closes #issue" in your commit message. See [Github's blog post for more details](https://github.com/blog/1386-closing-issues-via-commit-messages)
46
+
47
+ ```
48
+ Present tense short summary (50 characters or less)
49
+
50
+ More detailed description, if necessary. It should be wrapped to 72
51
+ characters. Try to be as descriptive as you can, even if you think that
52
+ the commit content is obvious, it may not be obvious to others. You
53
+ should add such description also if it's already present in bug tracker,
54
+ it should not be necessary to visit a webpage to check the history.
55
+
56
+ Include Closes #<issue-number> when relavent.
57
+
58
+ Description can have multiple paragraphs and you can use code examples
59
+ inside, just indent it with 4 spaces:
60
+
61
+ class PostsController
62
+ def index
63
+ respond_with Post.limit(10)
64
+ end
65
+ end
66
+
67
+ You can also add bullet points:
68
+
69
+ - you can use dashes or asterisks
70
+
71
+ - also, try to indent next line of a point for readability, if it's too
72
+ long to fit in 72 characters
73
+ ```
74
+
75
+ * Make sure you have added the necessary tests for your changes.
76
+ * Run _all_ the tests to assure nothing else was accidentally broken.
77
+ * When you are ready to submit a pull request
78
+
79
+ ### Submitting Changes
80
+
81
+ [Detailed Walkthrough of One Pull Request per Commit](http://ndlib.github.io/practices/one-commit-per-pull-request/)
82
+
83
+ * Read the article ["Using Pull Requests"](https://help.github.com/articles/using-pull-requests) on GitHub.
84
+ * Make sure your branch is up to date with its parent branch (i.e. master)
85
+ * `git checkout master`
86
+ * `git pull --rebase`
87
+ * `git checkout <your-branch>`
88
+ * `git rebase master`
89
+ * It is likely a good idea to run your tests again.
90
+ * Squash the commits for your branch into one commit
91
+ * `git rebase --interactive HEAD~<number-of-commits>` ([See Github help](https://help.github.com/articles/interactive-rebase))
92
+ * To determine the number of commits on your branch: `git log master..<your-branch> --oneline | wc -l`
93
+ * Squashing your branch's changes into one commit is "good form" and helps the person merging your request to see everything that is going on.
94
+ * Push your changes to a topic branch in your fork of the repository.
95
+ * Submit a pull request from your fork to the project.
96
+
97
+ ### Merging Changes
98
+
99
+ * It is considered "poor from" to merge your own request.
100
+ * Please take the time to review the changes and get a sense of what is being changed. Things to consider:
101
+ * Does the commit message explain what is going on?
102
+ * Does the code changes have tests? _Not all changes need new tests, some changes are refactorings_
103
+ * Does the commit contain more than it should? Are two separate concerns being addressed in one commit?
104
+ * Did the Travis tests complete successfully?
105
+ * If you are uncertain, bring other contributors into the conversation by creating a comment that includes their @username.
106
+ * If you like the pull request, but want others to chime in, create a +1 comment and tag a user.
107
+
108
+ # Additional Resources
109
+
110
+ * [General GitHub documentation](http://help.github.com/)
111
+ * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
112
+ * [Pro Git](http://git-scm.com/book) is both a free and excellent book about Git.
113
+ * [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/)
data/jettywrapper.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'bundler'
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "jettywrapper"
8
- s.version = GEMVERSION
8
+ s.version = Jettywrapper::VERSION
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Chris Beer", "Justin Coyne", "Bess Sadler"]
11
11
  s.email = ["hydra-tech@googlegroups.com"]
data/lib/jettywrapper.rb CHANGED
@@ -44,7 +44,7 @@ class Jettywrapper
44
44
  end
45
45
 
46
46
  def url
47
- @url ||= defined?(ZIP_URL) ? ZIP_URL : 'https://github.com/projecthydra/hydra-jetty/archive/new-solr-schema.zip'
47
+ @url ||= defined?(ZIP_URL) ? ZIP_URL : 'https://github.com/projecthydra/hydra-jetty/archive/v5.2.0.zip'
48
48
  @url
49
49
  end
50
50
 
@@ -69,7 +69,7 @@ class Jettywrapper
69
69
  logger.info "Downloading jetty at #{self.url} ..."
70
70
  FileUtils.mkdir tmp_dir unless File.exists? tmp_dir
71
71
  system "curl -L #{self.url} -o #{zip_file}"
72
- abort "Unable to download jetty from #{url}" unless $?.success?
72
+ abort "Unable to download jetty from #{self.url}" unless $?.success?
73
73
  end
74
74
 
75
75
  def unzip
@@ -79,6 +79,10 @@ class Jettywrapper
79
79
  system "unzip -d #{tmp_save_dir} -qo #{zip_file}"
80
80
  abort "Unable to unzip #{zip_file} into tmp_save_dir/" unless $?.success?
81
81
 
82
+ # Remove the old jetty directory if it exists
83
+ system "rm -r #{jetty_dir}" if File.directory?(jetty_dir)
84
+
85
+ # Move the expanded zip file into the final destination.
82
86
  expanded_dir = expanded_zip_dir(tmp_save_dir)
83
87
  system "mv #{expanded_dir} #{jetty_dir}"
84
88
  abort "Unable to move #{expanded_dir} into #{jetty_dir}/" unless $?.success?
@@ -101,14 +105,9 @@ class Jettywrapper
101
105
 
102
106
  def app_root
103
107
  return @app_root if @app_root
104
- if defined?(Rails.root)
105
- @app_root = Rails.root
106
- elsif defined?(APP_ROOT)
107
- @app_root = APP_ROOT
108
- else
109
- @app_root = '.'
110
- end
111
- @app_root
108
+ @app_root = Rails.root if defined?(Rails.root)
109
+ @app_root ||= APP_ROOT if defined?(APP_ROOT)
110
+ @app_root ||= '.'
112
111
  end
113
112
 
114
113
  def load_config
@@ -159,14 +158,8 @@ class Jettywrapper
159
158
  jetty_server = self.instance
160
159
  jetty_server.reset_process!
161
160
  jetty_server.quiet = params[:quiet].nil? ? true : params[:quiet]
162
- if defined?(Rails.root)
163
- base_path = Rails.root
164
- elsif defined?(APP_ROOT)
165
- base_path = APP_ROOT
166
- else
167
- raise "You must set either Rails.root, APP_ROOT or pass :jetty_home as a parameter so I know where jetty is" unless params[:jetty_home]
168
- end
169
- jetty_server.jetty_home = params[:jetty_home] || File.expand_path(File.join(base_path, 'jetty'))
161
+
162
+ jetty_server.jetty_home = params[:jetty_home] || File.expand_path(File.join(app_root, 'jetty'))
170
163
  jetty_server.solr_home = params[:solr_home] || File.join( jetty_server.jetty_home, "solr")
171
164
  jetty_server.port = params[:jetty_port] || 8888
172
165
  jetty_server.startup_wait = params[:startup_wait] || 5
@@ -1 +1,3 @@
1
- GEMVERSION = "1.4.1"
1
+ class Jettywrapper
2
+ VERSION = "1.4.2"
3
+ end
@@ -21,7 +21,7 @@ require 'rubygems'
21
21
  context "downloading" do
22
22
  context "with default file" do
23
23
  it "should download the zip file" do
24
- Jettywrapper.should_receive(:system).with('curl -L https://github.com/projecthydra/hydra-jetty/archive/new-solr-schema.zip -o tmp/new-solr-schema.zip').and_return(system ('true'))
24
+ Jettywrapper.should_receive(:system).with('curl -L https://github.com/projecthydra/hydra-jetty/archive/v5.2.0.zip -o tmp/v5.2.0.zip').and_return(system ('true'))
25
25
  Jettywrapper.download
26
26
  end
27
27
  end
@@ -42,9 +42,10 @@ require 'rubygems'
42
42
  context "with default file" do
43
43
  it "should download the zip file" do
44
44
  File.should_receive(:exists?).and_return(true)
45
- Jettywrapper.should_receive(:expanded_zip_dir).and_return('tmp/jetty_generator/hydra-jetty-new-solr-schema')
46
- Jettywrapper.should_receive(:system).with('unzip -d tmp/jetty_generator -qo tmp/new-solr-schema.zip').and_return(system ('true'))
47
- Jettywrapper.should_receive(:system).with('mv tmp/jetty_generator/hydra-jetty-new-solr-schema jetty').and_return(system ('true'))
45
+ Jettywrapper.should_receive(:expanded_zip_dir).and_return('tmp/jetty_generator/hydra-jetty-v5.2.0')
46
+ Jettywrapper.should_receive(:system).with('unzip -d tmp/jetty_generator -qo tmp/v5.2.0.zip').and_return(system ('true'))
47
+ Jettywrapper.should_receive(:system).with('rm -r jetty').and_return(system ('true'))
48
+ Jettywrapper.should_receive(:system).with('mv tmp/jetty_generator/hydra-jetty-v5.2.0 jetty').and_return(system ('true'))
48
49
  Jettywrapper.unzip
49
50
  end
50
51
  end
@@ -57,6 +58,7 @@ require 'rubygems'
57
58
  File.should_receive(:exists?).and_return(true)
58
59
  Jettywrapper.should_receive(:expanded_zip_dir).and_return('tmp/jetty_generator/interal_dir')
59
60
  Jettywrapper.should_receive(:system).with('unzip -d tmp/jetty_generator -qo tmp/file.zip').and_return(system ('true'))
61
+ Jettywrapper.should_receive(:system).with('rm -r jetty').and_return(system ('true'))
60
62
  Jettywrapper.should_receive(:system).with('mv tmp/jetty_generator/interal_dir jetty').and_return(system ('true'))
61
63
  Jettywrapper.unzip
62
64
  end
@@ -84,7 +86,7 @@ require 'rubygems'
84
86
  its(:url) {should == 'http://example.com/bar.zip'}
85
87
  end
86
88
  context "when url is not set" do
87
- its(:url) {should == 'https://github.com/projecthydra/hydra-jetty/archive/new-solr-schema.zip'}
89
+ its(:url) {should == 'https://github.com/projecthydra/hydra-jetty/archive/v5.2.0.zip'}
88
90
  end
89
91
  end
90
92
 
@@ -186,11 +188,6 @@ require 'rubygems'
186
188
  ts.jetty_opts.should == @jetty_params[:jetty_opts]
187
189
  end
188
190
 
189
- # passing in a hash is no longer optional
190
- it "raises an error when called without a :jetty_home value" do
191
- lambda { ts = Jettywrapper.configure }.should raise_exception
192
- end
193
-
194
191
  it "should override nil params with defaults" do
195
192
  jetty_params = {
196
193
  :quiet => nil,
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: 1.4.1
4
+ version: 1.4.2
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: 2013-03-15 00:00:00.000000000 Z
13
+ date: 2013-10-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: logger
@@ -150,6 +150,7 @@ files:
150
150
  - .gitmodules
151
151
  - .rspec
152
152
  - .travis.yml
153
+ - CONTRIBUTING.md
153
154
  - Gemfile
154
155
  - History.txt
155
156
  - README.textile
@@ -183,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
184
  version: 1.3.6
184
185
  requirements: []
185
186
  rubyforge_project:
186
- rubygems_version: 2.0.0
187
+ rubygems_version: 2.0.3
187
188
  signing_key:
188
189
  specification_version: 4
189
190
  summary: Convenience tasks for working with jetty from within a ruby project.