Class: SamveraHls::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/samvera_hls/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_file_sets_controllerObject



28
29
30
# File 'lib/generators/samvera_hls/install/install_generator.rb', line 28

def copy_file_sets_controller
  copy_file "controllers/file_sets_controller.rb", "app/controllers/file_sets_controller.rb"
end

#copy_transcoding_configObject



24
25
26
# File 'lib/generators/samvera_hls/install/install_generator.rb', line 24

def copy_transcoding_config
  copy_file "config/hls.yml.example", "config/hls.yml"
end

#inject_compile_assetsObject



11
12
13
14
15
# File 'lib/generators/samvera_hls/install/install_generator.rb', line 11

def inject_compile_assets
  insert_into_file "config/initializers/assets.rb", :before => /^end/ do
    %{\nRails.application.config.assets.precompile += %w( include_player.js )\nRails.application.config.assets.precompile += %w( embed.js )\nRails.application.config.assets.precompile += %w( embed.css )\n}
  end
end

#inject_file_set_behaviorObject



17
18
19
20
21
22
# File 'lib/generators/samvera_hls/install/install_generator.rb', line 17

def inject_file_set_behavior
  insert_into_file "app/models/file_set.rb", 
                   :after => "Hyrax::FileSetBehavior" do
    %{\n  include HydraHls::FileSetBehavior\n}
  end
end

#inject_routesObject



5
6
7
8
9
# File 'lib/generators/samvera_hls/install/install_generator.rb', line 5

def inject_routes
  insert_into_file "config/routes.rb", :after => ".draw do" do
    %{\n  mount SamveraHls::Engine => '/'\n}
  end
end