-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_entrypoints.rb
65 lines (55 loc) · 2.38 KB
/
test_entrypoints.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# Save this plugin in the users plugins folder: C:\Users\USERNAME\Documents\Relyze\Plugins\test_entrypoints.rb
#
# When analyzing a file in the GUI, tick to enable this plugin in the plugin options before analysis begins.
#
# After analysis you can invoke this plugin either via its keyboard short cut or through the right click pop-up menu on the code view.
#
# You can load this plugin in the plugin editor and simply choose to run it.
#
require 'relyze/core'
class Plugin < Relyze::Plugin::Analysis
def initialize
super( {
:guid => '{75A2197C-4A3C-4B29-A526-5DCE6BE63EFD}',
:name => 'Test Plugin Entrypoints',
:description => 'Test the various entrypoints of an Analysis plugin, including manually running the plugin, invoking the plugin via a keyboard or popup menu shortcut or via the analysis pipeline.',
:authors => [ 'Relyze Software Limited' ],
:license => 'Relyze Plugin License',
:references => [ 'www.relyze.com' ],
:shortcuts => {
:my_plugin_shortcut => 'Alt+X',
},
} )
end
# Run this method when the plugin is manually run, either via the plugin
# editor (E.g. pressing F5 to run) or by right clicking on this plugin in
# the application Plugins view and selecting to run it.
def run
print_message( "Hello via run" )
end
# Run this method when the user presses 'Alt+X' or right click in GUI and selects Plugins->Test Plugin Entrypoints->my_plugin_shortcut.
def my_plugin_shortcut
print_message( "Hello via my_plugin_shortcut" )
end
# Hook into the analysis pipeline at the pre structure analysis stage.
def pre_structure_analyze
print_message( "Hello via pre_structure_analyze" )
return true
end
# Hook into the analysis pipeline at the post structure analysis stage.
def post_structure_analyze
print_message( "Hello via post_structure_analyze" )
return true
end
# Hook into the analysis pipeline at the pre code analysis stage.
def pre_code_analyze
print_message( "Hello via pre_code_analyze" )
return true
end
# Hook into the analysis pipeline at the post code analysis stage.
def post_code_analyze
print_message( "Hello via post_code_analyze" )
return true
end
end