rubybuntu-gedit 11.08.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +20 -0
- data/Rakefile +28 -0
- data/bin/rubybuntu-gedit +88 -0
- data/data/language-specs/README.rdoc +73 -0
- data/data/language-specs/erb.lang +53 -0
- data/data/language-specs/html-erb.lang +48 -0
- data/data/language-specs/javascript-erb.lang +23 -0
- data/data/language-specs/ruby-bundler-gemfile-lock.lang +101 -0
- data/data/language-specs/ruby-erb.lang +22 -0
- data/data/language-specs/ruby.lang +1068 -0
- data/data/language-specs/ruby.lang-extras/important-constants.rb +7 -0
- data/data/language-specs/ruby.lang-extras/important-methods.rb +3 -0
- data/data/language-specs/ruby.lang-extras/known-bugs.rb +11 -0
- data/data/language-specs/xml-erb.lang +22 -0
- data/data/language-specs/yml-erb.lang +21 -0
- data/data/mime/README.rdoc +17 -0
- data/data/mime/cucumber.xml +9 -0
- data/data/mime/haml.xml +8 -0
- data/data/mime/ruby-builder.xml +9 -0
- data/data/mime/ruby-bundler.xml +13 -0
- data/data/mime/ruby-capistrano.xml +9 -0
- data/data/mime/ruby-erb.xml +62 -0
- data/data/mime/ruby-rack.xml +8 -0
- data/data/mime/ruby-rake.xml +10 -0
- data/data/mime/ruby-thor.xml +10 -0
- data/data/mime/ruby.xml +13 -0
- data/data/mime/sass.xml +14 -0
- data/data/mime/slim.xml +8 -0
- data/data/snippets/MIT-LICENSE +20 -0
- data/data/snippets/README.textile +108 -0
- data/data/snippets/TODO +6 -0
- data/data/snippets/cheatsheet.html +1602 -0
- data/data/snippets/doc/Gemfile +6 -0
- data/data/snippets/doc/Gemfile.lock +16 -0
- data/data/snippets/doc/create_documentation.rb +56 -0
- data/data/snippets/doc/documentation_stylesheet.sass +100 -0
- data/data/snippets/doc/documentation_stylesheet_print.sass +93 -0
- data/data/snippets/doc/documentation_template.haml +36 -0
- data/data/snippets/doc/gedit-snippets-logo.png +0 -0
- data/data/snippets/doc/gedit-snippets-logo.svg +626 -0
- data/data/snippets/doc/method_parser.rb +24 -0
- data/data/snippets/erb.xml +84 -0
- data/data/snippets/html-erb.xml +84 -0
- data/data/snippets/javascript-erb.xml +84 -0
- data/data/snippets/rails_activerecord_associations.xml +34 -0
- data/data/snippets/rails_activerecord_basic.xml +11 -0
- data/data/snippets/rails_activerecord_validations.xml +210 -0
- data/data/snippets/rails_controllers_basic.xml +19 -0
- data/data/snippets/rhtml_basic.xml +70 -0
- data/data/snippets/rhtml_forms.xml +75 -0
- data/data/snippets/rhtml_html.xml +98 -0
- data/data/snippets/ruby-erb.xml +84 -0
- data/data/snippets/ruby_basic.xml +142 -0
- data/data/snippets/ruby_collections.xml +163 -0
- data/data/snippets/shoulda_actioncontroller.xml +73 -0
- data/data/snippets/shoulda_activerecord.xml +127 -0
- data/data/snippets/shoulda_basic.xml +22 -0
- data/data/snippets/snippet_tools.xml +32 -0
- data/data/snippets/xml-erb.xml +84 -0
- data/data/snippets/yml-erb.xml +84 -0
- data/data/styles/README.rdoc +17 -0
- data/data/styles/rubybuntu1.xml +119 -0
- data/rubybuntu-gedit.gemspec +26 -0
- metadata +125 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
#
|
2
|
+
# Simple helper that will parse the given method names into a skeleton for snippets
|
3
|
+
#
|
4
|
+
methods = %w{should_assign_to should_filter_params should_not_assign_to should_not_set_the_flash should_redirect_to should_render_template should_render_with_layout should_render_without_layout should_respond_with should_respond_with_content_type should_return_from_session should_route should_set_session should_set_the_flash_to}
|
5
|
+
|
6
|
+
snippet_template = '<snippet>
|
7
|
+
<text><![CDATA[__TEXT__]]></text>
|
8
|
+
<tag>__TAG__</tag>
|
9
|
+
<description>__DESC__</description>
|
10
|
+
</snippet>'
|
11
|
+
|
12
|
+
methods.each do |m|
|
13
|
+
name = m.strip.chomp.to_s
|
14
|
+
# Generate the tag from method name
|
15
|
+
tag = name.split('_').map { |w| w[0..0] }.join('')
|
16
|
+
|
17
|
+
# Process the snippet template
|
18
|
+
snippet = snippet_template.clone
|
19
|
+
snippet.gsub!('__TEXT__', "#{name} ${1:attribute}$0")
|
20
|
+
snippet.gsub!('__TAG__', "#{tag}")
|
21
|
+
snippet.gsub!('__DESC__', "#{name} ...")
|
22
|
+
|
23
|
+
puts snippet
|
24
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
|
+
<!--
|
3
|
+
RHTML Ruby code snippets
|
4
|
+
-->
|
5
|
+
<snippets language="erb">
|
6
|
+
<!--
|
7
|
+
ERb Tags
|
8
|
+
-->
|
9
|
+
<snippet>
|
10
|
+
<text><![CDATA[<%= $0 %>]]></text>
|
11
|
+
<tag>=</tag>
|
12
|
+
<description><%= block result %></description>
|
13
|
+
</snippet>
|
14
|
+
<snippet>
|
15
|
+
<text><![CDATA[<% $0 -%>]]></text>
|
16
|
+
<tag>%</tag>
|
17
|
+
<description><% ruby code block %></description>
|
18
|
+
</snippet>
|
19
|
+
|
20
|
+
<!--
|
21
|
+
Blocks
|
22
|
+
-->
|
23
|
+
<snippet>
|
24
|
+
<text><![CDATA[do
|
25
|
+
$0
|
26
|
+
end]]></text>
|
27
|
+
<tag>do</tag>
|
28
|
+
<description>do .. end</description>
|
29
|
+
</snippet>
|
30
|
+
<snippet>
|
31
|
+
<text><![CDATA[do |${1:object}|
|
32
|
+
$0
|
33
|
+
end]]></text>
|
34
|
+
<tag>doo</tag>
|
35
|
+
<description>do |object| .. end</description>
|
36
|
+
</snippet>
|
37
|
+
|
38
|
+
<!--
|
39
|
+
Collection iterators
|
40
|
+
-->
|
41
|
+
<snippet>
|
42
|
+
<text><![CDATA[<% ${1:@list}.each do |${2:item}| do %>
|
43
|
+
$0
|
44
|
+
<% end %>]]></text>
|
45
|
+
<tag>eacho</tag>
|
46
|
+
<description>each do item</description>
|
47
|
+
</snippet>
|
48
|
+
<snippet>
|
49
|
+
<text><![CDATA[<%= for ${1:element} in ${2:collection}
|
50
|
+
${1:element}.$0
|
51
|
+
end %>]]></text>
|
52
|
+
<tag>forin</tag>
|
53
|
+
<description>for .. in .. end</description>
|
54
|
+
</snippet>
|
55
|
+
|
56
|
+
<!--
|
57
|
+
Conditions
|
58
|
+
-->
|
59
|
+
<snippet>
|
60
|
+
<text><![CDATA[<% if ${1:logged_in?} %>
|
61
|
+
$0
|
62
|
+
<% end %>]]></text>
|
63
|
+
<tag>if</tag>
|
64
|
+
<description>if statement</description>
|
65
|
+
</snippet>
|
66
|
+
<snippet>
|
67
|
+
<text><![CDATA[<% if ${1:logged_in?} %>
|
68
|
+
$0
|
69
|
+
<% else %>
|
70
|
+
|
71
|
+
<% end %>]]></text>
|
72
|
+
<tag>ife</tag>
|
73
|
+
<description>if ... else ... end</description>
|
74
|
+
</snippet>
|
75
|
+
|
76
|
+
<!--
|
77
|
+
Uncategorized
|
78
|
+
-->
|
79
|
+
<snippet>
|
80
|
+
<text><![CDATA[<% end %>]]></text>
|
81
|
+
<tag>end</tag>
|
82
|
+
<description>end tag</description>
|
83
|
+
</snippet>
|
84
|
+
</snippets>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
|
+
<!--
|
3
|
+
RHTML Ruby code snippets
|
4
|
+
-->
|
5
|
+
<snippets language="html-erb">
|
6
|
+
<!--
|
7
|
+
ERb Tags
|
8
|
+
-->
|
9
|
+
<snippet>
|
10
|
+
<text><![CDATA[<%= $0 %>]]></text>
|
11
|
+
<tag>=</tag>
|
12
|
+
<description><%= block result %></description>
|
13
|
+
</snippet>
|
14
|
+
<snippet>
|
15
|
+
<text><![CDATA[<% $0 -%>]]></text>
|
16
|
+
<tag>%</tag>
|
17
|
+
<description><% ruby code block %></description>
|
18
|
+
</snippet>
|
19
|
+
|
20
|
+
<!--
|
21
|
+
Blocks
|
22
|
+
-->
|
23
|
+
<snippet>
|
24
|
+
<text><![CDATA[do
|
25
|
+
$0
|
26
|
+
end]]></text>
|
27
|
+
<tag>do</tag>
|
28
|
+
<description>do .. end</description>
|
29
|
+
</snippet>
|
30
|
+
<snippet>
|
31
|
+
<text><![CDATA[do |${1:object}|
|
32
|
+
$0
|
33
|
+
end]]></text>
|
34
|
+
<tag>doo</tag>
|
35
|
+
<description>do |object| .. end</description>
|
36
|
+
</snippet>
|
37
|
+
|
38
|
+
<!--
|
39
|
+
Collection iterators
|
40
|
+
-->
|
41
|
+
<snippet>
|
42
|
+
<text><![CDATA[<% ${1:@list}.each do |${2:item}| do %>
|
43
|
+
$0
|
44
|
+
<% end %>]]></text>
|
45
|
+
<tag>eacho</tag>
|
46
|
+
<description>each do item</description>
|
47
|
+
</snippet>
|
48
|
+
<snippet>
|
49
|
+
<text><![CDATA[<%= for ${1:element} in ${2:collection}
|
50
|
+
${1:element}.$0
|
51
|
+
end %>]]></text>
|
52
|
+
<tag>forin</tag>
|
53
|
+
<description>for .. in .. end</description>
|
54
|
+
</snippet>
|
55
|
+
|
56
|
+
<!--
|
57
|
+
Conditions
|
58
|
+
-->
|
59
|
+
<snippet>
|
60
|
+
<text><![CDATA[<% if ${1:logged_in?} %>
|
61
|
+
$0
|
62
|
+
<% end %>]]></text>
|
63
|
+
<tag>if</tag>
|
64
|
+
<description>if statement</description>
|
65
|
+
</snippet>
|
66
|
+
<snippet>
|
67
|
+
<text><![CDATA[<% if ${1:logged_in?} %>
|
68
|
+
$0
|
69
|
+
<% else %>
|
70
|
+
|
71
|
+
<% end %>]]></text>
|
72
|
+
<tag>ife</tag>
|
73
|
+
<description>if ... else ... end</description>
|
74
|
+
</snippet>
|
75
|
+
|
76
|
+
<!--
|
77
|
+
Uncategorized
|
78
|
+
-->
|
79
|
+
<snippet>
|
80
|
+
<text><![CDATA[<% end %>]]></text>
|
81
|
+
<tag>end</tag>
|
82
|
+
<description>end tag</description>
|
83
|
+
</snippet>
|
84
|
+
</snippets>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
|
+
<!--
|
3
|
+
RHTML Ruby code snippets
|
4
|
+
-->
|
5
|
+
<snippets language="js-erb">
|
6
|
+
<!--
|
7
|
+
ERb Tags
|
8
|
+
-->
|
9
|
+
<snippet>
|
10
|
+
<text><![CDATA[<%= $0 %>]]></text>
|
11
|
+
<tag>=</tag>
|
12
|
+
<description><%= block result %></description>
|
13
|
+
</snippet>
|
14
|
+
<snippet>
|
15
|
+
<text><![CDATA[<% $0 -%>]]></text>
|
16
|
+
<tag>%</tag>
|
17
|
+
<description><% ruby code block %></description>
|
18
|
+
</snippet>
|
19
|
+
|
20
|
+
<!--
|
21
|
+
Blocks
|
22
|
+
-->
|
23
|
+
<snippet>
|
24
|
+
<text><![CDATA[do
|
25
|
+
$0
|
26
|
+
end]]></text>
|
27
|
+
<tag>do</tag>
|
28
|
+
<description>do .. end</description>
|
29
|
+
</snippet>
|
30
|
+
<snippet>
|
31
|
+
<text><![CDATA[do |${1:object}|
|
32
|
+
$0
|
33
|
+
end]]></text>
|
34
|
+
<tag>doo</tag>
|
35
|
+
<description>do |object| .. end</description>
|
36
|
+
</snippet>
|
37
|
+
|
38
|
+
<!--
|
39
|
+
Collection iterators
|
40
|
+
-->
|
41
|
+
<snippet>
|
42
|
+
<text><![CDATA[<% ${1:@list}.each do |${2:item}| do %>
|
43
|
+
$0
|
44
|
+
<% end %>]]></text>
|
45
|
+
<tag>eacho</tag>
|
46
|
+
<description>each do item</description>
|
47
|
+
</snippet>
|
48
|
+
<snippet>
|
49
|
+
<text><![CDATA[<%= for ${1:element} in ${2:collection}
|
50
|
+
${1:element}.$0
|
51
|
+
end %>]]></text>
|
52
|
+
<tag>forin</tag>
|
53
|
+
<description>for .. in .. end</description>
|
54
|
+
</snippet>
|
55
|
+
|
56
|
+
<!--
|
57
|
+
Conditions
|
58
|
+
-->
|
59
|
+
<snippet>
|
60
|
+
<text><![CDATA[<% if ${1:logged_in?} %>
|
61
|
+
$0
|
62
|
+
<% end %>]]></text>
|
63
|
+
<tag>if</tag>
|
64
|
+
<description>if statement</description>
|
65
|
+
</snippet>
|
66
|
+
<snippet>
|
67
|
+
<text><![CDATA[<% if ${1:logged_in?} %>
|
68
|
+
$0
|
69
|
+
<% else %>
|
70
|
+
|
71
|
+
<% end %>]]></text>
|
72
|
+
<tag>ife</tag>
|
73
|
+
<description>if ... else ... end</description>
|
74
|
+
</snippet>
|
75
|
+
|
76
|
+
<!--
|
77
|
+
Uncategorized
|
78
|
+
-->
|
79
|
+
<snippet>
|
80
|
+
<text><![CDATA[<% end %>]]></text>
|
81
|
+
<tag>end</tag>
|
82
|
+
<description>end tag</description>
|
83
|
+
</snippet>
|
84
|
+
</snippets>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
|
+
<!--
|
3
|
+
Active Record association helpers
|
4
|
+
-->
|
5
|
+
<snippets language="ruby">
|
6
|
+
<!--
|
7
|
+
Basic class methods
|
8
|
+
-->
|
9
|
+
<snippet>
|
10
|
+
<text><![CDATA[belongs_to :${1:category}$0]]></text>
|
11
|
+
<tag>bt</tag>
|
12
|
+
<description>belongs_to ...</description>
|
13
|
+
</snippet>
|
14
|
+
<snippet>
|
15
|
+
<text><![CDATA[has_one :${1:article}$0]]></text>
|
16
|
+
<tag>ho</tag>
|
17
|
+
<description>has_one ...</description>
|
18
|
+
</snippet>
|
19
|
+
<snippet>
|
20
|
+
<text><![CDATA[has_many :${1:comments}$0]]></text>
|
21
|
+
<tag>hm</tag>
|
22
|
+
<description>has_many ...</description>
|
23
|
+
</snippet>
|
24
|
+
<snippet>
|
25
|
+
<text><![CDATA[has_and_belongs_to_many :${1:roles}$0]]></text>
|
26
|
+
<tag>habtm</tag>
|
27
|
+
<description>has_and_belongs_to_many ...</description>
|
28
|
+
</snippet>
|
29
|
+
|
30
|
+
<!--
|
31
|
+
Association modifiers
|
32
|
+
-->
|
33
|
+
<!-- TODO: Currently not implemented since the : hash key=>value snippet does it's job here pretty well' -->
|
34
|
+
</snippets>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
|
+
<!--
|
3
|
+
Basic active record snippets
|
4
|
+
-->
|
5
|
+
<snippets language="ruby">
|
6
|
+
<snippet>
|
7
|
+
<text><![CDATA[:conditions => ${1:rails conditions string or array}]]></text>
|
8
|
+
<tag>cond</tag>
|
9
|
+
<description>:conditions => ...</description>
|
10
|
+
</snippet>
|
11
|
+
</snippets>
|
@@ -0,0 +1,210 @@
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
|
+
<snippets language="ruby">
|
3
|
+
<!--
|
4
|
+
Basic class methods
|
5
|
+
-->
|
6
|
+
<snippet>
|
7
|
+
<text><![CDATA[validates_acceptance_of :${1:attribute}$0]]></text>
|
8
|
+
<tag>vao</tag>
|
9
|
+
<description>validates_acceptance_of ...</description>
|
10
|
+
</snippet>
|
11
|
+
<snippet>
|
12
|
+
<text><![CDATA[validates_associated :${1:attribute}$0]]></text>
|
13
|
+
<tag>va</tag>
|
14
|
+
<description>validates_associated ...</description>
|
15
|
+
</snippet>
|
16
|
+
<snippet>
|
17
|
+
<text><![CDATA[validates_confirmation_of :${1:attribute}$0]]></text>
|
18
|
+
<tag>vco</tag>
|
19
|
+
<description>validates_confirmation_of ...</description>
|
20
|
+
</snippet>
|
21
|
+
<snippet>
|
22
|
+
<text><![CDATA[validates_each :${1:attribute} do |record, attr, value|
|
23
|
+
record.errors.add attr, "${2:message}" if $0
|
24
|
+
end]]></text>
|
25
|
+
<tag>ve</tag>
|
26
|
+
<description>validates_each ... Validates each attribute against a block</description>
|
27
|
+
</snippet>
|
28
|
+
<snippet>
|
29
|
+
<text><![CDATA[validates_exclusion_of :${1:attribute},
|
30
|
+
:in => $0]]></text>
|
31
|
+
<tag>veo</tag>
|
32
|
+
<description>validates_exclusion_of ... Validates that the value of the specified attribute is not in a particular enumerable object</description>
|
33
|
+
</snippet>
|
34
|
+
<snippet>
|
35
|
+
<text><![CDATA[validates_format_of :${1:attribute},
|
36
|
+
:with$0]]></text>
|
37
|
+
<tag>vfo</tag>
|
38
|
+
<description>validates_format_of ... Validates whether the value of the specified attribute is of the correct form by matching it against the regular expression provided</description>
|
39
|
+
</snippet>
|
40
|
+
<snippet>
|
41
|
+
<text><![CDATA[validates_inclusion_of :${1:attribute},
|
42
|
+
:in$0]]></text>
|
43
|
+
<tag>vio</tag>
|
44
|
+
<description>validates_inclusion_of ... Validates whether the value of the specified attribute is available in a particular enumerable object.</description>
|
45
|
+
</snippet>
|
46
|
+
<snippet>
|
47
|
+
<text><![CDATA[validates_length_of :${1:attribute},
|
48
|
+
:${2:maximum, minimum, is or within}]]></text>
|
49
|
+
<tag>vlo</tag>
|
50
|
+
<description>validates_length_of ... Validates that the specified attribute matches the length restrictions supplied. Only one option can be used at a time</description>
|
51
|
+
</snippet>
|
52
|
+
<snippet>
|
53
|
+
<text><![CDATA[validates_numericality_of :${1:attribute}$0]]></text>
|
54
|
+
<tag>vno</tag>
|
55
|
+
<description>validates_numericality_of ... Validates whether the value of the specified attribute is numeric</description>
|
56
|
+
</snippet>
|
57
|
+
<snippet>
|
58
|
+
<text><![CDATA[validates_presence_of :${1:attribute}$0]]></text>
|
59
|
+
<tag>vpo</tag>
|
60
|
+
<description>validates_presence_of ... Validates that the specified attributes are not blank</description>
|
61
|
+
</snippet>
|
62
|
+
|
63
|
+
<!--
|
64
|
+
Additional validation exec conditions
|
65
|
+
-->
|
66
|
+
<snippet>
|
67
|
+
<text><![CDATA[:on => :${1:default is save, other options are create or update}$0]]></text>
|
68
|
+
<tag>on</tag>
|
69
|
+
<description>:on ... Specifies when this validation is active (default is :save, other options :create, :update)</description>
|
70
|
+
</snippet>
|
71
|
+
<snippet>
|
72
|
+
<text><![CDATA[:if => Proc.new {|instance| ${1:some code that checks your instance}$0]]></text>
|
73
|
+
<tag>vifp</tag>
|
74
|
+
<description>:if => Proc.new ... Specifies a proc to call to determine if the validation should occur</description>
|
75
|
+
</snippet>
|
76
|
+
<snippet>
|
77
|
+
<text><![CDATA[:if => :${1:method_name}]]></text>
|
78
|
+
<tag>vif</tag>
|
79
|
+
<description>:if => :method_name ... Specifies a method to call to determine if the validation should occur</description>
|
80
|
+
</snippet>
|
81
|
+
|
82
|
+
<!--
|
83
|
+
Empty field permission setters
|
84
|
+
-->
|
85
|
+
<snippet>
|
86
|
+
<text><![CDATA[:allow_blank => ${1:false}]]></text>
|
87
|
+
<tag>blank</tag>
|
88
|
+
<description>:allow_blank ... If set to true, skips this validation if the attribute is blank</description>
|
89
|
+
</snippet>
|
90
|
+
<snippet>
|
91
|
+
<text><![CDATA[:allow_nil => ${1:false}$0]]></text>
|
92
|
+
<tag>vnil</tag>
|
93
|
+
<description>:allow_nil ... Skip validation if attribute is nil</description>
|
94
|
+
</snippet>
|
95
|
+
|
96
|
+
<!--
|
97
|
+
Parameters for custom error messages
|
98
|
+
-->
|
99
|
+
<snippet>
|
100
|
+
<text><![CDATA[:message => "${1:message}"$0]]></text>
|
101
|
+
<tag>msg</tag>
|
102
|
+
<description>:message ... A custom error message</description>
|
103
|
+
</snippet>
|
104
|
+
|
105
|
+
<!-- validates_length_of -->
|
106
|
+
<snippet>
|
107
|
+
<text><![CDATA[:too_long => "${1:value is too long (maximum is %d characters)}"$0]]></text>
|
108
|
+
<tag>tl</tag>
|
109
|
+
<description>:too_long ... The error message if the attribute goes over the maximum for validates_length_of</description>
|
110
|
+
</snippet>
|
111
|
+
<snippet>
|
112
|
+
<text><![CDATA[:too_short => "${1:value is too short (minimum is %d characters)}"$0]]></text>
|
113
|
+
<tag>ts</tag>
|
114
|
+
<description>:too_short ... The error message if the attribute goes under the minimum for validates_length_of</description>
|
115
|
+
</snippet>
|
116
|
+
<snippet>
|
117
|
+
<text><![CDATA[:wrong_length => "${1:value has wrong length (should be %d characters)}"$0]]></text>
|
118
|
+
<tag>wl</tag>
|
119
|
+
<description>:wrong_length ... The error message if using the :is method and the attribute is the wrong size for validates_length_of</description>
|
120
|
+
</snippet>
|
121
|
+
|
122
|
+
<!--
|
123
|
+
Additional parameters for certain validations
|
124
|
+
-->
|
125
|
+
<!-- validates_acceptance_of -->
|
126
|
+
<snippet>
|
127
|
+
<text><![CDATA[:accept => "${1:1}"$0]]></text>
|
128
|
+
<tag>accept</tag>
|
129
|
+
<description>:accept ... Specifies value that is considered accepted. The default value is a string "1" for validates_acceptance_of</description>
|
130
|
+
</snippet>
|
131
|
+
|
132
|
+
<!-- validates_format_of -->
|
133
|
+
<snippet>
|
134
|
+
<text><![CDATA[:with => /^${1:regexp}\$/$0]]></text>
|
135
|
+
<tag>with</tag>
|
136
|
+
<description>:with ... The regular expression used to validate the format with for validates_format_of</description>
|
137
|
+
</snippet>
|
138
|
+
|
139
|
+
<!-- validates_inclusion/exclusion_of -->
|
140
|
+
<snippet>
|
141
|
+
<text><![CDATA[:in => $0]]></text>
|
142
|
+
<tag>in</tag>
|
143
|
+
<description>:in ... Specify an enumerable object of available items validates_inclusion/exclusion_of</description>
|
144
|
+
</snippet>
|
145
|
+
|
146
|
+
<!-- validates_length_of -->
|
147
|
+
<snippet>
|
148
|
+
<text><![CDATA[:is => ${1:12}]]></text>
|
149
|
+
<tag>is</tag>
|
150
|
+
<description>:is ... The exact size of the attribute for validates_length_of</description>
|
151
|
+
</snippet>
|
152
|
+
<snippet>
|
153
|
+
<text><![CDATA[:maximum => ${1:12}]]></text>
|
154
|
+
<tag>max</tag>
|
155
|
+
<description>:maximum ... Specifies the maximum value for validates_length_of</description>
|
156
|
+
</snippet>
|
157
|
+
<snippet>
|
158
|
+
<text><![CDATA[:minimum => ${1:12}]]></text>
|
159
|
+
<tag>min</tag>
|
160
|
+
<description>:minimum ... Specifies the minimum value for validates_length_of</description>
|
161
|
+
</snippet>
|
162
|
+
<snippet>
|
163
|
+
<text><![CDATA[:within => (${1:12}..${2:15})$0]]></text>
|
164
|
+
<tag>within</tag>
|
165
|
+
<description>:within ... A range specifying the minimum and maximum size of the attribute for validates_length_of</description>
|
166
|
+
</snippet>
|
167
|
+
|
168
|
+
<!-- validates_numericality_of -->
|
169
|
+
<snippet>
|
170
|
+
<text><![CDATA[:only_integer => ${1:true}$0]]></text>
|
171
|
+
<tag>oi</tag>
|
172
|
+
<description>:only_integer for validates_numericality</description>
|
173
|
+
</snippet>
|
174
|
+
<snippet>
|
175
|
+
<text><![CDATA[:greater_than => ${1:5}$0]]></text>
|
176
|
+
<tag>gt</tag>
|
177
|
+
<description>:greater_than ... Specifies the value must be greater than the supplied value for validates_numericality_of</description>
|
178
|
+
</snippet>
|
179
|
+
<snippet>
|
180
|
+
<text><![CDATA[:greater_than_or_equal_to => ${1:5}$0]]></text>
|
181
|
+
<tag>gtet</tag>
|
182
|
+
<description>:greater_than_or_equal_to ... Specifies the value must be greater than or equal the supplied value for validates_numericality_of</description>
|
183
|
+
</snippet>
|
184
|
+
<snippet>
|
185
|
+
<text><![CDATA[:equal_to => ${1:5}$0]]></text>
|
186
|
+
<tag>et</tag>
|
187
|
+
<description>:equal_to ... Specifies the value must be equal to the supplied value for validates_numericality_of</description>
|
188
|
+
</snippet>
|
189
|
+
<snippet>
|
190
|
+
<text><![CDATA[:less_than => ${1:5}$0]]></text>
|
191
|
+
<tag>lt</tag>
|
192
|
+
<description>:less_than ... Specifies the value must be less than the supplied value for validates_numericality_of</description>
|
193
|
+
</snippet>
|
194
|
+
<snippet>
|
195
|
+
<text><![CDATA[:less_than_or_equal_to => ${1:5}$0]]></text>
|
196
|
+
<tag>ltet</tag>
|
197
|
+
<description>:less_than_or_equal_to ... Specifies the value must be less than or equal the supplied value for validates_numericality_of</description>
|
198
|
+
</snippet>
|
199
|
+
<snippet>
|
200
|
+
<text><![CDATA[:odd => true]]></text>
|
201
|
+
<tag>odd</tag>
|
202
|
+
<description>:odd ... Specifies the value must be an odd number for validates_numericality_of</description>
|
203
|
+
</snippet>
|
204
|
+
<snippet>
|
205
|
+
<text><![CDATA[:even => true]]></text>
|
206
|
+
<tag>even</tag>
|
207
|
+
<description>:even ... Specifies the value must be an even number for validates_numericality_of</description>
|
208
|
+
</snippet>
|
209
|
+
</snippets>
|
210
|
+
|