Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
Permalink
Browse files

init

  • Loading branch information...
ruebot committed Aug 3, 2017
0 parents commit 4bf04646328dce88c1c690081f920c845c8f9bdb
Showing with 1,246 additions and 0 deletions.
  1. +22 −0 .gitignore
  2. +26 −0 .travis.yml
  3. +53 −0 CONTRIBUTING.md
  4. +14 −0 Gemfile
  5. +11 −0 LICENSE.txt
  6. +79 −0 README.md
  7. +36 −0 Rakefile
  8. +2 −0 app/assets/config/warclight_manifest.js
  9. 0 app/assets/images/warclight/.keep
  10. +13 −0 app/assets/javascripts/warclight/application.js
  11. +15 −0 app/assets/stylesheets/warclight/application.css
  12. +5 −0 app/controllers/warclight/application_controller.rb
  13. +4 −0 app/helpers/warclight/application_helper.rb
  14. +4 −0 app/jobs/warclight/application_job.rb
  15. +6 −0 app/mailers/warclight/application_mailer.rb
  16. +5 −0 app/models/warclight/application_record.rb
  17. +14 −0 app/views/layouts/warclight/application.html.erb
  18. +14 −0 bin/rails
  19. +2 −0 config/routes.rb
  20. +4 −0 lib/tasks/warclight_tasks.rake
  21. +5 −0 lib/warclight.rb
  22. +5 −0 lib/warclight/engine.rb
  23. +3 −0 lib/warclight/version.rb
  24. +6 −0 test/dummy/Rakefile
  25. +5 −0 test/dummy/app/assets/config/manifest.js
  26. 0 test/dummy/app/assets/images/.keep
  27. +13 −0 test/dummy/app/assets/javascripts/application.js
  28. +13 −0 test/dummy/app/assets/javascripts/cable.js
  29. 0 test/dummy/app/assets/javascripts/channels/.keep
  30. +15 −0 test/dummy/app/assets/stylesheets/application.css
  31. +4 −0 test/dummy/app/channels/application_cable/channel.rb
  32. +4 −0 test/dummy/app/channels/application_cable/connection.rb
  33. +3 −0 test/dummy/app/controllers/application_controller.rb
  34. 0 test/dummy/app/controllers/concerns/.keep
  35. +2 −0 test/dummy/app/helpers/application_helper.rb
  36. +2 −0 test/dummy/app/jobs/application_job.rb
  37. +4 −0 test/dummy/app/mailers/application_mailer.rb
  38. +3 −0 test/dummy/app/models/application_record.rb
  39. 0 test/dummy/app/models/concerns/.keep
  40. +14 −0 test/dummy/app/views/layouts/application.html.erb
  41. +13 −0 test/dummy/app/views/layouts/mailer.html.erb
  42. +1 −0 test/dummy/app/views/layouts/mailer.text.erb
  43. +3 −0 test/dummy/bin/bundle
  44. +4 −0 test/dummy/bin/rails
  45. +4 −0 test/dummy/bin/rake
  46. +38 −0 test/dummy/bin/setup
  47. +29 −0 test/dummy/bin/update
  48. +11 −0 test/dummy/bin/yarn
  49. +5 −0 test/dummy/config.ru
  50. +18 −0 test/dummy/config/application.rb
  51. +5 −0 test/dummy/config/boot.rb
  52. +10 −0 test/dummy/config/cable.yml
  53. +25 −0 test/dummy/config/database.yml
  54. +5 −0 test/dummy/config/environment.rb
  55. +54 −0 test/dummy/config/environments/development.rb
  56. +91 −0 test/dummy/config/environments/production.rb
  57. +42 −0 test/dummy/config/environments/test.rb
  58. +6 −0 test/dummy/config/initializers/application_controller_renderer.rb
  59. +14 −0 test/dummy/config/initializers/assets.rb
  60. +7 −0 test/dummy/config/initializers/backtrace_silencers.rb
  61. +5 −0 test/dummy/config/initializers/cookies_serializer.rb
  62. +4 −0 test/dummy/config/initializers/filter_parameter_logging.rb
  63. +16 −0 test/dummy/config/initializers/inflections.rb
  64. +4 −0 test/dummy/config/initializers/mime_types.rb
  65. +14 −0 test/dummy/config/initializers/wrap_parameters.rb
  66. +33 −0 test/dummy/config/locales/en.yml
  67. +56 −0 test/dummy/config/puma.rb
  68. +3 −0 test/dummy/config/routes.rb
  69. +32 −0 test/dummy/config/secrets.yml
  70. +6 −0 test/dummy/config/spring.rb
  71. 0 test/dummy/lib/assets/.keep
  72. 0 test/dummy/log/.keep
  73. +5 −0 test/dummy/package.json
  74. +67 −0 test/dummy/public/404.html
  75. +67 −0 test/dummy/public/422.html
  76. +66 −0 test/dummy/public/500.html
  77. 0 test/dummy/public/apple-touch-icon-precomposed.png
  78. 0 test/dummy/public/apple-touch-icon.png
  79. 0 test/dummy/public/favicon.ico
  80. +8 −0 test/integration/navigation_test.rb
  81. +17 −0 test/test_helper.rb
  82. +7 −0 test/warclight_test.rb
  83. +21 −0 warclight.gemspec
@@ -0,0 +1,22 @@
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
test/dummy/tmp/
/.bundle/
/.ruby-version
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/spec/reports/
/tmp/

# rspec failure tracking
.rspec_status

.internal_test_app

/node_modules/
@@ -0,0 +1,26 @@
sudo: false
language: ruby
notifications:
email: false
rvm:
- 2.4.1
jdk:
- oraclejdk8

# Update to phantomjs 2.1.1 to fix issues with < 2
# See https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-177592725
# and https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-200965782
cache:
bundler: true
directories:
- "travis_phantomjs"

before_install:
- "phantomjs --version"
- "export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH"
- "phantomjs --version"
- "if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != '2.1.1' ]; then wget https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "hash -r"
- "phantomjs --version"
@@ -0,0 +1,53 @@
# Welcome!

If you are reading this document then you are interested in contributing Warclight. All contributions are welcome: use-cases, documentation, code, ptatches, bug reports, feature requests, etc. You do not need to be a programmer to speak up!

### Use cases

If you would like to submit a use case for Warclight, please submit and issue [here](https://github.com/archivesunleashed/warclight/issues/new), and begin the issue title with "Use Case:".

### Documentation

You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/archivesunleashed/warclight/issues/new) and begin the issue title with "Documentation:".

### Request a new feature

To request a new feature you should [open an issue](https://github.com/archivesunleashed/warclight/issues/new) or create a use case as described above (see _use case_ section above), and summarize the desired functionality. Begin the issue title with "Enhancement:".

### Report a bug

To report a bug you should [open an issue](https://github.com/archivesunleashed/warclight/issues/new) that summarizes the bug, and begin the issue title with "Bug".

In order to help us understand and fix the bug it would be great if you could provide us with:

1. The steps to reproduce the bug. This includes information about e.g. The Warclight version you were using.
2. The expected behavior.
3. The actual, incorrect behavior.

Feel free to search the issue queue for existing issues (aka tickets) that already describe the problem; if there is such a ticket please add your information as a comment.

### Contribute code

_If you are interested in contributing code to Warclight but do not know where to begin:_

In this case you should [browse open issues](https://github.com/archivesunleashed/warclight/issues).

Contributions to Warclight codebase should be sent as GitHub pull requests. See section _Create a pull request_ below for details. If there is any problem with the pull request we can work through it using the commenting features of GitHub.

* For _small patches_, feel free to submit pull requests directly for those patches.
* For _larger code contributions_, please use the following process. The idea behind this process is to prevent any wasted work and catch design issues early on.

1. [Open an issue](https://github.com/archivesunleashed/warclight/issues), if a similar issue does not exist already. If a similar issue does exist, then you may consider participating in the work on the existing issue.
2. Comment on the issue with your plan for implementing the issue. Explain what pieces of the codebase you are going to touch and how everything is going to fit together.
3. The Warclight committers will work with you on the design to make sure you are on the right track.
4. Implement your issue, create a pull request (see below), and iterate from there.

### Create a pull request

Take a look at [Creating a pull request](https://help.github.com/articles/creating-a-pull-request). In a nutshell you need to:

1. [Fork](https://help.github.com/articles/fork-a-repo) the Warclight GitHub repository at [https://github.com/archivesunleashed/warclight](https://github.com/archivesleashed/warclight) to your personal GitHub account.
2. Commit any changes to your fork.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) to Warclight GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/archivesunleashed/aut/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.

You may want to read [Syncing a fork](https://help.github.com/articles/syncing-a-fork) for instructions on how to keep your fork up to date with the latest changes of the upstream (official) `aut` repository.
14 Gemfile
@@ -0,0 +1,14 @@
source 'https://rubygems.org'

# Declare your gem's dependencies in warclight.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.

# To use a debugger
# gem 'byebug', group: [:development, :test]
@@ -0,0 +1,11 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -0,0 +1,79 @@
# Warclight
[![Build Status](https://travis-ci.org/archivesunleashed/warclight.svg?branch=master)](https://travis-ci.org/archivesunleashed/warclight)
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
[![LICENSE](https://img.shields.io/badge/license-Apache-blue.svg?style=flat-square)](./LICENSE.txt)
[![codecov](https://codecov.io/gh/archivesunleashed/warclight/branch/master/graph/badge.svg)](https://codecov.io/gh/archivesunleashed/warclight)

A Rails engine supporting the discovery of web archives.

## Requirements

* [Ruby](https://www.ruby-lang.org/en/) 2.2 or later
* [Rails](http://rubyonrails.org) 5.1.2 or later

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'warclight'
```

And then execute:
```bash
$ bundle
```

Or install it yourself as:
```bash
$ gem install warclight
```

## Usage

Warclight is designed to work with web archive data that is indexed via the UK Web Archive's [webarchive-discovery](webarchive-discovery) project.

## Development

WarcLight development uses [`solr_wrapper`](https://rubygems.org/gems/solr_wrapper/versions/0.18.1) and [`engine_cart`](https://rubygems.org/gems/engine_cart) to host development instances of Solr and Rails server on your local machine.

### Run the test suite

Ensure Solr and Rails are _not_ running (ports 8983 and 3000 respectively), then:

```sh
$ bundle exec rake
```

### Run a development server

```sh
$ bundle exec rake warclight:server
```

Then visit http://localhost:3000. It will also start a Solr instance on port 8983.

### Run a console

You can also run `bin/console` for an interactive prompt that will allow you to experiment.

### Release a new version of the gem

To release a new version:

1. Update the version number in `lib/warclight/version.rb`
2. Run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, build the gem file (e.g., `gem build warclight.gemspec`) and push the `.gem` file to [rubygems.org](https://rubygems.org) (e.g., `gem push warclight-x.y.z.gem`).

## Contributing

[Bug reports](https://github.com/archivesunleashed/warclight/issues) and [pull requests](https://github.com/archivesunleashed/warclight/pulls) are welcome on WarcLight -- see [CONTRIBUTING.md](https://github.com/archivesunleashed/warclight/blob/master/CONTRIBUTING.md) for details.

## License

The gem is available as open source under the terms of the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

## Acknowledgments

This work is primarily supported by the [Andrew W. Mellon Foundation](https://uwaterloo.ca/arts/news/multidisciplinary-project-will-help-historians-unlock). Any opinions, findings, and conclusions or recommendations expressed are those of the researchers and do not necessarily reflect the views of the sponsors.

This project drew inspiration from the [Arclight](https://github.com/sul-dlss/arclight), and would like to thank those creators and contributors.
@@ -0,0 +1,36 @@
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end

require 'rdoc/task'

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Warclight'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
end

APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'


load 'rails/tasks/statistics.rake'



require 'bundler/gem_tasks'

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end


task default: :test
@@ -0,0 +1,2 @@
//= link_directory ../javascripts/warclight .js
//= link_directory ../stylesheets/warclight .css
No changes.
@@ -0,0 +1,13 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require_tree .
@@ -0,0 +1,15 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
@@ -0,0 +1,5 @@
module Warclight
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
end
@@ -0,0 +1,4 @@
module Warclight
module ApplicationHelper
end
end
@@ -0,0 +1,4 @@
module Warclight
class ApplicationJob < ActiveJob::Base
end
end
@@ -0,0 +1,6 @@
module Warclight
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'
end
end
@@ -0,0 +1,5 @@
module Warclight
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
end
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Warclight</title>
<%= stylesheet_link_tag "warclight/application", media: "all" %>
<%= javascript_include_tag "warclight/application" %>
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.

ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/warclight/engine', __FILE__)
APP_PATH = File.expand_path('../../test/dummy/config/application', __FILE__)

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

require 'rails/all'
require 'rails/engine/commands'
@@ -0,0 +1,2 @@
Warclight::Engine.routes.draw do
end
@@ -0,0 +1,4 @@
# desc "Explaining what the task does"
# task :warclight do
# # Task goes here
# end
@@ -0,0 +1,5 @@
require "warclight/engine"

module Warclight
# Your code goes here...
end
@@ -0,0 +1,5 @@
module Warclight
class Engine < ::Rails::Engine
isolate_namespace Warclight
end
end
@@ -0,0 +1,3 @@
module Warclight
VERSION = '0.1.0'
end
@@ -0,0 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative 'config/application'

Rails.application.load_tasks
@@ -0,0 +1,5 @@

//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link warclight_manifest.js
No changes.
@@ -0,0 +1,13 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require_tree .

0 comments on commit 4bf0464

Please sign in to comment.
You can’t perform that action at this time.