Skip to content

Commit

Permalink
Replace jetty generator with jettywrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Mar 11, 2014
1 parent 7ed1979 commit b95202f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 86 deletions.
2 changes: 1 addition & 1 deletion blacklight.gemspec
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.add_dependency "bootstrap-sass", "~> 3.0"
s.add_dependency "deprecation"

s.add_development_dependency "jettywrapper", ">= 1.5.2"
s.add_development_dependency "jettywrapper", ">= 1.7.0"
s.add_development_dependency "blacklight-marc", "~> 5.0"
s.add_development_dependency "rspec-rails"
s.add_development_dependency "capybara"
Expand Down
17 changes: 13 additions & 4 deletions lib/generators/blacklight/install_generator.rb
Expand Up @@ -3,9 +3,10 @@ class Install < Rails::Generators::Base

source_root File.expand_path('../templates', __FILE__)

argument :model_name, :type => :string , :default => "user"
class_option :devise , :type => :boolean, :default => false, :aliases => "-d", :desc => "Use Devise as authentication logic."
class_option :marc , :type => :boolean, :default => false, :aliases => "-m", :desc => "Generate MARC-based demo ."
argument :model_name , type: :string , default: "user"
class_option :devise , type: :boolean, default: false, aliases: "-d", desc: "Use Devise as authentication logic."
class_option :jettywrapper, type: :boolean, default: false, aliases: "-d", desc: "Use jettywrapper to download and control Jetty"
class_option :marc , type: :boolean, default: false, aliases: "-m", desc: "Generate MARC-based demo ."

desc """
This generator makes the following changes to your application:
Expand All @@ -19,6 +20,14 @@ class Install < Rails::Generators::Base
Thank you for Installing Blacklight.
"""

def install_jettywrapper
return unless options[:jettywrapper]
gem "jettywrapper", "~> 1.7"
append_to_file "Rakefile",
"\nZIP_URL = \"https://github.com/projectblacklight/blacklight-jetty/archive/v4.6.0.zip\"\n" +
"require 'jettywrapper'\n"
end

def bundle_install
Bundler.with_clean_env do
run "bundle install"
Expand Down Expand Up @@ -93,4 +102,4 @@ def inject_blacklight_i18n_strings
copy_file "blacklight.en.yml", "config/locales/blacklight.en.yml"
end
end
end
end
70 changes: 0 additions & 70 deletions lib/generators/blacklight/jetty_generator.rb

This file was deleted.

Expand Up @@ -23,7 +23,7 @@ def run_blacklight_generator
run "bundle install"
end

generate 'blacklight:install', '--devise --marc'
generate 'blacklight:install', '--devise --marc --jettywrapper'
end

def run_test_support_generator
Expand Down
12 changes: 2 additions & 10 deletions template.demo.rb
@@ -1,20 +1,12 @@
gem "blacklight"

# add jettywrapper
gem 'jettywrapper', ">= 1.5.2"
prepend_to_file "Rakefile", <<-EOF
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.6.0.zip"
require 'jettywrapper'
EOF

# copy the blacklight jetty.yml into their app
create_file "config/jetty.yml", File.read(File.expand_path('../config/jetty.yml', __FILE__))

run "bundle install"

# run the blacklight install generator
generate 'blacklight:install', '--devise --marc'
generate 'blacklight:install', '--devise --marc --jettywrapper'

# run the database migrations
rake "db:migrate"
Expand All @@ -28,4 +20,4 @@
jetty_params = Jettywrapper.load_config('development')
Jettywrapper.wrap(jetty_params) do
rake "blacklight:solr:seed"
end
end

0 comments on commit b95202f

Please sign in to comment.