Class: WPMU::List
- Inherits:
-
Thor
- Object
- Thor
- WPMU::List
- Defined in:
- lib/wpmu/cli.rb
Instance Method Summary collapse
Instance Method Details
#plugins ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/wpmu/cli.rb', line 27 def plugins = ('active_plugins') plugins = {} .each do |site_id, | encoded_list = ['active_plugins'] PHP.unserialize(encoded_list).each do |plugin_name| plugins[plugin_name] ||= [] plugins[plugin_name] << site_id end end plugins.each do |plugin_name, site_ids| puts "#{plugin_name} - #{site_ids.to_s}" end end |
#sites ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/wpmu/cli.rb', line 44 def sites = (%w{blogname siteurl admin_email template active_plugins}) .each do |site_id, | .each do |key, value| if key == 'active_plugins' puts "#{site_id}| #{key}:" PHP.unserialize(value).each do |plugin| puts "\t#{plugin}" end if value else puts "#{site_id}| #{key}: #{value}" end end puts "\n" end end |
#themes ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/wpmu/cli.rb', line 12 def themes = ('template') themes = {} .each do |site_id, | theme_name = ['template'] themes[theme_name] ||= [] themes[theme_name] << site_id end themes.each do |theme_name, site_ids| puts "#{theme_name} - #{site_ids.to_s}" end end |