--- 
name: Ruby on Rails
fileTypes: 
- rxml
scopeName: source.ruby.rails
uuid: 54D6E91E-8F31-11D9-90C5-0011242E4184
foldingStartMarker: "(?x)^\n\
  \t    (\\s*+\n\
  \t        (module|class|def\n\
  \t        |unless|if\n\
  \t        |case\n\
  \t        |begin\n\
  \t        |for|while|until\n\
  \t        |(  \"(\\\\.|[^\"])*+\"          # eat a double quoted string\n\
  \t         | '(\\\\.|[^'])*+'        # eat a single quoted string\n\
  \t         |   [^#\"']                # eat all but comments and strings\n\
  \t         )*\n\
  \t         (                 \\s   (do|begin|case)\n\
  \t         | [-+=&|*/~%^<>~] \\s*+ (if|unless)\n\
  \t         )\n\
  \t        )\\b\n\
  \t        (?! [^;]*+ ; .*? \\bend\\b )\n\
  \t    |(  \"(\\\\.|[^\"])*+\"              # eat a double quoted string\n\
  \t     | '(\\\\.|[^'])*+'            # eat a single quoted string\n\
  \t     |   [^#\"']                    # eat all but comments and strings\n\
  \t     )*\n\
  \t     ( \\{ (?!  [^}]*+ \\} )\n\
  \t     | \\[ (?! [^\\]]*+ \\] )\n\
  \t     )\n\
  \t    ).*$\n\
  \t|   [#] .*? \\(fold\\) \\s*+ $         # Sune\xE2\x80\x99s special marker\n\
  \t"
patterns: 
- name: meta.rails.functional_test
  begin: (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+ControllerTest(\s*<\s*[.a-zA-Z0-9_:]+)?)))
  end: ^\1(?=end)\b
  patterns: 
  - include: source.ruby
  - include: $self
  comment: Uses lookahead to match classes with the ControllerTest suffix; includes 'source.ruby' to avoid infinite recursion
- name: meta.rails.controller
  begin: (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+Controller\b(\s*<\s*[.a-zA-Z0-9_:]+)?)|(<<\s*[.a-zA-Z0-9_:]+)))(?!.+\bend\b)
  end: ^\1(?=end)\b
  patterns: 
  - include: source.ruby
  - include: $self
  comment: Uses lookahead to match classes with the Controller suffix; includes 'source.ruby' to avoid infinite recursion
- name: meta.rails.helper
  begin: (^\s*)(?=module\s+((([A-Z]\w*::)*)[A-Z]\w*)Helper)
  end: ^\1(?=end)\b
  patterns: 
  - include: source.ruby
  - include: $self
  comment: Uses lookahead to match modules with the Helper suffix; includes 'source.ruby' to avoid infinite recursion
- name: meta.rails.mailer
  begin: (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+(\s*<\s*ActionMailer::Base))))
  end: ^\1(?=end)\b
  patterns: 
  - include: source.ruby
  - include: $self
  comment: Uses lookahead to match classes that inherit from ActionMailer::Base; includes 'source.ruby' to avoid infinite recursion
- name: meta.rails.model
  begin: (^\s*)(?=class\s+.+ActiveRecord::Base)
  end: ^\1(?=end)\b
  patterns: 
  - include: source.ruby
  - include: $self
  comment: Uses lookahead to match classes that (may) inherit from ActiveRecord::Base; includes 'source.ruby' to avoid infinite recursion
- name: meta.rails.unit_test
  begin: (^\s*)(?=class\s+(?![.a-zA-Z0-9_:]+ControllerTest)(([.a-zA-Z0-9_:]+Test(\s*<\s*[.a-zA-Z0-9_:]+)?)|(<<\s*[.a-zA-Z0-9_:]+)))
  end: ^\1(?=end)\b
  patterns: 
  - include: source.ruby
  - include: $self
  comment: Uses lookahead to match classes with the Test suffix; includes 'source.ruby' to avoid infinite recursion
- name: support.function.actionpack.rails
  match: \b(before_filter|skip_before_filter|skip_after_filter|after_filter|around_filter|filter|filter_parameter_logging|layout|require_dependency|render|render_action|render_text|render_file|render_template|render_nothing|render_component|render_without_layout|url_for|redirect_to|redirect_to_path|redirect_to_url|helper|helper_method|model|service|observer|serialize|scaffold|verify|hide_action)\b
- name: support.function.activerecord.rails
  match: \b(acts_as_list|acts_as_tree|after_create|after_destroy|after_save|after_update|after_validation|after_validation_on_create|after_validation_on_update|before_create|before_destroy|before_save|before_update|before_validation|before_validation_on_create|before_validation_on_update|composed_of|belongs_to|has_one|has_many|has_and_belongs_to_many|helper|helper_method|validate|validate_on_create|validates_numericality_of|validate_on_update|validates_acceptance_of|validates_associated|validates_confirmation_of|validates_each|validates_format_of|validates_inclusion_of|validates_length_of|validates_presence_of|validates_size_of|validates_uniqueness_of|attr_protected|attr_accessible)\b
- name: support.function.activesupport.rails
  match: \b(cattr_accessor|mattr_accessor)\b
- include: source.ruby
foldingStopMarker: "(?x)\n\
  \t\t(   (^|;) \\s*+ end   \\s*+ ([#].*)? $\n\
  \t\t|   ^     \\s*+ [}\\]] \\s*+ ([#].*)? $\n\
  \t\t|   [#] .*? \\(end\\) \\s*+ $    # Sune\xE2\x80\x99s special marker\n\
  \t\t)"
keyEquivalent: ^~R
