Skip to content

Instantly share code, notes, and snippets.

@skorfmann
Created May 2, 2010 08:44
Show Gist options
  • Save skorfmann/387007 to your computer and use it in GitHub Desktop.
Save skorfmann/387007 to your computer and use it in GitHub Desktop.
#
# Copyright 2000-2009 JetBrains s.r.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
include Java
require 'default_scripts_groups'
require 'editor_action_helper'
register_editor_action "PostToGist",
:text => "Posts selection to Gist",
:description => "Posts selection to Gist",
:shortcut => "control alt shift G" do |editor, file, project, context|
selection = editor.selection
editor.insert_text "<%= #{selection} %>"
inspector = lambda {|obj| puts (obj.methods - Object.methods).inspect }
inspector.call(editor)
inspector.call(file)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment