Parent

Included Modules

Class Index [+]

Quicksearch

Cucumber::PySupport::PyLanguage

Public Class Methods

new(step_mother) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 8
 8:       def initialize(step_mother)
 9:         @step_def_files = []
10:         #
11:         # @python_path = ENV['PYTHONPATH'] ? ENV['PYTHONPATH'].split(':') : []
12:         # add_to_python_path(File.dirname(__FILE__))
13:         #
14:         # RubyPython.start
15:         # at_exit{RubyPython.stop}
16:         #
17:         # import(File.dirname(__FILE__) + '/py_language.py')
18:       end

Public Instance Methods

alias_adverbs(adverbs) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 24
24:       def alias_adverbs(adverbs)
25:       end
begin_scenario(scenario) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 35
35:       def begin_scenario(scenario)
36:         @python_path = []
37:         add_to_python_path(File.dirname(__FILE__))
38:         @step_def_files.each{|f| add_to_python_path(File.dirname(f))}
39: 
40:         RubyPython.start
41: 
42:         @delegate = import(File.dirname(__FILE__) + '/py_language.py')
43:         @step_def_files.each{|f| import(f)}
44:       end
end_scenario() click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 46
46:       def end_scenario
47:       end
load_code_file(py_file) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 20
20:       def load_code_file(py_file)
21:         @step_def_files << py_file
22:       end
snippet_text(step_keyword, step_name, multiline_arg_class) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 31
31:       def snippet_text(step_keyword, step_name, multiline_arg_class)
32:         "python snippet: #{step_keyword}, #{step_name}"
33:       end
step_definitions_for(py_file) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 27
27:       def step_definitions_for(py_file)
28:         mod = import(py_file)
29:       end
step_matches(step_name, name_to_report) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 49
49:       def step_matches(step_name, name_to_report)
50:         @delegate.step_matches(step_name, name_to_report)
51:       end

Private Instance Methods

add_to_python_path(dir) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 65
65:       def add_to_python_path(dir)
66:         dir = File.expand_path(dir)
67:         @python_path.unshift(dir)
68:         @python_path.uniq!
69:         ENV['PYTHONPATH'] = @python_path.join(':')
70:       end
import(path) click to toggle source
    # File lib/cucumber/py_support/py_language.rb, line 55
55:       def import(path)
56:         modname = File.basename(path)[0...-File.extname(path).length]
57:         begin
58:           mod = RubyPython.import(modname)
59:         rescue PythonError => e
60: #          e.message << "Couldn't load #{path}\nConsider adding #{File.expand_path(File.dirname(path))} to your PYTHONPATH"
61:           raise e
62:         end
63:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.