super-sharp-sys 0.0.1
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.
Potentially problematic release.
This version of super-sharp-sys might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/formtastic-6.0.0/Appraisals +23 -0
- data/formtastic-6.0.0/CONTRIBUTING.md +27 -0
- data/formtastic-6.0.0/Gemfile +8 -0
- data/formtastic-6.0.0/MIT-LICENSE +20 -0
- data/formtastic-6.0.0/README.md +600 -0
- data/formtastic-6.0.0/RELEASE_PROCESS +7 -0
- data/formtastic-6.0.0/Rakefile +54 -0
- data/formtastic-6.0.0/bin/appraisal +8 -0
- data/formtastic-6.0.0/formtastic.gemspec +45 -0
- data/formtastic-6.0.0/gemfiles/rails_72.gemfile +9 -0
- data/formtastic-6.0.0/gemfiles/rails_80.gemfile +9 -0
- data/formtastic-6.0.0/gemfiles/rails_81.gemfile +9 -0
- data/formtastic-6.0.0/gemfiles/rails_edge.gemfile +9 -0
- data/formtastic-6.0.0/lib/formtastic/action_class_finder.rb +19 -0
- data/formtastic-6.0.0/lib/formtastic/actions/base.rb +157 -0
- data/formtastic-6.0.0/lib/formtastic/actions/button_action.rb +68 -0
- data/formtastic-6.0.0/lib/formtastic/actions/buttonish.rb +18 -0
- data/formtastic-6.0.0/lib/formtastic/actions/input_action.rb +71 -0
- data/formtastic-6.0.0/lib/formtastic/actions/link_action.rb +89 -0
- data/formtastic-6.0.0/lib/formtastic/actions.rb +15 -0
- data/formtastic-6.0.0/lib/formtastic/deprecation.rb +6 -0
- data/formtastic-6.0.0/lib/formtastic/form_builder.rb +109 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/action_helper.rb +115 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/actions_helper.rb +169 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/enum.rb +14 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/errors_helper.rb +139 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/fieldset_wrapper.rb +85 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/file_column_detection.rb +17 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/form_helper.rb +204 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/input_helper.rb +349 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/inputs_helper.rb +421 -0
- data/formtastic-6.0.0/lib/formtastic/helpers/reflection.rb +38 -0
- data/formtastic-6.0.0/lib/formtastic/helpers.rb +16 -0
- data/formtastic-6.0.0/lib/formtastic/html_attributes.rb +33 -0
- data/formtastic-6.0.0/lib/formtastic/i18n.rb +33 -0
- data/formtastic-6.0.0/lib/formtastic/input_class_finder.rb +19 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/aria.rb +26 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/associations.rb +32 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/choices.rb +109 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/collections.rb +158 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/database.rb +20 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/datetime_pickerish.rb +86 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/errors.rb +59 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/fileish.rb +24 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/hints.rb +32 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/html.rb +54 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/labelling.rb +53 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/naming.rb +43 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/numeric.rb +51 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/options.rb +18 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/placeholder.rb +18 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/stringish.rb +39 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/timeish.rb +246 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/validations.rb +250 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base/wrapping.rb +51 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/base.rb +79 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/boolean_input.rb +119 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/check_boxes_input.rb +198 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/color_input.rb +42 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/country_input.rb +90 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/datalist_input.rb +42 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/date_picker_input.rb +94 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/date_select_input.rb +35 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/datetime_picker_input.rb +104 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/datetime_select_input.rb +13 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/email_input.rb +42 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/file_input.rb +43 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/hidden_input.rb +63 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/number_input.rb +89 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/password_input.rb +42 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/phone_input.rb +43 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/radio_input.rb +164 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/range_input.rb +96 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/search_input.rb +42 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/select_input.rb +236 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/string_input.rb +37 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/text_input.rb +49 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/time_picker_input.rb +100 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/time_select_input.rb +39 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/time_zone_input.rb +59 -0
- data/formtastic-6.0.0/lib/formtastic/inputs/url_input.rb +42 -0
- data/formtastic-6.0.0/lib/formtastic/inputs.rb +43 -0
- data/formtastic-6.0.0/lib/formtastic/localized_string.rb +18 -0
- data/formtastic-6.0.0/lib/formtastic/localizer.rb +151 -0
- data/formtastic-6.0.0/lib/formtastic/namespaced_class_finder.rb +98 -0
- data/formtastic-6.0.0/lib/formtastic/version.rb +4 -0
- data/formtastic-6.0.0/lib/formtastic.rb +196 -0
- data/formtastic-6.0.0/lib/generators/formtastic/form/form_generator.rb +111 -0
- data/formtastic-6.0.0/lib/generators/formtastic/input/input_generator.rb +47 -0
- data/formtastic-6.0.0/lib/generators/formtastic/install/install_generator.rb +23 -0
- data/formtastic-6.0.0/lib/generators/formtastic/stylesheets/stylesheets_generator.rb +15 -0
- data/formtastic-6.0.0/lib/generators/templates/_form.html.erb +11 -0
- data/formtastic-6.0.0/lib/generators/templates/_form.html.haml +8 -0
- data/formtastic-6.0.0/lib/generators/templates/_form.html.slim +8 -0
- data/formtastic-6.0.0/lib/generators/templates/formtastic.css +289 -0
- data/formtastic-6.0.0/lib/generators/templates/formtastic.rb +118 -0
- data/formtastic-6.0.0/lib/generators/templates/input.rb +19 -0
- data/formtastic-6.0.0/lib/locale/en.yml +10 -0
- data/formtastic-6.0.0/sample/basic_inputs.html +224 -0
- data/formtastic-6.0.0/sample/config.ru +69 -0
- data/formtastic-6.0.0/sample/index.html +14 -0
- data/formtastic-6.0.0/script/integration-template.rb +76 -0
- data/formtastic-6.0.0/script/integration.sh +32 -0
- data/formtastic-6.0.0/spec/action_class_finder_spec.rb +12 -0
- data/formtastic-6.0.0/spec/actions/button_action_spec.rb +63 -0
- data/formtastic-6.0.0/spec/actions/generic_action_spec.rb +521 -0
- data/formtastic-6.0.0/spec/actions/input_action_spec.rb +59 -0
- data/formtastic-6.0.0/spec/actions/link_action_spec.rb +92 -0
- data/formtastic-6.0.0/spec/builder/custom_builder_spec.rb +132 -0
- data/formtastic-6.0.0/spec/builder/error_proc_spec.rb +27 -0
- data/formtastic-6.0.0/spec/builder/semantic_fields_for_spec.rb +213 -0
- data/formtastic-6.0.0/spec/fast_spec_helper.rb +12 -0
- data/formtastic-6.0.0/spec/generators/formtastic/form/form_generator_spec.rb +132 -0
- data/formtastic-6.0.0/spec/generators/formtastic/input/input_generator_spec.rb +125 -0
- data/formtastic-6.0.0/spec/generators/formtastic/install/install_generator_spec.rb +48 -0
- data/formtastic-6.0.0/spec/generators/formtastic/stylesheets/stylesheets_generator_spec.rb +22 -0
- data/formtastic-6.0.0/spec/helpers/action_helper_spec.rb +338 -0
- data/formtastic-6.0.0/spec/helpers/actions_helper_spec.rb +143 -0
- data/formtastic-6.0.0/spec/helpers/form_helper_spec.rb +224 -0
- data/formtastic-6.0.0/spec/helpers/input_helper_spec.rb +991 -0
- data/formtastic-6.0.0/spec/helpers/inputs_helper_spec.rb +669 -0
- data/formtastic-6.0.0/spec/helpers/reflection_helper_spec.rb +32 -0
- data/formtastic-6.0.0/spec/helpers/semantic_errors_helper_spec.rb +220 -0
- data/formtastic-6.0.0/spec/i18n_spec.rb +210 -0
- data/formtastic-6.0.0/spec/input_class_finder_spec.rb +10 -0
- data/formtastic-6.0.0/spec/inputs/base/collections_spec.rb +119 -0
- data/formtastic-6.0.0/spec/inputs/base/validations_spec.rb +481 -0
- data/formtastic-6.0.0/spec/inputs/boolean_input_spec.rb +254 -0
- data/formtastic-6.0.0/spec/inputs/check_boxes_input_spec.rb +547 -0
- data/formtastic-6.0.0/spec/inputs/color_input_spec.rb +85 -0
- data/formtastic-6.0.0/spec/inputs/country_input_spec.rb +133 -0
- data/formtastic-6.0.0/spec/inputs/custom_input_spec.rb +51 -0
- data/formtastic-6.0.0/spec/inputs/datalist_input_spec.rb +61 -0
- data/formtastic-6.0.0/spec/inputs/date_picker_input_spec.rb +449 -0
- data/formtastic-6.0.0/spec/inputs/date_select_input_spec.rb +249 -0
- data/formtastic-6.0.0/spec/inputs/datetime_picker_input_spec.rb +490 -0
- data/formtastic-6.0.0/spec/inputs/datetime_select_input_spec.rb +209 -0
- data/formtastic-6.0.0/spec/inputs/email_input_spec.rb +85 -0
- data/formtastic-6.0.0/spec/inputs/file_input_spec.rb +89 -0
- data/formtastic-6.0.0/spec/inputs/hidden_input_spec.rb +135 -0
- data/formtastic-6.0.0/spec/inputs/include_blank_spec.rb +78 -0
- data/formtastic-6.0.0/spec/inputs/label_spec.rb +181 -0
- data/formtastic-6.0.0/spec/inputs/number_input_spec.rb +815 -0
- data/formtastic-6.0.0/spec/inputs/password_input_spec.rb +99 -0
- data/formtastic-6.0.0/spec/inputs/phone_input_spec.rb +85 -0
- data/formtastic-6.0.0/spec/inputs/placeholder_spec.rb +71 -0
- data/formtastic-6.0.0/spec/inputs/radio_input_spec.rb +326 -0
- data/formtastic-6.0.0/spec/inputs/range_input_spec.rb +505 -0
- data/formtastic-6.0.0/spec/inputs/readonly_spec.rb +50 -0
- data/formtastic-6.0.0/spec/inputs/search_input_spec.rb +84 -0
- data/formtastic-6.0.0/spec/inputs/select_input_spec.rb +661 -0
- data/formtastic-6.0.0/spec/inputs/string_input_spec.rb +326 -0
- data/formtastic-6.0.0/spec/inputs/text_input_spec.rb +187 -0
- data/formtastic-6.0.0/spec/inputs/time_picker_input_spec.rb +455 -0
- data/formtastic-6.0.0/spec/inputs/time_select_input_spec.rb +261 -0
- data/formtastic-6.0.0/spec/inputs/time_zone_input_spec.rb +143 -0
- data/formtastic-6.0.0/spec/inputs/url_input_spec.rb +85 -0
- data/formtastic-6.0.0/spec/inputs/with_options_spec.rb +43 -0
- data/formtastic-6.0.0/spec/localizer_spec.rb +130 -0
- data/formtastic-6.0.0/spec/namespaced_class_finder_spec.rb +90 -0
- data/formtastic-6.0.0/spec/schema.rb +22 -0
- data/formtastic-6.0.0/spec/spec.opts +2 -0
- data/formtastic-6.0.0/spec/spec_helper.rb +466 -0
- data/formtastic-6.0.0/spec/support/custom_macros.rb +570 -0
- data/formtastic-6.0.0/spec/support/deprecation.rb +7 -0
- data/formtastic-6.0.0/spec/support/shared_examples.rb +13 -0
- data/formtastic-6.0.0/spec/support/specialized_class_finder_shared_example.rb +27 -0
- data/formtastic-6.0.0/spec/support/test_environment.rb +46 -0
- data/super-sharp-sys.gemspec +11 -0
- metadata +209 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta content="noindex,nofollow" name="robots">
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Formtastic</title>
|
|
7
|
+
|
|
8
|
+
<link href="/formtastic.css" rel="stylesheet" type="text/css" />
|
|
9
|
+
<!--[if IE 6]><link href="/formtastic_ie6.css" rel="stylesheet" type="text/css" /><![endif]-->
|
|
10
|
+
<!--[if IE 7]><link href="/formtastic_ie7.css" rel="stylesheet" type="text/css" /><![endif]-->
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
body {
|
|
14
|
+
font-family: helvetica, arial;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
18
|
+
</head>
|
|
19
|
+
</html>
|
|
20
|
+
<body>
|
|
21
|
+
<h1>Formtastic</h1>
|
|
22
|
+
|
|
23
|
+
<form action="basic_inputs.html" class="formtastic gem" id="new_gem" method="get">
|
|
24
|
+
<fieldset class="inputs">
|
|
25
|
+
<ol>
|
|
26
|
+
<li class="input string stringish optional" id="gem_summary_input">
|
|
27
|
+
<label class="label" for="gem_summary">Summary</label>
|
|
28
|
+
<input id="gem_summary" name="gem[summary]" type="text" value="A Rails form builder plugin/gem with semantically rich and accessible markup" maxlength="255">
|
|
29
|
+
</li>
|
|
30
|
+
|
|
31
|
+
<li class="input text optional" id="gem_description_input">
|
|
32
|
+
<label class="label" for="gem_description">Description</label>
|
|
33
|
+
<textarea id="gem_description" rows="5">A Rails form builder plugin/gem with semantically rich and accessible markup</textarea>
|
|
34
|
+
</li>
|
|
35
|
+
|
|
36
|
+
<li class="input url stringish optional" id="gem_url_input">
|
|
37
|
+
<label class="label" for="gem_url">URL</label>
|
|
38
|
+
<input id="gem_url" name="gem[url]" type="url">
|
|
39
|
+
<p class="inline-hints">Example: https://github.com/formtastic/formtastic</p>
|
|
40
|
+
</li>
|
|
41
|
+
|
|
42
|
+
<li class="input password stringish required" id="gem_password_input">
|
|
43
|
+
<label class="label" for="gem_password">Password<abbr title="required">*</abbr></label>
|
|
44
|
+
<input id="gem_password" name="gem[password]" type="password">
|
|
45
|
+
<p class="inline-errors">can't be blank</p>
|
|
46
|
+
</li>
|
|
47
|
+
|
|
48
|
+
<li class="input password stringish required" id="gem_password_input">
|
|
49
|
+
<label class="label" for="gem_password_confirmation">Password confirmation<abbr title="required">*</abbr></label>
|
|
50
|
+
<input id="gem_password_confirmation" name="gem[password_confirmation]" type="password">
|
|
51
|
+
<p class="inline-errors">can't be blank</p>
|
|
52
|
+
</li>
|
|
53
|
+
|
|
54
|
+
<li class="input numeric stringish optional" id="gem_downloads_input">
|
|
55
|
+
<label class="label" for="gem_downloads">Downloads</label>
|
|
56
|
+
<input id="gem_downloads" name="gem[downloads]" type="numeric" value="209,354">
|
|
57
|
+
</li>
|
|
58
|
+
|
|
59
|
+
<li class="input file optional" id="gem_file_input">
|
|
60
|
+
<label class="label" for="gem_file">File</label>
|
|
61
|
+
<input id="gem_file" name="gem[file]" type="file" value="value">
|
|
62
|
+
</li>
|
|
63
|
+
|
|
64
|
+
<li class="input email stringish optional" id="gem_email_input">
|
|
65
|
+
<label class="label" for="gem_email">Email</label>
|
|
66
|
+
<input id="gem_email" name="gem[email]" type="email">
|
|
67
|
+
</li>
|
|
68
|
+
|
|
69
|
+
<li class="input phone stringish optional" id="gem_phone_input">
|
|
70
|
+
<label class="label" for="gem_phone">Phone</label>
|
|
71
|
+
<input id="gem_phone" name="gem[phone]" type="phone">
|
|
72
|
+
</li>
|
|
73
|
+
|
|
74
|
+
<li class="input search stringish optional" id="gem_search_input">
|
|
75
|
+
<label class="label" for="gem_search">Search</label>
|
|
76
|
+
<input id="gem_search" name="gem[search]" type="search">
|
|
77
|
+
</li>
|
|
78
|
+
|
|
79
|
+
<li class="input date optional">
|
|
80
|
+
<fieldset class="fragments">
|
|
81
|
+
<legend class="label"><label>First release</label></legend>
|
|
82
|
+
<ol class="fragments-group">
|
|
83
|
+
<li class="fragment">
|
|
84
|
+
<label>Year</label>
|
|
85
|
+
<select id="gem_first_release_1i" name="gem[first_release][1i]">
|
|
86
|
+
<option>2009</option>
|
|
87
|
+
</select>
|
|
88
|
+
</li>
|
|
89
|
+
<li class="fragment">
|
|
90
|
+
<label>Month</label>
|
|
91
|
+
<select id="gem_first_release_2i" name="gem[first_release][2i]">
|
|
92
|
+
<option>October</option>
|
|
93
|
+
</select>
|
|
94
|
+
</li>
|
|
95
|
+
<li class="fragment">
|
|
96
|
+
<label>Day</label>
|
|
97
|
+
<select id="gem_first_release_3i" name="gem[first_release][3i]">
|
|
98
|
+
<option>15</option>
|
|
99
|
+
</select>
|
|
100
|
+
</li>
|
|
101
|
+
</ol>
|
|
102
|
+
</fieldset>
|
|
103
|
+
</li>
|
|
104
|
+
|
|
105
|
+
<li class="input date_picker optional">
|
|
106
|
+
<label class="label" for="gem_expiry">Expiry date</label>
|
|
107
|
+
<input id="gem_expiry" name="gem[gem_expiry]" type="date" size="10" maxlength="10" min="2012-01-01" max="2012-12-31" step="1" value="2012-01-01">
|
|
108
|
+
</li>
|
|
109
|
+
|
|
110
|
+
<li class="input datetime_picker optional">
|
|
111
|
+
<label class="label" for="gem_expiry">Expiry datetime-local</label>
|
|
112
|
+
<input id="gem_expiry" name="gem[gem_expiry]" type="datetime-local" size="16" maxlength="16" min="2012-01-01T00:00" max="2012-12-31T23:59" step="1800">
|
|
113
|
+
</li>
|
|
114
|
+
|
|
115
|
+
<li class="input datetime_picker optional">
|
|
116
|
+
<label class="label" for="gem_expiry">Expiry datetime</label>
|
|
117
|
+
<input id="gem_expiry" name="gem[gem_expiry]" type="datetime" size="16" maxlength="16" min="2012-01-01T00:00" max="2012-12-31T23:59" step="1800">
|
|
118
|
+
</li>
|
|
119
|
+
|
|
120
|
+
<li class="input time_picker optional">
|
|
121
|
+
<label class="label" for="gem_expiry">Expiry time</label>
|
|
122
|
+
<input id="gem_expiry" name="gem[gem_expiry]" type="time" size="5" maxlength="5" min="T00:00" max="23:59" step="60">
|
|
123
|
+
</li>
|
|
124
|
+
|
|
125
|
+
<li class="input string stringish optional autofocus" id="gem_autofocus_input">
|
|
126
|
+
<label class="label" for="gem_autofocus">Autofocus</label>
|
|
127
|
+
<input id="gem_autofocus" name="gem[autofocus]" type="text" value="The focus is set to this field" autofocus="autofocus">
|
|
128
|
+
</li>
|
|
129
|
+
|
|
130
|
+
<li class="input boolean optional" id="gem_terms_and_conditions_input">
|
|
131
|
+
<label for="gem_terms_and_conditions">
|
|
132
|
+
<input id="gem_terms_and_conditions" name="gem[terms_and_conditions]" type="checkbox" value="1" checked="checked">
|
|
133
|
+
I agree to your draconian terms of service even though I didn't read them
|
|
134
|
+
</label>
|
|
135
|
+
</li>
|
|
136
|
+
|
|
137
|
+
<li class="input select optional" id="gem_awesomeness_input">
|
|
138
|
+
<label class="label" for="gem_awesomeness">Select</label>
|
|
139
|
+
<select id="gem_awesomeness" name="gem[awesomeness]">
|
|
140
|
+
<option value="5">First choice</option>
|
|
141
|
+
<option value="4">Second choice</option>
|
|
142
|
+
</select>
|
|
143
|
+
</li>
|
|
144
|
+
|
|
145
|
+
<li class="input radio optional">
|
|
146
|
+
<fieldset class="choices">
|
|
147
|
+
<legend class="label"><label>Rate</label></legend>
|
|
148
|
+
<ol class="choices-group">
|
|
149
|
+
<li class="choice">
|
|
150
|
+
<label><input id="gem_rate_five" name="gem[rate]" type="radio" checked="checked"> Five</label></label>
|
|
151
|
+
</li>
|
|
152
|
+
<li class="choice">
|
|
153
|
+
<label><input id="gem_rate_four" name="gem[rate]" type="radio"> Four</label></label>
|
|
154
|
+
</li>
|
|
155
|
+
<li class="choice">
|
|
156
|
+
<label><input id="gem_rate_three" name="gem[rate]" type="radio"> Three</label></label>
|
|
157
|
+
</li>
|
|
158
|
+
<li class="choice">
|
|
159
|
+
<label><input id="gem_rate_two" name="gem[rate]" type="radio"> Two</label></label>
|
|
160
|
+
</li>
|
|
161
|
+
<li class="choice">
|
|
162
|
+
<label><input id="gem_rate_one" name="gem[rate]" type="radio"> One</label></label>
|
|
163
|
+
</li>
|
|
164
|
+
</ol>
|
|
165
|
+
</fieldset>
|
|
166
|
+
</li>
|
|
167
|
+
|
|
168
|
+
<li class="input check_boxes optional">
|
|
169
|
+
<fieldset class="choices">
|
|
170
|
+
<legend class="label"><label>Browsers</label></legend>
|
|
171
|
+
<ol class="choices-group">
|
|
172
|
+
<li class="choice">
|
|
173
|
+
<label><input id="gem_browser_google_chrome" name="gem[browser][]" type="checkbox"> Google Chrome</label></label>
|
|
174
|
+
</li>
|
|
175
|
+
<li class="choice">
|
|
176
|
+
<label><input id="gem_browser_apple_safari" name="gem[browser][]" type="checkbox"> Apple Safari</label></label>
|
|
177
|
+
</li>
|
|
178
|
+
<li class="choice">
|
|
179
|
+
<label><input id="gem_browser_mozilla_firefox" name="gem[browser][]" type="checkbox"> Mozilla Firefox</label></label>
|
|
180
|
+
</li>
|
|
181
|
+
<li class="choice">
|
|
182
|
+
<label><input id="gem_browser_opera" name="gem[browser][]" type="checkbox"> Opera</label></label>
|
|
183
|
+
</li>
|
|
184
|
+
<li class="choice">
|
|
185
|
+
<label><input id="gem_browser_internet_explorer" name="gem[browser][]" type="checkbox"> Internet Explorer (Although you really can't call it a browser can you? This is some long text to force wrapping.)</label></label>
|
|
186
|
+
</li>
|
|
187
|
+
</ol>
|
|
188
|
+
</fieldset>
|
|
189
|
+
</li>
|
|
190
|
+
</ol>
|
|
191
|
+
</fieldset>
|
|
192
|
+
|
|
193
|
+
<fieldset class="buttons">
|
|
194
|
+
<ol>
|
|
195
|
+
<li class="button commit">
|
|
196
|
+
<input class="create" id="gem_submit" type="submit">
|
|
197
|
+
</li>
|
|
198
|
+
</ol>
|
|
199
|
+
</fieldset>
|
|
200
|
+
|
|
201
|
+
<fieldset class="actions">
|
|
202
|
+
<ol>
|
|
203
|
+
<li class="action input_action">
|
|
204
|
+
<input id="gem_submit" type="submit" value="Create Thing">
|
|
205
|
+
</li>
|
|
206
|
+
</ol>
|
|
207
|
+
</fieldset>
|
|
208
|
+
|
|
209
|
+
<fieldset class="actions">
|
|
210
|
+
<ol>
|
|
211
|
+
<li class="action button_action">
|
|
212
|
+
<button id="gem_submit" type="submit">Create Thing</button>
|
|
213
|
+
</li>
|
|
214
|
+
<li class="action button_action">
|
|
215
|
+
<button id="gem_submit" type="reset">Reset</button>
|
|
216
|
+
</li>
|
|
217
|
+
<li class="action link_action">
|
|
218
|
+
<a href="#">Cancel</a>
|
|
219
|
+
</li>
|
|
220
|
+
</ol>
|
|
221
|
+
</fieldset>
|
|
222
|
+
</form>
|
|
223
|
+
</body>
|
|
224
|
+
</html>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
module Rack
|
|
2
|
+
module Formtastic
|
|
3
|
+
class Samples
|
|
4
|
+
def initialize(app)
|
|
5
|
+
@app = app
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def call(env)
|
|
9
|
+
@status, @headers, @body = @app.call(env)
|
|
10
|
+
@env = env
|
|
11
|
+
|
|
12
|
+
@body = '' if favicon?
|
|
13
|
+
@body = static_file if !favicon? && static_file?
|
|
14
|
+
@body = stylesheet if stylesheet?
|
|
15
|
+
@headers ||= {}
|
|
16
|
+
@headers['Content-Type'] = mime(extension)
|
|
17
|
+
[@status, @headers, @body]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def static_file?
|
|
21
|
+
!stylesheet?
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def stylesheet?
|
|
25
|
+
@env["PATH_INFO"] =~ /\.(css)/
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def favicon?
|
|
29
|
+
@env["PATH_INFO"] =~ /favicon.ico$/
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def extension
|
|
33
|
+
@env["PATH_INFO"].split(".").last
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def mime(extension)
|
|
37
|
+
mimes[extension] || mimes['html']
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def mimes
|
|
41
|
+
{
|
|
42
|
+
'ico' => 'image/x-icon',
|
|
43
|
+
'html' => 'text/html',
|
|
44
|
+
'css' => 'text/css',
|
|
45
|
+
'js' => 'text/javascript'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def static_file
|
|
50
|
+
::File.open(file_path)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def stylesheet
|
|
54
|
+
::File.open(::File.join("../app/assets/stylesheets", file_path))
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def file_path
|
|
58
|
+
@env["PATH_INFO"].gsub(/^\//, '').gsub(/^$/, 'index.html')
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
use Rack::ContentLength
|
|
66
|
+
use Rack::Formtastic::Samples
|
|
67
|
+
|
|
68
|
+
app = lambda { |env| [200, @headers, @body] }
|
|
69
|
+
run app
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
gem 'formtastic', path: '..'
|
|
3
|
+
gem 'bcrypt'
|
|
4
|
+
gem 'rails-dom-testing', group: :test
|
|
5
|
+
|
|
6
|
+
gem 'minitest', '~> 5.27' # TODO: Remove this line when the Rails version used for integration tests will include rails/rails#56202
|
|
7
|
+
|
|
8
|
+
# to speed up bundle install, reuse the bundle path
|
|
9
|
+
def bundle_path
|
|
10
|
+
File.expand_path ENV.fetch('BUNDLE_PATH', 'vendor/bundle')
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
if Rails.version >= '8.1'
|
|
14
|
+
gsub_file 'Gemfile', /gem "rails".*/, %(gem "rails", "~> #{Rails.version}", github: "rails/rails", branch: "8-1-stable")
|
|
15
|
+
elsif Rails.version >= '8.0'
|
|
16
|
+
gsub_file 'Gemfile', /gem "rails".*/, %(gem "rails", "~> #{Rails.version}", github: "rails/rails", branch: "8-0-stable")
|
|
17
|
+
elsif Rails.version >= '7.2'
|
|
18
|
+
gsub_file 'Gemfile', /gem "rails".*/, %(gem "rails", "~> #{Rails.version}", github: "rails/rails", branch: "7-2-stable")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
### Ensure Dummy App's Ruby version matches the current environments Ruby Version
|
|
22
|
+
ruby_version = "ruby '#{RUBY_VERSION}'"
|
|
23
|
+
gsub_file 'Gemfile', /ruby '\d+.\d+.\d+'/, ruby_version
|
|
24
|
+
|
|
25
|
+
if bundle_install?
|
|
26
|
+
def run_bundle
|
|
27
|
+
previous_bundle_path = bundle_path
|
|
28
|
+
|
|
29
|
+
require "bundler"
|
|
30
|
+
Bundler.with_original_env do
|
|
31
|
+
system("bundle config set path '#{previous_bundle_path}'")
|
|
32
|
+
system("bundle install --jobs=3 --retry=3")
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
in_root do
|
|
38
|
+
ENV['BUNDLE_GEMFILE'] = File.expand_path('Gemfile')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
formtastic = -> do
|
|
42
|
+
generate(:scaffold, 'user name:string password:digest')
|
|
43
|
+
generate('formtastic:install')
|
|
44
|
+
generate('formtastic:form', 'user name password --force')
|
|
45
|
+
generate('formtastic:stylesheets')
|
|
46
|
+
|
|
47
|
+
rails_command('db:migrate')
|
|
48
|
+
rails_command('assets:precompile')
|
|
49
|
+
|
|
50
|
+
in_root do
|
|
51
|
+
inject_into_class 'app/models/user.rb', 'User', " has_secure_password\n"
|
|
52
|
+
inject_into_class 'test/controllers/users_controller_test.rb', 'UsersControllerTest', <<-RUBY
|
|
53
|
+
|
|
54
|
+
test "should show form" do
|
|
55
|
+
get edit_user_path(@user)
|
|
56
|
+
|
|
57
|
+
assert_select 'form' do
|
|
58
|
+
assert_select 'li.input.string' do
|
|
59
|
+
assert_select 'input#user_name[type=text]'
|
|
60
|
+
end
|
|
61
|
+
assert_select 'li.input.password' do
|
|
62
|
+
assert_select 'input#user_password[type=password]'
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
assert_select 'fieldset.actions' do
|
|
66
|
+
assert_select 'li.action.input_action' do
|
|
67
|
+
assert_select 'input[type=submit]'
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end # test "should show form"
|
|
72
|
+
RUBY
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
after_bundle(&formtastic)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
set -o verbose
|
|
5
|
+
|
|
6
|
+
test_app=dummy
|
|
7
|
+
rm -rf ${test_app}
|
|
8
|
+
|
|
9
|
+
export RAILS_INTEGRATION_VERSION="8.1.2"
|
|
10
|
+
gem install rails -v ${RAILS_INTEGRATION_VERSION}
|
|
11
|
+
rails -v
|
|
12
|
+
|
|
13
|
+
rails new ${test_app} \
|
|
14
|
+
--template=$(dirname "$0")/integration-template.rb \
|
|
15
|
+
--skip-bootsnap \
|
|
16
|
+
--skip-brakeman \
|
|
17
|
+
--skip-bundler-audit \
|
|
18
|
+
--skip-ci \
|
|
19
|
+
--skip-git \
|
|
20
|
+
--skip-javascript \
|
|
21
|
+
--skip-jbuilder \
|
|
22
|
+
--skip-kamal \
|
|
23
|
+
--skip-rubocop \
|
|
24
|
+
--skip-solid \
|
|
25
|
+
--skip-spring \
|
|
26
|
+
--skip-thruster
|
|
27
|
+
|
|
28
|
+
cd ${test_app}
|
|
29
|
+
|
|
30
|
+
bundle add formtastic --path=../formtastic
|
|
31
|
+
bundle install
|
|
32
|
+
bundle exec rake test
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require 'spec_helper'
|
|
3
|
+
require 'formtastic/action_class_finder'
|
|
4
|
+
|
|
5
|
+
RSpec.describe Formtastic::ActionClassFinder do
|
|
6
|
+
include FormtasticSpecHelper
|
|
7
|
+
|
|
8
|
+
it_behaves_like 'Specialized Class Finder' do
|
|
9
|
+
let(:default) { Formtastic::Actions }
|
|
10
|
+
let(:namespaces_setting) { :action_namespaces }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require 'spec_helper'
|
|
3
|
+
|
|
4
|
+
RSpec.describe 'ButtonAction', 'when submitting' do
|
|
5
|
+
|
|
6
|
+
include FormtasticSpecHelper
|
|
7
|
+
|
|
8
|
+
before do
|
|
9
|
+
@output_buffer = ActionView::OutputBuffer.new ''
|
|
10
|
+
mock_everything
|
|
11
|
+
|
|
12
|
+
concat(semantic_form_for(@new_post) do |builder|
|
|
13
|
+
concat(builder.action(:submit, :as => :button))
|
|
14
|
+
end)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'should render a submit type of button' do
|
|
18
|
+
expect(output_buffer.to_str).to have_tag('li.action.button_action button[@type="submit"]')
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
RSpec.describe 'ButtonAction', 'when resetting' do
|
|
24
|
+
|
|
25
|
+
include FormtasticSpecHelper
|
|
26
|
+
|
|
27
|
+
before do
|
|
28
|
+
@output_buffer = ActionView::OutputBuffer.new ''
|
|
29
|
+
mock_everything
|
|
30
|
+
|
|
31
|
+
concat(semantic_form_for(@new_post) do |builder|
|
|
32
|
+
concat(builder.action(:reset, :as => :button))
|
|
33
|
+
end)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it 'should render a reset type of button' do
|
|
37
|
+
expect(output_buffer.to_str).to have_tag('li.action.button_action button[@type="reset"]', :text => "Reset Post")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'should not render a value attribute' do
|
|
41
|
+
expect(output_buffer.to_str).not_to have_tag('li.action.button_action button[@value]')
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
RSpec.describe 'InputAction', 'when cancelling' do
|
|
47
|
+
|
|
48
|
+
include FormtasticSpecHelper
|
|
49
|
+
|
|
50
|
+
before do
|
|
51
|
+
@output_buffer = ActionView::OutputBuffer.new ''
|
|
52
|
+
mock_everything
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
it 'should raise an error' do
|
|
56
|
+
expect {
|
|
57
|
+
concat(semantic_form_for(@new_post) do |builder|
|
|
58
|
+
concat(builder.action(:cancel, :as => :button))
|
|
59
|
+
end)
|
|
60
|
+
}.to raise_error(Formtastic::UnsupportedMethodForAction)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|