exhibits_solr_conf 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7e251a81558b7b158eb965c5a2caf70ec29612eb
4
+ data.tar.gz: 9d6507f1788c588f7f44492f47608f0a396474cb
5
+ SHA512:
6
+ metadata.gz: 5efef2db42cbf3e3b5ad91fa6f38cf0cdb8dfab6e6957d0eb8cef070471a016d6a7ed05a478454550f03d626df0430b04eb6bdcd453bad4a23d60be25333c299
7
+ data.tar.gz: 2fd2410b19007ca07f182bd06fe8a87af6a78eacce2cd7a0ed8f8e3c36f9d32c908ed4a5ea475bf20fe587e53522c428b554efe73a7b3a0f3ae05264c03b4f5b
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ .project
2
+ /.bundle/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+ /jetty/
12
+ .pry_history
data/.hound.yml ADDED
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ config_file: .rubocop.yml
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ require: rubocop-rspec
2
+
3
+ inherit_from: .rubocop_todo.yml
4
+
5
+ # explicitly setting string literals to single quotes quiets hound
6
+ Style/StringLiterals:
7
+ Enabled: true
8
+ EnforcedStyle: single_quotes
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,24 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2015-11-11 14:42:08 -0800 using RuboCop version 0.34.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 9
10
+ # Configuration parameters: AllowURI, URISchemes.
11
+ Metrics/LineLength:
12
+ Max: 188
13
+
14
+ # Offense count: 1
15
+ RSpec/DescribeClass:
16
+ Exclude:
17
+ - 'spec/exhibits_solr_conf/configure_solr_spec.rb'
18
+
19
+ # Offense count: 2
20
+ # Configuration parameters: Exclude.
21
+ Style/Documentation:
22
+ Exclude:
23
+ - 'lib/exhibits_solr_conf.rb'
24
+ - 'lib/exhibits_solr_conf/version.rb'
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ notifications:
2
+ email: false
3
+
4
+ rvm:
5
+ - 2.2.3
6
+
7
+ sudo: false
8
+ language: ruby
9
+
10
+ script:
11
+ - bundle exec rake
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in exhibits_solr_conf.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2015 The Board of Trustees of the Leland Stanford Junior University.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,78 @@
1
+ [![Build Status](https://travis-ci.org/sul-dlss/exhibits_solr_conf.svg)](https://travis-ci.org/sul-dlss/exhibits_solr_conf) [![Gem Version](https://badge.fury.io/rb/exhibits_solr_conf.svg)](https://badge.fury.io/rb/exhibits_solr_conf)
2
+
3
+ # exhibits_solr_conf
4
+
5
+ Gem supplying a set of Solr config files and a rake task to use in *testing* sul-dlss exhibit and spotlight git repos, such as:
6
+
7
+ * sul-exhibits-templates
8
+ * spotlight-dor-resources
9
+ * exhibits-requests
10
+
11
+ Production Solr config files for exhibits are part of sul-solr-configs.
12
+
13
+ ### Installation
14
+
15
+ Add this line to your engines's Gemfile:
16
+
17
+ gem 'exhibits_solr_conf'
18
+
19
+ And then execute:
20
+
21
+ $ bundle
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install exhibits_solr_conf
26
+
27
+ ### Usage
28
+
29
+ ### exhibits_solr_conf rake task
30
+
31
+ To use exhibits_solr_conf's rake task, in *your* Rakefile add:
32
+
33
+ ```ruby
34
+ require 'exhibits_solr_conf'
35
+ ```
36
+
37
+ And then you can use the ```exhibits:configure_solr``` rake task. For example:
38
+
39
+ ```ruby
40
+ require 'exhibits_solr_conf'
41
+ desc 'Run tests in generated test Rails app with generated Solr instance running'
42
+ task ci: ['engine_cart:generate', 'jetty:clean', 'exhibits:configure_solr'] do
43
+ ENV['environment'] = 'test'
44
+ jetty_params = Jettywrapper.load_config
45
+
46
+ Jettywrapper.wrap(jetty_params) do
47
+ # run the tests
48
+ Rake::Task['spec'].invoke
49
+ end
50
+ end
51
+ ```
52
+
53
+ ### Configuration
54
+
55
+ The default target directory for solr config files is ```jetty/solr/blacklight-core/conf/```
56
+
57
+ You can configure the target directory for the solr config files by passing an argument:
58
+
59
+ $ rake exhibits:configure_solr[/my/solr/conf]
60
+
61
+ NOTE: no quotes around the directory name
62
+
63
+ ## To update Solr configs for testing:
64
+
65
+ 1. Clone this repo (```git clone git@github.com:sul-dlss/exhibits_solr_conf.git```)
66
+ 2. Create your feature branch (```git checkout -b my-solr-config-tweaks```)
67
+ 3. Commit your changes (```git commit -am 'Tweak solr configs thus'```)
68
+ 4. Push to the branch (```git push origin my-solr-config-tweaks```)
69
+ 5. Create a [Pull Request](https://help.github.com/articles/using-pull-requests/)
70
+
71
+ ### To update Solr configs for deployment to production:
72
+
73
+ 1. Ensure that all tests pass.
74
+ 2. Clone the sul-solr-configs repo (```git clone git@github.com:sul-dlss/sul-solr-configs.git```)
75
+ 3. Create feature branch (```git checkout -b exhibits-new-feature```)
76
+ 4. Commit your changes (```git commit -am 'exhibits: add some new feature'```)
77
+ 5. Push to the branch (```git push origin my-new-feature```)
78
+ 6. Create a [Pull Request](https://help.github.com/articles/using-pull-requests/); tag "@sul-dlss/devops" in your pull request comment.
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'rspec/core/rake_task'
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ require 'rubocop/rake_task'
7
+ RuboCop::RakeTask.new(:rubocop)
8
+
9
+ desc 'run specs and rubocop'
10
+ task ci: [:spec, :rubocop]
11
+
12
+ task default: :ci
13
+
14
+ # the next 3 lines are useful for manual testing of THIS gem
15
+ require 'jettywrapper'
16
+ ZIP_URL = 'https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.4.zip'
17
+ require 'exhibits_solr_conf'
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'exhibits_solr_conf'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'exhibits_solr_conf/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'exhibits_solr_conf'
8
+ spec.version = ExhibitsSolrConf::VERSION
9
+ spec.authors = ['Naomi Dushay']
10
+ spec.email = ['ndushay@stanford.edu']
11
+ spec.license = 'Apache-2.0'
12
+
13
+ spec.summary = 'Solr config files for testing sul-dlss exhibit and spotlight git repos.'
14
+ spec.description = 'A set of Solr config files and a rake task for testing sul-dlss exhibit and spotlight git repos (sul-exhibits-templates, spotlight-dor-resources, exhibits-requests'
15
+ spec.homepage = 'https://github.com/sul-dlss/exhibits_solr_conf'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
18
+ spec.bindir = 'exe'
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.10'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_development_dependency 'rspec'
25
+ spec.add_development_dependency 'jettywrapper'
26
+ spec.add_development_dependency 'hurley' # for http requests to Solr
27
+ spec.add_development_dependency 'rubocop'
28
+ spec.add_development_dependency 'rubocop-rspec'
29
+ end
@@ -0,0 +1,11 @@
1
+ DEFAULT_SOLR_CONF_DIR = 'jetty/solr/blacklight-core/conf/'
2
+
3
+ namespace :exhibits do
4
+ desc 'Copies exhibits Solr config files to Solr in testing server'
5
+ task :configure_solr, :solr_conf_dir do |_task, args|
6
+ args.with_defaults solr_conf_dir: DEFAULT_SOLR_CONF_DIR
7
+ Dir['solr_conf_4_testing/*'].each do |fname|
8
+ cp(fname, args.solr_conf_dir, verbose: true)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module ExhibitsSolrConf
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,6 @@
1
+ require 'exhibits_solr_conf/version'
2
+
3
+ module ExhibitsSolrConf
4
+ rake_file_path = File.join(File.dirname(__FILE__), 'exhibits_solr_conf/tasks/*.rake')
5
+ Dir[File.expand_path(rake_file_path)].each { |ext| load ext } if defined?(Rake)
6
+ end
@@ -0,0 +1,3 @@
1
+ {
2
+ "initArgs":{},
3
+ "managedList":[]}