stationed 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +136 -0
  4. data/Rakefile +27 -0
  5. data/app/helpers/crud_link_helper.rb +22 -0
  6. data/app/helpers/page_title_helper.rb +107 -0
  7. data/lib/generators/stationed/templates_generator.rb +24 -0
  8. data/lib/stationed/app_builder.rb +13 -0
  9. data/lib/stationed/crud_tag.rb +70 -0
  10. data/lib/stationed/engine.rb +8 -0
  11. data/lib/stationed/generators/app_generator.rb +52 -0
  12. data/lib/stationed/generators/plugins/capybara.rb +12 -0
  13. data/lib/stationed/generators/plugins/capybara_webkit.rb +14 -0
  14. data/lib/stationed/generators/plugins/database_cleaner.rb +13 -0
  15. data/lib/stationed/generators/plugins/devise.rb +43 -0
  16. data/lib/stationed/generators/plugins/draper.rb +14 -0
  17. data/lib/stationed/generators/plugins/factory_girl.rb +14 -0
  18. data/lib/stationed/generators/plugins/flashes.rb +12 -0
  19. data/lib/stationed/generators/plugins/foreman.rb +15 -0
  20. data/lib/stationed/generators/plugins/generators.rb +12 -0
  21. data/lib/stationed/generators/plugins/guard.rb +26 -0
  22. data/lib/stationed/generators/plugins/haml.rb +12 -0
  23. data/lib/stationed/generators/plugins/i18n_spec.rb +13 -0
  24. data/lib/stationed/generators/plugins/kaminari.rb +18 -0
  25. data/lib/stationed/generators/plugins/layout.rb +13 -0
  26. data/lib/stationed/generators/plugins/normalize.rb +12 -0
  27. data/lib/stationed/generators/plugins/pry.rb +19 -0
  28. data/lib/stationed/generators/plugins/pundit.rb +20 -0
  29. data/lib/stationed/generators/plugins/rack_deflater.rb +17 -0
  30. data/lib/stationed/generators/plugins/responders.rb +28 -0
  31. data/lib/stationed/generators/plugins/rspec.rb +21 -0
  32. data/lib/stationed/generators/plugins/rubocop.rb +14 -0
  33. data/lib/stationed/generators/plugins/simple_form.rb +32 -0
  34. data/lib/stationed/generators/plugins/simple_form_inputs.rb +13 -0
  35. data/lib/stationed/generators/plugins/spring.rb +13 -0
  36. data/lib/stationed/generators/plugins/stationed.rb +12 -0
  37. data/lib/stationed/generators/plugins/strong_parameters.rb +18 -0
  38. data/lib/stationed/generators/plugins/styles.rb +24 -0
  39. data/lib/stationed/generators/plugins/turbolinks.rb +13 -0
  40. data/lib/stationed/generators/plugins/webmock.rb +13 -0
  41. data/lib/stationed/generators/plugins/wiki.rb +20 -0
  42. data/lib/stationed/generators/plugins/yard.rb +14 -0
  43. data/lib/stationed/generators/plugins.rb +10 -0
  44. data/lib/stationed/generators/templates/Deployment.md +3 -0
  45. data/lib/stationed/generators/templates/Home.md +8 -0
  46. data/lib/stationed/generators/templates/Procfile +1 -0
  47. data/lib/stationed/generators/templates/README.md.erb +42 -0
  48. data/lib/stationed/generators/templates/Services.md +3 -0
  49. data/lib/stationed/generators/templates/Setup.md +58 -0
  50. data/lib/stationed/generators/templates/Testing.md +3 -0
  51. data/lib/stationed/generators/templates/application.html.haml +11 -0
  52. data/lib/stationed/generators/templates/application.scss +6 -0
  53. data/lib/stationed/generators/templates/application_decorator.rb +23 -0
  54. data/lib/stationed/generators/templates/application_responder.rb +6 -0
  55. data/lib/stationed/generators/templates/authorization.rb +11 -0
  56. data/lib/stationed/generators/templates/capybara_webkit.rb +1 -0
  57. data/lib/stationed/generators/templates/database_cleaner.rb +19 -0
  58. data/lib/stationed/generators/templates/devise.rb +3 -0
  59. data/lib/stationed/generators/templates/env.erb +3 -0
  60. data/lib/stationed/generators/templates/factories_spec.rb +10 -0
  61. data/lib/stationed/generators/templates/factory_girl.rb +3 -0
  62. data/lib/stationed/generators/templates/flashes.html.haml +5 -0
  63. data/lib/stationed/generators/templates/generators.rb +11 -0
  64. data/lib/stationed/generators/templates/gollum.rake +5 -0
  65. data/lib/stationed/generators/templates/gollum.rb +5 -0
  66. data/lib/stationed/generators/templates/i18n_spec.rb +10 -0
  67. data/lib/stationed/generators/templates/layout.scss +3 -0
  68. data/lib/stationed/generators/templates/normalize.css +425 -0
  69. data/lib/stationed/generators/templates/paginating_decorator.rb +7 -0
  70. data/lib/stationed/generators/templates/pundit.rb +1 -0
  71. data/lib/stationed/generators/templates/rubocop.rake +5 -0
  72. data/lib/stationed/generators/templates/rubocop.yml +38 -0
  73. data/lib/stationed/generators/templates/select2_input.rb +14 -0
  74. data/lib/stationed/generators/templates/simple_form.rb +65 -0
  75. data/lib/stationed/generators/templates/simplecov +6 -0
  76. data/lib/stationed/generators/templates/spec_helper.rb +27 -0
  77. data/lib/stationed/generators/templates/spring.rb +1 -0
  78. data/lib/stationed/generators/templates/static_input.rb +11 -0
  79. data/lib/stationed/generators/templates/webmock.rb +1 -0
  80. data/lib/stationed/generators/templates/yardopts +7 -0
  81. data/lib/stationed/version.rb +3 -0
  82. data/lib/stationed.rb +4 -0
  83. data/lib/tasks/stationed_tasks.rake +4 -0
  84. data/lib/templates/haml/scaffold/_form.html.haml +11 -0
  85. data/lib/templates/haml/scaffold/edit.html.haml +2 -0
  86. data/lib/templates/haml/scaffold/index.html.haml +24 -0
  87. data/lib/templates/haml/scaffold/new.html.haml +2 -0
  88. data/lib/templates/haml/scaffold/show.html.haml +9 -0
  89. data/lib/templates/rails/scaffold_controller/controller.rb +64 -0
  90. data/lib/templates/rspec/integration/request_spec.rb +10 -0
  91. data/lib/templates/rspec/model/model_spec.rb +6 -0
  92. data/lib/templates/rspec/scaffold/controller_spec.rb +224 -0
  93. data/lib/templates/rspec/scaffold/edit_spec.rb +20 -0
  94. data/lib/templates/rspec/scaffold/index_spec.rb +20 -0
  95. data/lib/templates/rspec/scaffold/new_spec.rb +20 -0
  96. data/lib/templates/rspec/scaffold/routing_spec.rb +17 -0
  97. data/lib/templates/rspec/scaffold/show_spec.rb +14 -0
  98. data/spec/dummy/README.rdoc +28 -0
  99. data/spec/dummy/Rakefile +6 -0
  100. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  101. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  102. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  103. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  104. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  105. data/spec/dummy/bin/bundle +3 -0
  106. data/spec/dummy/bin/rails +4 -0
  107. data/spec/dummy/bin/rake +4 -0
  108. data/spec/dummy/config/application.rb +23 -0
  109. data/spec/dummy/config/boot.rb +5 -0
  110. data/spec/dummy/config/database.yml +25 -0
  111. data/spec/dummy/config/environment.rb +5 -0
  112. data/spec/dummy/config/environments/development.rb +29 -0
  113. data/spec/dummy/config/environments/production.rb +80 -0
  114. data/spec/dummy/config/environments/test.rb +36 -0
  115. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  116. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  117. data/spec/dummy/config/initializers/inflections.rb +16 -0
  118. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  119. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  120. data/spec/dummy/config/initializers/session_store.rb +3 -0
  121. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  122. data/spec/dummy/config/locales/en.yml +23 -0
  123. data/spec/dummy/config/routes.rb +56 -0
  124. data/spec/dummy/config.ru +4 -0
  125. data/spec/dummy/db/test.sqlite3 +0 -0
  126. data/spec/dummy/log/development.log +0 -0
  127. data/spec/dummy/log/test.log +1418 -0
  128. data/spec/dummy/public/404.html +58 -0
  129. data/spec/dummy/public/422.html +58 -0
  130. data/spec/dummy/public/500.html +57 -0
  131. data/spec/dummy/public/favicon.ico +0 -0
  132. data/spec/helpers/crud_link_helper_spec.rb +88 -0
  133. data/spec/helpers/page_title_helper_spec.rb +83 -0
  134. data/spec/spec_helper.rb +14 -0
  135. metadata +261 -0
@@ -0,0 +1,5 @@
1
+ namespace :wiki do
2
+ task :serve do
3
+ sh 'gollum --page-file-dir doc/wiki'
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ if Rails.env.development?
2
+ require 'gollum/app'
3
+ Precious::App.set :gollum_path, Rails.root
4
+ Precious::App.set :wiki_options, page_file_dir: 'doc/wiki'
5
+ end
@@ -0,0 +1,10 @@
1
+ Dir.glob('config/locales/*.yml') do |locale_file|
2
+ describe locale_file do
3
+ it { should be_parseable }
4
+ it { should have_valid_pluralization_keys }
5
+ it { should_not have_missing_pluralization_keys }
6
+ it { should have_one_top_level_namespace }
7
+ it { should_not have_legacy_interpolations }
8
+ it { should have_a_valid_locale }
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ #page {
2
+ @include outer-container;
3
+ }
@@ -0,0 +1,425 @@
1
+ /*! normalize.css v3.0.1 | MIT License | git.io/normalize */
2
+
3
+ /**
4
+ * 1. Set default font family to sans-serif.
5
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
6
+ * user zoom.
7
+ */
8
+
9
+ html {
10
+ font-family: sans-serif; /* 1 */
11
+ -ms-text-size-adjust: 100%; /* 2 */
12
+ -webkit-text-size-adjust: 100%; /* 2 */
13
+ }
14
+
15
+ /**
16
+ * Remove default margin.
17
+ */
18
+
19
+ body {
20
+ margin: 0;
21
+ }
22
+
23
+ /* HTML5 display definitions
24
+ ========================================================================== */
25
+
26
+ /**
27
+ * Correct `block` display not defined for any HTML5 element in IE 8/9.
28
+ * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.
29
+ * Correct `block` display not defined for `main` in IE 11.
30
+ */
31
+
32
+ article,
33
+ aside,
34
+ details,
35
+ figcaption,
36
+ figure,
37
+ footer,
38
+ header,
39
+ hgroup,
40
+ main,
41
+ nav,
42
+ section,
43
+ summary {
44
+ display: block;
45
+ }
46
+
47
+ /**
48
+ * 1. Correct `inline-block` display not defined in IE 8/9.
49
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
50
+ */
51
+
52
+ audio,
53
+ canvas,
54
+ progress,
55
+ video {
56
+ display: inline-block; /* 1 */
57
+ vertical-align: baseline; /* 2 */
58
+ }
59
+
60
+ /**
61
+ * Prevent modern browsers from displaying `audio` without controls.
62
+ * Remove excess height in iOS 5 devices.
63
+ */
64
+
65
+ audio:not([controls]) {
66
+ display: none;
67
+ height: 0;
68
+ }
69
+
70
+ /**
71
+ * Address `[hidden]` styling not present in IE 8/9/10.
72
+ * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
73
+ */
74
+
75
+ [hidden],
76
+ template {
77
+ display: none;
78
+ }
79
+
80
+ /* Links
81
+ ========================================================================== */
82
+
83
+ /**
84
+ * Remove the gray background color from active links in IE 10.
85
+ */
86
+
87
+ a {
88
+ background: transparent;
89
+ }
90
+
91
+ /**
92
+ * Improve readability when focused and also mouse hovered in all browsers.
93
+ */
94
+
95
+ a:active,
96
+ a:hover {
97
+ outline: 0;
98
+ }
99
+
100
+ /* Text-level semantics
101
+ ========================================================================== */
102
+
103
+ /**
104
+ * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
105
+ */
106
+
107
+ abbr[title] {
108
+ border-bottom: 1px dotted;
109
+ }
110
+
111
+ /**
112
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
113
+ */
114
+
115
+ b,
116
+ strong {
117
+ font-weight: bold;
118
+ }
119
+
120
+ /**
121
+ * Address styling not present in Safari and Chrome.
122
+ */
123
+
124
+ dfn {
125
+ font-style: italic;
126
+ }
127
+
128
+ /**
129
+ * Address variable `h1` font-size and margin within `section` and `article`
130
+ * contexts in Firefox 4+, Safari, and Chrome.
131
+ */
132
+
133
+ h1 {
134
+ font-size: 2em;
135
+ margin: 0.67em 0;
136
+ }
137
+
138
+ /**
139
+ * Address styling not present in IE 8/9.
140
+ */
141
+
142
+ mark {
143
+ background: #ff0;
144
+ color: #000;
145
+ }
146
+
147
+ /**
148
+ * Address inconsistent and variable font size in all browsers.
149
+ */
150
+
151
+ small {
152
+ font-size: 80%;
153
+ }
154
+
155
+ /**
156
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
157
+ */
158
+
159
+ sub,
160
+ sup {
161
+ font-size: 75%;
162
+ line-height: 0;
163
+ position: relative;
164
+ vertical-align: baseline;
165
+ }
166
+
167
+ sup {
168
+ top: -0.5em;
169
+ }
170
+
171
+ sub {
172
+ bottom: -0.25em;
173
+ }
174
+
175
+ /* Embedded content
176
+ ========================================================================== */
177
+
178
+ /**
179
+ * Remove border when inside `a` element in IE 8/9/10.
180
+ */
181
+
182
+ img {
183
+ border: 0;
184
+ }
185
+
186
+ /**
187
+ * Correct overflow not hidden in IE 9/10/11.
188
+ */
189
+
190
+ svg:not(:root) {
191
+ overflow: hidden;
192
+ }
193
+
194
+ /* Grouping content
195
+ ========================================================================== */
196
+
197
+ /**
198
+ * Address margin not present in IE 8/9 and Safari.
199
+ */
200
+
201
+ figure {
202
+ margin: 1em 40px;
203
+ }
204
+
205
+ /**
206
+ * Address differences between Firefox and other browsers.
207
+ */
208
+
209
+ hr {
210
+ -moz-box-sizing: content-box;
211
+ box-sizing: content-box;
212
+ height: 0;
213
+ }
214
+
215
+ /**
216
+ * Contain overflow in all browsers.
217
+ */
218
+
219
+ pre {
220
+ overflow: auto;
221
+ }
222
+
223
+ /**
224
+ * Address odd `em`-unit font size rendering in all browsers.
225
+ */
226
+
227
+ code,
228
+ kbd,
229
+ pre,
230
+ samp {
231
+ font-family: monospace, monospace;
232
+ font-size: 1em;
233
+ }
234
+
235
+ /* Forms
236
+ ========================================================================== */
237
+
238
+ /**
239
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
240
+ * styling of `select`, unless a `border` property is set.
241
+ */
242
+
243
+ /**
244
+ * 1. Correct color not being inherited.
245
+ * Known issue: affects color of disabled elements.
246
+ * 2. Correct font properties not being inherited.
247
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
248
+ */
249
+
250
+ button,
251
+ input,
252
+ optgroup,
253
+ select,
254
+ textarea {
255
+ color: inherit; /* 1 */
256
+ font: inherit; /* 2 */
257
+ margin: 0; /* 3 */
258
+ }
259
+
260
+ /**
261
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
262
+ */
263
+
264
+ button {
265
+ overflow: visible;
266
+ }
267
+
268
+ /**
269
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
270
+ * All other form control elements do not inherit `text-transform` values.
271
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
272
+ * Correct `select` style inheritance in Firefox.
273
+ */
274
+
275
+ button,
276
+ select {
277
+ text-transform: none;
278
+ }
279
+
280
+ /**
281
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
282
+ * and `video` controls.
283
+ * 2. Correct inability to style clickable `input` types in iOS.
284
+ * 3. Improve usability and consistency of cursor style between image-type
285
+ * `input` and others.
286
+ */
287
+
288
+ button,
289
+ html input[type="button"], /* 1 */
290
+ input[type="reset"],
291
+ input[type="submit"] {
292
+ -webkit-appearance: button; /* 2 */
293
+ cursor: pointer; /* 3 */
294
+ }
295
+
296
+ /**
297
+ * Re-set default cursor for disabled elements.
298
+ */
299
+
300
+ button[disabled],
301
+ html input[disabled] {
302
+ cursor: default;
303
+ }
304
+
305
+ /**
306
+ * Remove inner padding and border in Firefox 4+.
307
+ */
308
+
309
+ button::-moz-focus-inner,
310
+ input::-moz-focus-inner {
311
+ border: 0;
312
+ padding: 0;
313
+ }
314
+
315
+ /**
316
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
317
+ * the UA stylesheet.
318
+ */
319
+
320
+ input {
321
+ line-height: normal;
322
+ }
323
+
324
+ /**
325
+ * It's recommended that you don't attempt to style these elements.
326
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
327
+ *
328
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
329
+ * 2. Remove excess padding in IE 8/9/10.
330
+ */
331
+
332
+ input[type="checkbox"],
333
+ input[type="radio"] {
334
+ box-sizing: border-box; /* 1 */
335
+ padding: 0; /* 2 */
336
+ }
337
+
338
+ /**
339
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
340
+ * `font-size` values of the `input`, it causes the cursor style of the
341
+ * decrement button to change from `default` to `text`.
342
+ */
343
+
344
+ input[type="number"]::-webkit-inner-spin-button,
345
+ input[type="number"]::-webkit-outer-spin-button {
346
+ height: auto;
347
+ }
348
+
349
+ /**
350
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
351
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome
352
+ * (include `-moz` to future-proof).
353
+ */
354
+
355
+ input[type="search"] {
356
+ -webkit-appearance: textfield; /* 1 */
357
+ -moz-box-sizing: content-box;
358
+ -webkit-box-sizing: content-box; /* 2 */
359
+ box-sizing: content-box;
360
+ }
361
+
362
+ /**
363
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
364
+ * Safari (but not Chrome) clips the cancel button when the search input has
365
+ * padding (and `textfield` appearance).
366
+ */
367
+
368
+ input[type="search"]::-webkit-search-cancel-button,
369
+ input[type="search"]::-webkit-search-decoration {
370
+ -webkit-appearance: none;
371
+ }
372
+
373
+ /**
374
+ * Define consistent border, margin, and padding.
375
+ */
376
+
377
+ fieldset {
378
+ border: 1px solid #c0c0c0;
379
+ margin: 0 2px;
380
+ padding: 0.35em 0.625em 0.75em;
381
+ }
382
+
383
+ /**
384
+ * 1. Correct `color` not being inherited in IE 8/9/10/11.
385
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
386
+ */
387
+
388
+ legend {
389
+ border: 0; /* 1 */
390
+ padding: 0; /* 2 */
391
+ }
392
+
393
+ /**
394
+ * Remove default vertical scrollbar in IE 8/9/10/11.
395
+ */
396
+
397
+ textarea {
398
+ overflow: auto;
399
+ }
400
+
401
+ /**
402
+ * Don't inherit the `font-weight` (applied by a rule above).
403
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
404
+ */
405
+
406
+ optgroup {
407
+ font-weight: bold;
408
+ }
409
+
410
+ /* Tables
411
+ ========================================================================== */
412
+
413
+ /**
414
+ * Remove most spacing between table cells.
415
+ */
416
+
417
+ table {
418
+ border-collapse: collapse;
419
+ border-spacing: 0;
420
+ }
421
+
422
+ td,
423
+ th {
424
+ padding: 0;
425
+ }
@@ -0,0 +1,7 @@
1
+ # Special decorator for delegating Kaminari methods to the underlying
2
+ # CollectionDecorator. This decorator is set as default in
3
+ # {ApplicationDecorator}.
4
+ class PaginatingDecorator < Draper::CollectionDecorator
5
+ delegate :current_page, :total_pages, :limit_value, :total_count,
6
+ :offset_value, :last_page?
7
+ end
@@ -0,0 +1 @@
1
+ require 'pundit/rspec'
@@ -0,0 +1,5 @@
1
+ begin
2
+ require 'rubocop/rake_task'
3
+ Rubocop::RakeTask.new
4
+ rescue LoadError
5
+ end
@@ -0,0 +1,38 @@
1
+ AllCops:
2
+ Include:
3
+ - '**/*.gemspec'
4
+ - '**/Rakefile'
5
+ Exclude:
6
+ - bin/**
7
+ - db/**
8
+ - vendor/**
9
+ RunRailsCops: true
10
+
11
+ SignalException:
12
+ EnforcedStyle: only_raise
13
+
14
+ SymbolArray:
15
+ Enabled: true
16
+
17
+ HasAndBelongsToMany:
18
+ Enabled: false
19
+
20
+ GuardClause:
21
+ Enabled: true
22
+
23
+ MethodLength:
24
+ Max: 15
25
+
26
+ Documentation:
27
+ Exclude:
28
+ - app/controllers/*
29
+ - app/decorators/*
30
+ - app/policies/*
31
+ - config/application.rb
32
+
33
+ Blocks:
34
+ Exclude:
35
+ - spec/**/*
36
+
37
+ AssignmentInCondition:
38
+ Enabled: false
@@ -0,0 +1,14 @@
1
+ # Simple custom select input control for SimpleForm that applies the select2
2
+ # javascript library for extra fanciness.
3
+ class Select2Input < SimpleForm::Inputs::CollectionSelectInput
4
+ def input_options
5
+ super.merge allow_blank: true
6
+ end
7
+
8
+ def input_html_options
9
+ super.merge(
10
+ style: 'width: 100%;',
11
+ :'data-placeholder' => placeholder_text
12
+ )
13
+ end
14
+ end
@@ -0,0 +1,65 @@
1
+ # Use this setup block to configure all options available in SimpleForm.
2
+ SimpleForm.setup do |config|
3
+ config.wrappers :default,
4
+ class: :input,
5
+ hint_class: :'field-with-hint',
6
+ error_class: :'field-with-errors' do |b|
7
+ b.use :html5
8
+ b.use :placeholder
9
+ b.use :maxlength
10
+ b.use :pattern
11
+ b.use :min_max
12
+ b.use :readonly
13
+ b.use :label, wrap_with: { tag: :div, class: 'input-label' }
14
+
15
+ b.wrapper tag: :div, class: 'input-field' do |c|
16
+ c.use :input
17
+ c.use :error, wrap_with: { tag: :div, class: :error }
18
+ c.use :hint, wrap_with: { tag: :div, class: :hint }
19
+ end
20
+ end
21
+
22
+ config.wrappers :simple,
23
+ class: :input,
24
+ hint_class: :'field-with-hint',
25
+ error_class: :'field-with-errors' do |b|
26
+ b.use :html5
27
+ b.use :placeholder
28
+ b.use :maxlength
29
+ b.use :pattern
30
+ b.use :min_max
31
+ b.use :readonly
32
+ b.use :label_input
33
+ b.use :error, wrap_with: { tag: :div, class: :error }
34
+ b.use :hint, wrap_with: { tag: :div, class: :hint }
35
+ end
36
+
37
+ config.default_wrapper = :default
38
+ config.boolean_style = :nested
39
+ config.button_class = 'button'
40
+ config.error_method = :to_sentence
41
+ config.error_notification_tag = :h2
42
+ config.error_notification_class = 'error-notification'
43
+ # config.error_notification_id = nil
44
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
45
+ # config.collection_value_methods = [ :id, :to_s ]
46
+ # config.collection_wrapper_tag = nil
47
+ # config.collection_wrapper_class = nil
48
+ # config.item_wrapper_tag = :span
49
+ # config.item_wrapper_class = nil
50
+ config.label_text = ->(label, required) { "#{label} #{required}" }
51
+ # config.label_class = 'control-label'
52
+ config.form_class = nil
53
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
54
+ # config.required_by_default = true
55
+ config.browser_validations = false
56
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
57
+ # config.input_mappings = { /count/ = > :integer }
58
+ # config.wrapper_mappings = { string: :prepend }
59
+ # config.time_zone_priority = nil
60
+ # config.country_priority = nil
61
+ # config.translate_labels = true
62
+ config.inputs_discovery = true
63
+ config.cache_discovery = !Rails.env.development?
64
+ # config.input_class = nil
65
+ end
@@ -0,0 +1,6 @@
1
+ SimpleCov.start 'rails' do
2
+ add_filter '/vendor/'
3
+ add_filter 'app/inputs'
4
+ add_group 'Decorators', 'app/decorators'
5
+ add_group 'Policies', 'app/policies'
6
+ end
@@ -0,0 +1,27 @@
1
+ require 'simplecov'
2
+
3
+ ENV['RAILS_ENV'] = 'test'
4
+
5
+ require File.expand_path('../../config/environment', __FILE__)
6
+
7
+ require 'rspec/rails'
8
+
9
+ Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each do |file|
10
+ require file
11
+ end
12
+
13
+ module Features
14
+ # Extend this module in spec/support/features/*.rb
15
+ end
16
+
17
+ RSpec.configure do |config|
18
+ config.expect_with :rspec do |c|
19
+ c.syntax = :expect
20
+ end
21
+
22
+ config.include Features, type: :feature
23
+ config.infer_base_class_for_anonymous_controllers = false
24
+ config.order = 'random'
25
+ config.treat_symbols_as_metadata_keys_with_true_values = true
26
+ config.use_transactional_fixtures = false
27
+ end
@@ -0,0 +1 @@
1
+ Spring.watch 'spec/factories'
@@ -0,0 +1,11 @@
1
+ # Special kind of input field that shows the editable value as plain text, not
2
+ # with a form widget. Handy when you want to indicate the field is not
3
+ # editable.
4
+ #
5
+ # @example
6
+ # f.input :my_attribute, as: :static
7
+ class StaticInput < SimpleForm::Inputs::Base
8
+ def input
9
+ content_tag :span, object.send(attribute_name), class: 'static-field'
10
+ end
11
+ end
@@ -0,0 +1 @@
1
+ WebMock.disable_net_connect!(allow_localhost: true)
@@ -0,0 +1,7 @@
1
+ --title 'Rails Application Documentation'
2
+ --readme README.md
3
+ --markup markdown
4
+ --markup-provider kramdown
5
+ --files LICENSE,CHANGELOG
6
+ --output-dir doc/app
7
+ --no-stats
@@ -0,0 +1,3 @@
1
+ module Stationed
2
+ VERSION = "0.0.1"
3
+ end
data/lib/stationed.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'stationed/engine'
2
+
3
+ module Stationed
4
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :stationed do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,11 @@
1
+ = form_for(@<%= singular_table_name %>) do |f|
2
+ = f.error_notification
3
+ = f.base_errors
4
+
5
+ .form-inputs
6
+ <%- attributes.each do |attribute| -%>
7
+ = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
8
+ <%- end -%>
9
+
10
+ .form-actions
11
+ = f.submit_or_cancel
@@ -0,0 +1,2 @@
1
+ %h1= page_title @<%= singular_table_name %>
2
+ = render 'form'