Ok I'll show you how to map type to existing method (1) and how to define dynamic method (2). 1. RM cannot infer type of method Date.strptime thus let's fix it 2. Lets add to autocompletion/resolve our be_rubymine fake RSpec matcher
(On the screenshot autocompletion doesn't work after date.<caret> (line 5) and be_rubymine isn't in autocompletion (line 12)
# type for method
require 'date'
dob = "08/04/1975"
date = Date.strptime(dob, "%m/%d/%Y")
puts date.month
# dynamic method
require 'spec'
describe "doo" do
it "should smth" do
be_rubymine
end
end
Solution
1. Let's create some folder(e.g. rm_ext) and RubyMine project for it. 2. Let's create ruby script (e.g. scripts/dynamic_defs.rb) which will contain definitions for types/dynamic methods
3. Now let's ask RubyMine to load dynamic_defs.rb file on each startup. For this add folder rm_ext/scripts to File | Settings | Script Folders
4. Now let's register dynamic types and methods. Open "dynamic_defs.rb" At current moment RubyMine doesn't add api folder to load path, but we will fix in next builds. So let's add string
Sorry I didn't understand this
Ok I'll show you how to map type to existing method (1) and how to define dynamic method (2).

1. RM cannot infer type of method Date.strptime thus let's fix it
2. Lets add to autocompletion/resolve our be_rubymine fake RSpec matcher
(On the screenshot autocompletion doesn't work after date.<caret> (line 5) and be_rubymine isn't in autocompletion (line 12)
Solution
1. Let's create some folder(e.g. rm_ext) and RubyMine project for it.
2. Let's create ruby script (e.g. scripts/dynamic_defs.rb) which will contain definitions for types/dynamic methods
3. Now let's ask RubyMine to load dynamic_defs.rb file on each startup. For this add folder rm_ext/scripts to File | Settings | Script Folders
4. Now let's register dynamic types and methods. Open "dynamic_defs.rb"
At current moment RubyMine doesn't add api folder to load path, but we will fix in next builds.
So let's add string
5. Then ask RubyMine's code insight to use extended load path. Add "/Applications/idea/RubyMine 2.0 Beta.app/rb/api" to File | Settings | Project Structure | Load Path
6.
7. Register type for existing method Date.strptime
8. Register dynamic method "be_rubymine" and link to existing Spec::Matchers.be
9. Restart RubyMine
10. Let's create test file "foo_spec.rb" mentioned after tasks #1, #2. And all works!
Place caret after "date."
Place caret on "date" and invoke Quick Documentation Lookup
Invoke Quick Definition Lookup on be_rubymine
Also you can consider as examples:
RubyMine 2.0 Beta.app/rb/scripts/rspec_code_insight_provider.rb
RubyMine 2.0 Beta.app/rb/scripts/rails_code_insight_provider.rb
It is great, thanks. I will take a try.
Line
wont be required in next RM 2.0 build
Update:
RubyMine 2.0.1 will automatically extend extension scripts load path with [RubyMine]/rb/api and [RubyMine]/rb/scripts directories