diff --git a/Gemfile b/Gemfile index 54d3e1e..00fcd7a 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source "https://rubygems.org" # Specify your gem's dependencies in schoolie.gemspec gemspec -gem "rails", "~>5" +gem "actionview", "~>5" group :development, :test do gem "byebug" gem "coveralls-ruby", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 3d4234a..75cc5f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,53 +2,22 @@ PATH remote: . specs: schoolie (0.1.2) - rails (~> 5) + actionview (~> 5) GEM remote: https://rubygems.org/ specs: - actioncable (5.2.6.2) - actionpack (= 5.2.6.2) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailer (5.2.6.2) - actionpack (= 5.2.6.2) - actionview (= 5.2.6.2) - activejob (= 5.2.6.2) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.6.2) - actionview (= 5.2.6.2) - activesupport (= 5.2.6.2) - rack (~> 2.0, >= 2.0.8) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (5.2.6.2) activesupport (= 5.2.6.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.6.2) - activesupport (= 5.2.6.2) - globalid (>= 0.3.6) - activemodel (5.2.6.2) - activesupport (= 5.2.6.2) - activerecord (5.2.6.2) - activemodel (= 5.2.6.2) - activesupport (= 5.2.6.2) - arel (>= 9.0) - activestorage (5.2.6.2) - actionpack (= 5.2.6.2) - activerecord (= 5.2.6.2) - marcel (~> 1.0.0) activesupport (5.2.6.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - arel (9.0.0) ast (2.4.2) builder (3.2.4) byebug (11.1.3) @@ -62,54 +31,24 @@ GEM crass (1.0.6) docile (1.4.0) erubi (1.10.0) - globalid (1.0.0) - activesupport (>= 5.0) i18n (1.10.0) concurrent-ruby (~> 1.0) json (2.6.1) loofah (2.14.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.2) minitest (5.15.0) - nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) parallel (1.21.0) parser (3.1.0.0) ast (~> 2.4.1) racc (1.6.0) - rack (2.2.3) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.6.2) - actioncable (= 5.2.6.2) - actionmailer (= 5.2.6.2) - actionpack (= 5.2.6.2) - actionview (= 5.2.6.2) - activejob (= 5.2.6.2) - activemodel (= 5.2.6.2) - activerecord (= 5.2.6.2) - activestorage (= 5.2.6.2) - activesupport (= 5.2.6.2) - bundler (>= 1.3.0) - railties (= 5.2.6.2) - sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (5.2.6.2) - actionpack (= 5.2.6.2) - activesupport (= 5.2.6.2) - method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) rainbow (3.1.1) rake (13.0.6) regexp_parser (2.2.1) @@ -133,13 +72,6 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - sprockets (4.0.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) sync (0.5.0) term-ansicolor (1.7.1) tins (~> 1.0) @@ -150,18 +82,15 @@ GEM tzinfo (1.2.9) thread_safe (~> 0.1) unicode-display_width (2.1.0) - websocket-driver (0.7.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) PLATFORMS x86_64-linux DEPENDENCIES + actionview (~> 5) byebug coveralls-ruby minitest (~> 5.0) - rails (~> 5) rake (~> 13.0) rubocop (~> 1.21) rubocop-minitest diff --git a/README.md b/README.md index 149a3d6..3b67e3b 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,6 @@ concern object, and the value thus returned will be written into the meta tag. Missing methods will be ignored. -There is also a rake task for generating a sitemap: ``` bundle exec rails schoolie:sitemap diff --git a/lib/schoolie.rb b/lib/schoolie.rb index 9acb2a2..c9fbd60 100644 --- a/lib/schoolie.rb +++ b/lib/schoolie.rb @@ -3,5 +3,4 @@ require "action_view" require_relative "schoolie/version" require_relative "helpers/schoolie_helper" -require "schoolie/railtie" if defined?(Rails) ActionView::Base.include SchoolieHelper diff --git a/lib/schoolie/railtie.rb b/lib/schoolie/railtie.rb deleted file mode 100644 index 1b02567..0000000 --- a/lib/schoolie/railtie.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -# lib/railtie.rb -require "schoolie" -require "rails" - -module Schoolie - # Grabs the rake task and makes it available to rails - class Railtie < Rails::Railtie - railtie_name :schoolie - - rake_tasks do - path = File.expand_path(__dir__) - Dir.glob("#{path}/tasks/**/*.rake").each { |f| load f } - end - end -end diff --git a/lib/schoolie/tasks/schoolie.rake b/lib/schoolie/tasks/schoolie.rake deleted file mode 100644 index 1607bcd..0000000 --- a/lib/schoolie/tasks/schoolie.rake +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -require "json" -namespace :schoolie do - task sitemap: :environment do - ids = JSON.parse(`curl -s 'http://127.0.0.1:8983/solr/laevigata/select?fq=workflow_state_name_ssim:(published%20OR%20approved)&fl=id&rows=15000'`)["response"]["docs"].map do |x| # rubocop:disable Layout/LineLength - "http://etd.library.emory.edu/concern/etds/#{x["id"]}" - end - File.open(Rails.root.join("public/sitemap.txt"), "w") { |f| ids.each { |x| f.puts x } } - end -end diff --git a/schoolie.gemspec b/schoolie.gemspec index 917fc00..0ed32b3 100644 --- a/schoolie.gemspec +++ b/schoolie.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] # Uncomment to register a new dependency of your gem - spec.add_dependency "rails", "~> 5" + spec.add_dependency "actionview", "~> 5" # For more information and examples about making a new gem, checkout our # guide at: https://bundler.io/guides/creating_gem.html