mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-11 16:57:11 +02:00
Remove unused methods
This commit is contained in:
parent
de5baff221
commit
61bef0fe3c
@ -100,11 +100,6 @@ class Plugin
|
||||
"https://rubygems.org/gems/#{gem_name}"
|
||||
end
|
||||
|
||||
def self.gemfile_changed?
|
||||
# if true, rails server needs to restart. new installed/removed gems are.
|
||||
@initial_gemfile_content != File.read(gemfile_path)
|
||||
end
|
||||
|
||||
def self.installed
|
||||
return [] unless File.exist?(gemfile_path)
|
||||
File.read(gemfile_path).scan(/"(.*?)", "(.*?)"/).map do |plugin|
|
||||
@ -136,16 +131,6 @@ class Plugin
|
||||
Rails.root + "Gemfile.plugins"
|
||||
end
|
||||
|
||||
def self.pristine!
|
||||
unless File.exists?(gemfile_path)
|
||||
File.open(gemfile_path, "w") do |f|
|
||||
f.write "# USED BY fluentd-ui internally\n"
|
||||
end
|
||||
end
|
||||
@initial_gemfile_content = File.read(gemfile_path)
|
||||
end
|
||||
pristine!
|
||||
|
||||
def gemfile_path
|
||||
self.class.gemfile_path
|
||||
end
|
||||
|
@ -9,7 +9,6 @@ describe Plugin do
|
||||
|
||||
after do
|
||||
File.unlink Plugin.gemfile_path if File.exist?(Plugin.gemfile_path)
|
||||
Plugin.pristine!
|
||||
end
|
||||
|
||||
describe "#valid?" do
|
||||
@ -104,7 +103,6 @@ describe Plugin do
|
||||
plugin.install!
|
||||
end
|
||||
|
||||
it { Plugin.should be_gemfile_changed }
|
||||
it { plugin.should be_installed }
|
||||
end
|
||||
end
|
||||
@ -115,7 +113,6 @@ describe Plugin do
|
||||
before do
|
||||
installed_plugin.stub(:fluent_gem).and_return(true)
|
||||
installed_plugin.install!
|
||||
Plugin.pristine!
|
||||
end
|
||||
|
||||
before do
|
||||
@ -123,7 +120,6 @@ describe Plugin do
|
||||
end
|
||||
|
||||
it { installed_plugin.should_not be_installed }
|
||||
it { Plugin.should be_gemfile_changed }
|
||||
end
|
||||
|
||||
describe "#upgrade!" do
|
||||
@ -134,12 +130,10 @@ describe Plugin do
|
||||
before do
|
||||
Plugin.any_instance.stub(:fluent_gem).and_return(true) # NOTE: not `plugin.stub` because upgrade! creates new Plugin instance internally
|
||||
installed_plugin.install!
|
||||
Plugin.pristine!
|
||||
installed_plugin.upgrade!(target_version)
|
||||
end
|
||||
|
||||
it { installed_plugin.should be_installed }
|
||||
it { Plugin.should be_gemfile_changed }
|
||||
it { installed_plugin.installed_version.should == target_version }
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user