maruto 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/maruto/runner.rb +13 -9
- data/lib/maruto/version.rb +1 -1
- metadata +2 -2
data/lib/maruto/runner.rb
CHANGED
|
@@ -86,10 +86,10 @@ class Maruto::Runner < Thor
|
|
|
86
86
|
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
desc "observers", "list observers sorted and grouped by their event or area"
|
|
89
|
+
desc "observers FILTER", "list observers sorted and grouped by their event or area, optionally filtered by event name"
|
|
90
90
|
method_option :magento_root, :aliases => "-m", :default => "."
|
|
91
91
|
method_option :group_by_scope, :type => :boolean, :aliases => "-s", :default => false
|
|
92
|
-
def observers()
|
|
92
|
+
def observers(filter = nil)
|
|
93
93
|
|
|
94
94
|
magento_root = check_magento_folder()
|
|
95
95
|
|
|
@@ -100,9 +100,11 @@ class Maruto::Runner < Thor
|
|
|
100
100
|
if group_by_scope then
|
|
101
101
|
magento[:event_observers].each do |area, events|
|
|
102
102
|
events.each do |event, observers|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
if filter.nil? or event.include? filter
|
|
104
|
+
puts "#{area}/#{event}"
|
|
105
|
+
observers.each do |name, observer|
|
|
106
|
+
puts " #{name} (module:#{observer[:module]} type:#{observer[:type]} class:#{observer[:class]} method:#{observer[:method]})"
|
|
107
|
+
end
|
|
106
108
|
end
|
|
107
109
|
end
|
|
108
110
|
end
|
|
@@ -115,10 +117,12 @@ class Maruto::Runner < Thor
|
|
|
115
117
|
end
|
|
116
118
|
end
|
|
117
119
|
grouped_by_events.sort_by { |k, v| k }.each do |event, areas|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
if filter.nil? or event.include? filter
|
|
121
|
+
puts "#{event}"
|
|
122
|
+
areas.each do |area, observers|
|
|
123
|
+
observers.each do |name, observer|
|
|
124
|
+
puts " #{area}/#{name} (module:#{observer[:module]} type:#{observer[:type]} class:#{observer[:class]} method:#{observer[:method]})"
|
|
125
|
+
end
|
|
122
126
|
end
|
|
123
127
|
end
|
|
124
128
|
end
|
data/lib/maruto/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: maruto
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-05-
|
|
12
|
+
date: 2013-05-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: nokogiri
|