Skip to content

Commit

Permalink
Merge 9b49214 into 93caf3b
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgriffis committed Mar 7, 2017
2 parents 93caf3b + 9b49214 commit cdf39b9
Show file tree
Hide file tree
Showing 77 changed files with 461 additions and 454 deletions.
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
spec/dummy/db/*.sqlite3
spec/dummy/db/*.sqlite3-journal
spec/dummy/log/*.log
spec/dummy/tmp/
spec/dummy/.sass-cache
test/tmp
test/dummy/log/
test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache
test/version_tmp
tmp
coverage/
Expand Down
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jruby-1.7.16.1
jruby-9.1.7.0
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
language: ruby
rvm:
- jruby-19mode
- jruby-head
matrix:
allow_failures:
- rvm: jruby-head
- jruby-9.1.7.0
17 changes: 4 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,10 @@ RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end




Bundler::GemHelper.install_tasks

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.ruby_opts = "--debug --dev"
end


task :default => :test
task default: :spec
5 changes: 2 additions & 3 deletions acts_as_citable.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ Gem::Specification.new do |s|
s.add_dependency "require_all", "~> 1.2"

s.add_development_dependency "activerecord-jdbcsqlite3-adapter"
s.add_development_dependency "nokogiri"
s.add_development_dependency "nokogiri", "~> 1.6.6.2"
s.add_development_dependency "brakeman"
s.add_development_dependency "simplecov"
s.add_development_dependency "simplecov-rcov"
s.add_development_dependency "test-unit"
s.add_development_dependency 'coveralls'
s.add_development_dependency 'ruby-debug'
s.add_development_dependency 'rspec-rails', '~> 3.5'
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
// 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.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require_tree .
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
* 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 styles
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
require "application_responder"

class ApplicationController < ActionController::Base
self.responder = ApplicationResponder
respond_to :html

# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions spec/dummy/app/models/citable_record.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class CitableRecord < ActiveRecord::Base
acts_as_citable
end
File renamed without changes.
6 changes: 6 additions & 0 deletions spec/dummy/app/models/custom_citable_record.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class CustomCitableRecord < ActiveRecord::Base
acts_as_citable do |c|
c.data_field = "my_data"
c.format_field = :my_format
end
end
File renamed without changes.
2 changes: 1 addition & 1 deletion test/dummy/bin/rails → spec/dummy/bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
File renamed without changes.
29 changes: 29 additions & 0 deletions spec/dummy/bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
require 'pathname'

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:

puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end

puts "\n== Preparing database =="
system "bin/rake db:setup"

puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"

puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end
2 changes: 1 addition & 1 deletion test/dummy/config.ru → spec/dummy/config.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
require File.expand_path('../boot', __FILE__)

require 'rails/all'
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"

Bundler.require(*Rails.groups)
require "acts_as_citable"
Expand All @@ -18,6 +24,9 @@ class Application < Rails::Application
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de

# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
end
end

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# SQLite version 3.x
# gem 'activerecord-jdbcsqlite3-adapter'
# gem install sqlite3
#
# Configure Using Gemfile
# gem 'activerecord-jdbcsqlite3-adapter'
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000

development:
<<: *default
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
# number of complex assets.
config.assets.debug = true

# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# For large-scale production use, consider using a caching reverse proxy like
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true

# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_files = false
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Expand All @@ -29,20 +31,22 @@
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false

# Generate digests for assets URLs.
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb

# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true

# Set to :debug to see everything in the log.
config.log_level = :info
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :debug

# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
Expand All @@ -54,7 +58,7 @@
# config.cache_store = :mem_cache_store

# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
# config.action_controller.asset_host = 'http://assets.example.com'

# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
Expand All @@ -67,9 +71,6 @@
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify

# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false

# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false

# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_files = true
# Configure static file server for tests with Cache-Control for performance.
config.serve_static_files = true
config.static_cache_control = 'public, max-age=3600'

# Show full error reports and disable caching.
Expand All @@ -31,11 +31,12 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

# Randomize the order test cases are executed.
config.active_support.test_order = :random

# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

config.active_support.test_order = :sorted
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.

Rails.application.config.action_dispatch.cookies_serializer = :json
Rails.application.config.action_dispatch.cookies_serializer = :json
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Rails.application.routes.draw do
get 'test' => 'test#test'

end
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# if you're sharing your code publicly.

development:
secret_key_base: e6dc0ba35fc4ccc161b58f1922a60e19bd02d8ffab4e2ab335f9b05fac67d3b73b14a1064400ddecdcf0449cf2375693374a168b68c61b5d1f1f5c9fcfb2decb
secret_key_base: 35eae4843ee5ec3a97454db2e25939a069e3b790f4d0b60aa88fdc33c9fbd8bf8008cd2febb22c44c5ab9115028a61d65f77a460bfd68aea53ec736d353d1206

test:
secret_key_base: 024a2986ed0069a578b63e9d7cd52b2046d34be9d0164d3eebf8572b7f7986bf2ebb6f7df92d78e821f276c270687614357efd21e6c207fc8fa51fdecb13493b
secret_key_base: fdbfa774f8abace26ceefc2a159e725d99234f960a4ee3f36126dbcfcc901dc2f423b815d3847f9a89eef6a9bc3118a06fb2c53cac2b184a5222e19c4025a4e7

# Do not keep production secrets in the repository,
# instead read values from the environment.
Expand Down
10 changes: 10 additions & 0 deletions spec/dummy/db/migrate/20170301213157_create_citable_records.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateCitableRecords < ActiveRecord::Migration
def change
create_table :citable_records do |t|
t.string :data
t.string :format

t.timestamps null: false
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateCustomCitableRecords < ActiveRecord::Migration
def change
create_table :custom_citable_records do |t|
t.string :my_data
t.string :my_format

t.timestamps null: false
end
end
end
16 changes: 8 additions & 8 deletions test/dummy/db/schema.rb → spec/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20130221214225) do
ActiveRecord::Schema.define(version: 20170306203804) do

create_table "record_changed_fields", force: true do |t|
create_table "citable_records", force: :cascade do |t|
t.string "data"
t.string "from_format"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "format"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "records", force: true do |t|
t.string "data"
t.string "format"
create_table "custom_citable_records", force: :cascade do |t|
t.string "my_data"
t.string "my_format"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added spec/dummy/public/favicon.ico
Empty file.

0 comments on commit cdf39b9

Please sign in to comment.