Defect #36835 » fix-redmine-plugin-assets_directory.diff
| lib/redmine/plugin.rb (作業コピー) | ||
|---|---|---|
|
raise PluginNotFound, "Plugin not found. The directory for plugin #{p.id} should be #{p.directory}."
|
||
|
end
|
||
|
p.path = PluginLoader.directories{ |d| d.dir == p.directory }
|
||
|
p.path = PluginLoader.directories.find {|d| d.to_s == p.directory}
|
||
|
# Adds plugin locales if any
|
||
|
# YAML translation files should be found under <plugin>/config/locales/
|
||
| ... | ... | |
|
# Returns the absolute path to the plugin assets directory
|
||
|
def assets_directory
|
||
|
path.assedts_dir
|
||
|
path.assets_dir
|
||
|
end
|
||
|
def <=>(plugin)
|
||
| test/unit/lib/redmine/plugin_test.rb (作業コピー) | ||
|---|---|---|
|
@klass.directory = Rails.root.join('test/fixtures/plugins')
|
||
|
# In case some real plugins are installed
|
||
|
@klass.clear
|
||
|
# Change plugin loader's directory for testing
|
||
|
Redmine::PluginLoader.directory = @klass.directory
|
||
|
Redmine::PluginLoader.setup
|
||
|
end
|
||
|
def teardown
|
||
| ... | ... | |
|
assert_equal 'http://example.net/jsmith', plugin.author_url
|
||
|
assert_equal 'This is a test plugin', plugin.description
|
||
|
assert_equal '0.0.1', plugin.version
|
||
|
assert_equal File.join(@klass.directory, 'foo_plugin', 'assets'), plugin.assets_directory
|
||
|
end
|
||
|
def test_register_should_raise_error_if_plugin_directory_does_not_exist
|
||