mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Plugins can register providers for global settings
This commit is contained in:
@ -363,27 +363,7 @@ JS
|
||||
#
|
||||
# This is a very rough initial implementation
|
||||
def gem(name, version, opts = {})
|
||||
gems_path = File.dirname(path) + "/gems/#{RUBY_VERSION}"
|
||||
spec_path = gems_path + "/specifications"
|
||||
spec_file = spec_path + "/#{name}-#{version}.gemspec"
|
||||
unless File.exists? spec_file
|
||||
command = "gem install #{name} -v #{version} -i #{gems_path} --no-document --ignore-dependencies"
|
||||
if opts[:source]
|
||||
command << " --source #{opts[:source]}"
|
||||
end
|
||||
puts command
|
||||
puts `#{command}`
|
||||
end
|
||||
if File.exists? spec_file
|
||||
spec = Gem::Specification.load spec_file
|
||||
spec.activate
|
||||
unless opts[:require] == false
|
||||
require opts[:require_name] ? opts[:require_name] : name
|
||||
end
|
||||
else
|
||||
puts "You are specifying the gem #{name} in #{path}, however it does not exist!"
|
||||
exit(-1)
|
||||
end
|
||||
PluginGem.load(path, name, version, opts)
|
||||
end
|
||||
|
||||
def enabled_site_setting(setting=nil)
|
||||
|
Reference in New Issue
Block a user