Changeset 794

Show
Ignore:
Timestamp:
10/28/07 22:57:22 (6 years ago)
Author:
cho45
Message:

lang/ruby/Amalgam/plugins/firefox.rb,
lang/ruby/Amalgam/plugins/prefpanes.rb,
lang/ruby/Amalgam/plugins/applications.rb,
lang/ruby/Amalgam/AppController.rb,
lang/ruby/Amalgam/Amalgam.xcodeproj/cho45.mode1,
lang/ruby/Amalgam/Amalgam.xcodeproj/cho45.pbxuser,
lang/ruby/Amalgam/Amalgam.xcodeproj/project.pbxproj,
lang/ruby/Amalgam/English.lproj/MainMenu.nib/info.nib,
lang/ruby/Amalgam/English.lproj/MainMenu.nib/keyedobjects.nib:

プラギンの仕様を変更
サブランチャはデリゲートメソッドをそのままなげるほうがいいかも……

Location:
lang/ruby/Amalgam
Files:
1 added
9 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/Amalgam/Amalgam.xcodeproj/cho45.mode1

    r754 r794  
    257257                                                        <array> 
    258258                                                                <string>29B97314FDCFA39411CA2CEA</string> 
     259                                                                <string>080E96DDFE201D6D7F000001</string> 
    259260                                                                <string>29B97317FDCFA39411CA2CEA</string> 
    260261                                                                <string>1C37FABC05509CD000000102</string> 
     
    263264                                                        <array> 
    264265                                                                <array> 
    265                                                                         <integer>4</integer> 
    266                                                                         <integer>3</integer> 
     266                                                                        <integer>1</integer> 
    267267                                                                        <integer>0</integer> 
    268268                                                                </array> 
     
    369369                        <key>TableOfContents</key> 
    370370                        <array> 
    371                                 <string>745815A30CD31BD2009F19BA</string> 
     371                                <string>745CBB1F0CD4C841005D7A02</string> 
    372372                                <string>1CE0B1FE06471DED0097A5F4</string> 
    373                                 <string>745815A40CD31BD2009F19BA</string> 
     373                                <string>745CBB200CD4C841005D7A02</string> 
    374374                                <string>1CE0B20306471E060097A5F4</string> 
    375375                                <string>1CE0B20506471E060097A5F4</string> 
     
    505505        <key>WindowOrderList</key> 
    506506        <array> 
     507                <string>745CBB210CD4C841005D7A02</string> 
    507508                <string>/Users/cho45/coderepos/lang/ruby/Amalgam/Amalgam.xcodeproj</string> 
     509                <string>1C0AD2B3069F1EA900FABCE6</string> 
    508510        </array> 
    509511        <key>WindowString</key> 
     
    512514        <array> 
    513515                <dict> 
     516                        <key>FirstTimeWindowDisplayed</key> 
     517                        <false/> 
    514518                        <key>Identifier</key> 
    515519                        <string>windowTool.build</string> 
     520                        <key>IsVertical</key> 
     521                        <true/> 
    516522                        <key>Layout</key> 
    517523                        <array> 
     
    525531                                                                <string>1CD0528F0623707200166675</string> 
    526532                                                                <key>PBXProjectModuleLabel</key> 
    527                                                                 <string>&lt;No Editor&gt;</string> 
    528                                                                 <key>PBXSplitModuleInNavigatorKey</key> 
    529                                                                 <dict> 
    530                                                                         <key>Split0</key> 
    531                                                                         <dict> 
    532                                                                                 <key>PBXProjectModuleGUID</key> 
    533                                                                                 <string>1CD052900623707200166675</string> 
    534                                                                         </dict> 
    535                                                                         <key>SplitCount</key> 
    536                                                                         <string>1</string> 
    537                                                                 </dict> 
     533                                                                <string></string> 
    538534                                                                <key>StatusBarVisibility</key> 
    539                                                                 <integer>1</integer> 
     535                                                                <true/> 
    540536                                                        </dict> 
    541537                                                        <key>GeometryConfiguration</key> 
    542538                                                        <dict> 
    543539                                                                <key>Frame</key> 
    544                                                                 <string>{{0, 0}, {500, 215}}</string> 
     540                                                                <string>{{0, 0}, {500, 218}}</string> 
    545541                                                                <key>RubberWindowFrame</key> 
    546                                                                 <string>192 257 500 500 0 0 1280 1002 </string> 
     542                                                                <string>316 230 500 500 0 0 1280 778 </string> 
    547543                                                        </dict> 
    548544                                                        <key>Module</key> 
     
    552548                                                </dict> 
    553549                                                <dict> 
    554                                                         <key>BecomeActive</key> 
    555                                                         <integer>1</integer> 
    556550                                                        <key>ContentConfiguration</key> 
    557551                                                        <dict> 
     
    559553                                                                <string>XCMainBuildResultsModuleGUID</string> 
    560554                                                                <key>PBXProjectModuleLabel</key> 
    561                                                                 <string>Build</string> 
     555                                                                <string>ビルド</string> 
     556                                                                <key>XCBuildResultsTrigger_Collapse</key> 
     557                                                                <integer>1021</integer> 
     558                                                                <key>XCBuildResultsTrigger_Open</key> 
     559                                                                <integer>1011</integer> 
    562560                                                        </dict> 
    563561                                                        <key>GeometryConfiguration</key> 
    564562                                                        <dict> 
    565563                                                                <key>Frame</key> 
    566                                                                 <string>{{0, 222}, {500, 236}}</string> 
     564                                                                <string>{{0, 223}, {500, 236}}</string> 
    567565                                                                <key>RubberWindowFrame</key> 
    568                                                                 <string>192 257 500 500 0 0 1280 1002 </string> 
     566                                                                <string>316 230 500 500 0 0 1280 778 </string> 
    569567                                                        </dict> 
    570568                                                        <key>Module</key> 
     
    575573                                        </array> 
    576574                                        <key>Proportion</key> 
    577                                         <string>458pt</string> 
     575                                        <string>459pt</string> 
    578576                                </dict> 
    579577                        </array> 
     
    585583                        </array> 
    586584                        <key>StatusbarIsVisible</key> 
    587                         <integer>1</integer> 
     585                        <true/> 
    588586                        <key>TableOfContents</key> 
    589587                        <array> 
    590                                 <string>1C78EAA5065D492600B07095</string> 
    591                                 <string>1C78EAA6065D492600B07095</string> 
     588                                <string>745CBB210CD4C841005D7A02</string> 
     589                                <string>745CBB220CD4C841005D7A02</string> 
    592590                                <string>1CD0528F0623707200166675</string> 
    593591                                <string>XCMainBuildResultsModuleGUID</string> 
     
    596594                        <string>xcode.toolbar.config.build</string> 
    597595                        <key>WindowString</key> 
    598                         <string>192 257 500 500 0 0 1280 1002 </string> 
     596                        <string>316 230 500 500 0 0 1280 778 </string> 
     597                        <key>WindowToolGUID</key> 
     598                        <string>745CBB210CD4C841005D7A02</string> 
     599                        <key>WindowToolIsVisible</key> 
     600                        <false/> 
    599601                </dict> 
    600602                <dict> 
     
    856858                </dict> 
    857859                <dict> 
     860                        <key>FirstTimeWindowDisplayed</key> 
     861                        <false/> 
    858862                        <key>Identifier</key> 
    859863                        <string>windowTool.run</string> 
     864                        <key>IsVertical</key> 
     865                        <true/> 
    860866                        <key>Layout</key> 
    861867                        <array> 
     
    871877                                                                <string>1CD0528B0623707200166675</string> 
    872878                                                                <key>PBXProjectModuleLabel</key> 
    873                                                                 <string>Run</string> 
     879                                                                <string>実行</string> 
    874880                                                                <key>Runner</key> 
    875881                                                                <dict> 
     
    886892                                                                                <key>sizes</key> 
    887893                                                                                <array> 
    888                                                                                         <string>{{0, 0}, {493, 167}}</string> 
    889                                                                                         <string>{{0, 176}, {493, 267}}</string> 
     894                                                                                        <string>{{0, 0}, {367, 168}}</string> 
     895                                                                                        <string>{{0, 173}, {367, 270}}</string> 
    890896                                                                                </array> 
    891897                                                                        </dict> 
     
    902908                                                                                <key>sizes</key> 
    903909                                                                                <array> 
    904                                                                                         <string>{{0, 0}, {405, 443}}</string> 
    905                                                                                         <string>{{414, 0}, {514, 443}}</string> 
     910                                                                                        <string>{{0, 0}, {406, 443}}</string> 
     911                                                                                        <string>{{411, 0}, {517, 443}}</string> 
    906912                                                                                </array> 
    907913                                                                        </dict> 
     
    911917                                                        <dict> 
    912918                                                                <key>Frame</key> 
    913                                                                 <string>{{0, 0}, {460, 159}}</string> 
     919                                                                <string>{{0, 0}, {459, 159}}</string> 
    914920                                                                <key>RubberWindowFrame</key> 
    915                                                                 <string>316 696 459 200 0 0 1280 1002 </string> 
     921                                                                <string>316 530 459 200 0 0 1280 778 </string> 
    916922                                                        </dict> 
    917923                                                        <key>Module</key> 
     
    932938                        </array> 
    933939                        <key>StatusbarIsVisible</key> 
    934                         <integer>1</integer> 
     940                        <true/> 
    935941                        <key>TableOfContents</key> 
    936942                        <array> 
    937943                                <string>1C0AD2B3069F1EA900FABCE6</string> 
    938                                 <string>1C0AD2B4069F1EA900FABCE6</string> 
     944                                <string>745CBB230CD4C841005D7A02</string> 
    939945                                <string>1CD0528B0623707200166675</string> 
    940                                 <string>1C0AD2B5069F1EA900FABCE6</string> 
     946                                <string>745CBB240CD4C841005D7A02</string> 
    941947                        </array> 
    942948                        <key>ToolbarConfiguration</key> 
    943949                        <string>xcode.toolbar.config.run</string> 
    944950                        <key>WindowString</key> 
    945                         <string>316 696 459 200 0 0 1280 1002 </string> 
     951                        <string>316 530 459 200 0 0 1280 778 </string> 
    946952                        <key>WindowToolGUID</key> 
    947953                        <string>1C0AD2B3069F1EA900FABCE6</string> 
    948954                        <key>WindowToolIsVisible</key> 
    949                         <integer>0</integer> 
     955                        <true/> 
    950956                </dict> 
    951957                <dict> 
  • lang/ruby/Amalgam/Amalgam.xcodeproj/cho45.pbxuser

    r754 r794  
    3636                                ); 
    3737                        }; 
    38                         PBXPerProjectTemplateStateSaveDate = 215161437; 
    39                         PBXWorkspaceStateSaveDate = 215161437; 
     38                        PBXPerProjectTemplateStateSaveDate = 215271155; 
     39                        PBXWorkspaceStateSaveDate = 215271155; 
    4040                }; 
    4141                sourceControlManager = 74A87A1F0CD159CB00A3470F /* Source Control */; 
     
    6262                debuggerPlugin = GDBDebugging; 
    6363                disassemblyDisplayState = 0; 
     64                dylibVariantSuffix = ""; 
    6465                enableDebugStr = 1; 
    6566                environmentEntries = ( 
  • lang/ruby/Amalgam/Amalgam.xcodeproj/project.pbxproj

    r754 r794  
    1515                4DDCA70D0ACC9A6100E082CE /* RubyCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */; }; 
    1616                745815A00CD31B04009F19BA /* plugins in Resources */ = {isa = PBXBuildFile; fileRef = 7458159C0CD31B04009F19BA /* plugins */; }; 
     17                745CBB1D0CD4C709005D7A02 /* plugin_base.rb in Resources */ = {isa = PBXBuildFile; fileRef = 745CBB1C0CD4C709005D7A02 /* plugin_base.rb */; }; 
    1718                747D3D2F0CD26D5200284FB4 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 747D3D2E0CD26D5200284FB4 /* icon.icns */; }; 
    1819                74A87A220CD159D000A3470F /* AppController.rb in Resources */ = {isa = PBXBuildFile; fileRef = 74A87A210CD159D000A3470F /* AppController.rb */; }; 
     
    4647                4DDCA7120ACC9A6100E082CE /* Amalgam.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Amalgam.app; sourceTree = BUILT_PRODUCTS_DIR; }; 
    4748                7458159C0CD31B04009F19BA /* plugins */ = {isa = PBXFileReference; lastKnownFileType = folder; path = plugins; sourceTree = "<group>"; }; 
     49                745CBB1C0CD4C709005D7A02 /* plugin_base.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = plugin_base.rb; sourceTree = "<group>"; }; 
    4850                747D3D2E0CD26D5200284FB4 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = "<group>"; }; 
    4951                74A87A210CD159D000A3470F /* AppController.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = AppController.rb; sourceTree = "<group>"; }; 
     
    6870                        isa = PBXGroup; 
    6971                        children = ( 
     72                                745CBB1C0CD4C709005D7A02 /* plugin_base.rb */, 
    7073                                74A87A210CD159D000A3470F /* AppController.rb */, 
    7174                        ); 
     
    205208                                747D3D2F0CD26D5200284FB4 /* icon.icns in Resources */, 
    206209                                745815A00CD31B04009F19BA /* plugins in Resources */, 
     210                                745CBB1D0CD4C709005D7A02 /* plugin_base.rb in Resources */, 
    207211                        ); 
    208212                        runOnlyForDeploymentPostprocessing = 0; 
  • lang/ruby/Amalgam/AppController.rb

    r791 r794  
    125125end 
    126126 
    127 require "singleton" 
    128127require "yaml" 
     128require "rubygems" 
     129require "module/pluggable" 
     130require "plugin_base" 
    129131class AmalgamConfig 
    130         include Singleton 
    131132 
    132133        PATH = Pathname.new("#{ENV["HOME"]}/.amalgam") 
     134 
     135        pluggable :plugins,         :base_class  => AmalgamPlugin, 
     136                                    :search_path => (PATH + "plugins").to_s 
     137        pluggable :default_plugins, :base_class  => AmalgamPlugin, 
     138                                    :search_path => (NSBundle.mainBundle.resourcePath + "/plugins").to_s 
    133139 
    134140        Default = { 
     
    136142        }.freeze 
    137143 
    138  
    139         def initialize 
     144        def initialize(controller) 
     145                @controller = controller 
    140146                begin 
    141147                        @config = Default.merge(YAML.load((PATH+"config.yaml").read)) 
     
    143149                        @config = Default 
    144150                end 
    145                 @default_plugins = Pathname.glob(NSBundle.mainBundle.resourcePath + "/plugins/**/*.rb") 
     151                plugins.init(controller) 
     152                default_plugins.init(controller) 
    146153        end 
    147154 
     
    155162                "" 
    156163        end 
    157  
    158         def plugins 
    159                 @default_plugins + Pathname.glob(PATH + "plugins/**/*.rb") 
    160         rescue 
    161                 @default_plugins 
    162         end 
    163164end 
    164165 
     
    167168        ib_outlet :input 
    168169        ib_outlet :results 
     170 
     171        attr_reader :candidates 
     172 
     173        def search_text 
     174                @input.stringValue 
     175        end 
     176 
     177        def search_text=(val) 
     178                @input.stringValue = val 
     179        end 
    169180 
    170181        # Tableview 
     
    205216        def run_current_selection(*) 
    206217                if @now[@results.selectedRow] 
    207                         @now[@results.selectedRow].call 
     218                        begin 
     219                                @now[@results.selectedRow].call 
     220                        rescue Exception => e 
     221                                log e 
     222                                alert("Error", e.inspect) 
     223                        end 
    208224                end 
    209225        end 
     
    242258        def awakeFromNib 
    243259                @history = History.new 
    244                 @config  = AmalgamConfig.instance 
     260                log "Loading Config" 
     261                @config  = AmalgamConfig.new(self) 
    245262 
    246263                rect = @view.frame 
     
    397414                end 
    398415 
    399                 @candidates << Command.new("d", "Debug eval", :sh) do 
    400                         log :d 
     416                @candidates << Command.new(".d", "Debug eval", :sh) do 
    401417                        _, code = @input.stringValue.split(/\s+/, 2) 
    402418 
     
    429445                end 
    430446 
    431                 b = binding 
    432                 @config.plugins.each do |f| 
    433                         log "Plugin #{f} processing..." 
    434                         begin 
    435                                 eval(f.read, b) 
    436                         rescue Exception => e 
    437                                 log e 
    438                                 OSX.NSRunAlertPanel("Plugin #{f} Error", e.inspect, "OK", "", nil) 
    439                         end 
    440                 end 
     447#               b = binding 
     448#               @config.plugins.each do |f| 
     449#                       log "Plugin #{f} processing..." 
     450#                       begin 
     451#                               eval(f.read, b) 
     452#                       rescue Exception => e 
     453#                               log e 
     454#                               OSX.NSRunAlertPanel("Plugin #{f} Error", e.inspect, "OK", "", nil) 
     455#                       end 
     456#               end 
     457                log @config.default_plugins 
     458                @config.default_plugins.candidates.each do |k,v| 
     459                        @candidates.concat v 
     460                end 
     461#               @config.plugins.candidates.each do |k,v| 
     462#                       log k 
     463#                       @candidates.concat v 
     464#               end 
    441465 
    442466                @candidates.replace @candidates.sort_by {|c| c.name } 
     
    446470        end 
    447471 
    448         def search_applications_recursive(dir) 
    449                 ret = [] 
    450                 Pathname.glob("#{dir}/*") do |f| 
    451                         next unless f.directory? 
    452                         if f.extname == ".app" 
    453                                 ret << f 
    454                                 #set_status "Found.. #{f.basename}" 
    455                         else 
    456                                 ret.concat search_applications_recursive(f) 
    457                         end 
    458                 end 
    459                 ret 
    460         end 
    461  
    462 end 
    463  
    464  
     472 
     473end 
     474 
     475 
  • lang/ruby/Amalgam/English.lproj/MainMenu.nib/info.nib

    r747 r794  
    88        <dict> 
    99                <key>196</key> 
    10                 <string>350 466 358 235 0 0 1280 778 </string> 
     10                <string>461 410 358 235 0 0 1280 778 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
  • lang/ruby/Amalgam/plugins/applications.rb

    r783 r794  
    11#!/usr/bin/env ruby 
    22 
    3 applications = [] 
    4 applications.concat search_applications_recursive("/Applications") 
    5 applications.concat search_applications_recursive("/Developer/Applications") 
    6 applications.concat search_applications_recursive("/System/Library/CoreServices") 
     3class Applications < AmalgamPlugin 
    74 
    8 @candidates.concat applications.map {|f| 
    9         Candidate.new(f.basename(".app").to_s, f.realpath, f.realpath) do |c| 
    10                 log [:open_a, c, f] 
    11                 system("open", "-a", f) 
     5        def candidates 
     6                applications = [] 
     7                applications.concat search_applications_recursive("/Applications") 
     8                applications.concat search_applications_recursive("/Developer/Applications") 
     9                applications.concat search_applications_recursive("/System/Library/CoreServices") 
     10 
     11                applications.map {|f| 
     12                        Candidate.new(f.basename(".app").to_s, f.realpath, f.realpath) do |c| 
     13                                log [:open_a, c, f] 
     14                                system("open", "-a", f) 
     15                        end 
     16                } 
    1217        end 
    13 } 
    1418 
     19        private 
     20        def search_applications_recursive(dir) 
     21                ret = [] 
     22                Pathname.glob("#{dir}/*") do |f| 
     23                        next unless f.directory? 
     24                        if f.extname == ".app" 
     25                                ret << f 
     26                                #set_status "Found.. #{f.basename}" 
     27                        else 
     28                                ret.concat search_applications_recursive(f) 
     29                        end 
     30                end 
     31                ret 
     32        end 
     33 
     34end 
     35 
     36 
  • lang/ruby/Amalgam/plugins/firefox.rb

    r791 r794  
    22# 
    33 
    4 def history(text="") 
    5         require "net/telnet" 
    6         telnet = Net::Telnet.new("Host" => "localhost", "Port" => 4242, "Prompt" => /repl> \z/) 
    7         telnet.cmd("") 
    8         result = "" 
    9         telnet.cmd(<<-EOF) { |c| result << c } 
    10         (function () { try { 
    11                 var searchString = ""; 
    12                 var searchParam = ""; 
    13                 var previousResult = null; 
    14                 //var history = Cc["@mozilla.org/browser/global-history;2"].getService(Ci.nsIBrowserHistory); 
    15                 var history = Cc["@mozilla.org/browser/global-history;2"].getService(Ci.nsIAutoCompleteSearch); 
    16                 //.createInstance(Ci.nsIAutoCompleteSearch); 
    17                 var results; 
    18                 history.startSearch(searchString, searchParam, previousResult, { 
    19                         onSearchResult: function (search, result) { 
    20                                 results = []; 
    21         //                      alert([search, result]); 
    22         //                      alert([result.matchCount, result.searchResult, result.getValueAt(0)]); 
    23                                 for (var i = 0; i < result.matchCount; i++) { 
    24                                         results.push(result.getValueAt(i)); 
     4class Firefox < AmalgamPlugin 
     5 
     6        def history(text="") 
     7                require "net/telnet" 
     8                telnet = Net::Telnet.new("Host" => "localhost", "Port" => 4242, "Prompt" => /repl> \z/) 
     9                telnet.cmd("") 
     10                result = "" 
     11                telnet.cmd(<<-EOF) { |c| result << c } 
     12                (function () { try { 
     13                        var searchString = ""; 
     14                        var searchParam = ""; 
     15                        var previousResult = null; 
     16                        //var history = Cc["@mozilla.org/browser/global-history;2"].getService(Ci.nsIBrowserHistory); 
     17                        var history = Cc["@mozilla.org/browser/global-history;2"].getService(Ci.nsIAutoCompleteSearch); 
     18                        //.createInstance(Ci.nsIAutoCompleteSearch); 
     19                        var results; 
     20                        history.startSearch(searchString, searchParam, previousResult, { 
     21                                onSearchResult: function (search, result) { 
     22                                        results = []; 
     23                //                      alert([search, result]); 
     24                //                      alert([result.matchCount, result.searchResult, result.getValueAt(0)]); 
     25                                        for (var i = 0; i < result.matchCount; i++) { 
     26                                                results.push(result.getValueAt(i)); 
     27                                        } 
    2528                                } 
    26                         } 
    27                 }); 
    28                 return results.toSource(); 
    29         } catch (e) { alert(e) } })(); 
    30         EOF 
    31         telnet.cmd("") { |c| result << c } 
    32         eval(result.gsub(/repl> /, "")) 
    33 end 
     29                        }); 
     30                        return results.toSource(); 
     31                } catch (e) { alert(e) } })(); 
     32                EOF 
     33                telnet.cmd("") { |c| result << c } 
     34                eval(result.gsub(/repl> /, "")) 
     35        end 
    3436 
    35 Thread.start do 
    36         Thread.abort_on_exception = true 
    37         icon = NSWorkspace.sharedWorkspace.iconForFileType('unknown') 
    38         @fx_candidates = history.map do |m| 
    39                 Candidate.new(m, m, icon) do 
    40                         system "open", "-a", "Firefox", m 
    41                         @candidates.return 
     37        def init(c) 
     38                super 
     39                Thread.start do 
     40                        Thread.abort_on_exception = true 
     41                        icon = NSWorkspace.sharedWorkspace.iconForFileType('html') 
     42                        @candidates = history.map do |m| 
     43                                Candidate.new(m, m, icon) do 
     44                                        system "open", "-a", "Firefox", m 
     45                                        @candidates.return 
     46                                end 
     47                        end 
     48                        log :loaded_fx_history 
    4249                end 
    4350        end 
    44         log :loaded_fx_history 
    45 end 
    4651 
    47  
    48 @candidates << Candidate.new("fx", "Firefox History", :sh) do 
    49         @candidates.into(@fx_candidates || []) 
    50         @input.stringValue = "" 
    51         filtering "" 
     52        def candidates 
     53                [ 
     54                        Candidate.new("fx", "Firefox History", "/Applications/Firefox.app") do 
     55                                amalgam.candidates.into(@candidates || []) 
     56                                amalgam.search_text = "" 
     57                                amalgam.filtering "" 
     58                        end 
     59                ] 
     60        end 
    5261end 
    5362 
  • lang/ruby/Amalgam/plugins/prefpanes.rb

    r783 r794  
    11 
    2 @candidates.concat Pathname.glob("/System/Library/PreferencePanes/*.prefPane").map {|f| 
    3         Candidate.new(f.basename.to_s, f.basename(".prefPane"), f.realpath) do 
    4                 system("open", f) 
     2class Prefpanes < AmalgamPlugin 
     3        def candidates 
     4                Pathname.glob("/System/Library/PreferencePanes/*.prefPane").map {|f| 
     5                        Candidate.new(f.basename.to_s, f.basename(".prefPane"), f.realpath) do 
     6                                system("open", f) 
     7                        end 
     8                } 
    59        end 
    6 } 
     10end 
    711 
    812