formular 0.2.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d70a328fd35abcbc14db333621126deb14c40e1
4
- data.tar.gz: a8563cdc4aa0a144b1d11d9ef960ce8337c12c52
3
+ metadata.gz: c0a80c5927dbbece4b4e9a888d51497a4b03fb4d
4
+ data.tar.gz: 0598fe40cccca15f3e0542c5b77a47a89907e5f4
5
5
  SHA512:
6
- metadata.gz: 11d0350fe322bfed668ce7794d5711f1cab046fe6afed225d541e191680ab7fe2035c9b3b6adc109616e95aea269bce87cd79cda79a0e862a404918a4aec1993
7
- data.tar.gz: 3abaae426105020622039d566ef3d947613dd2f67197d212c8783a818f94bd817aa03b97e1ea70919b8c9e3455157843d00e48ccfb9292751cf37f91f52e6d81
6
+ metadata.gz: baa976452c932d62cb3fc78ef2db818016695abb6e2a6b8084c24c42592a702ab39fd86fc2f0fed26b70bb28a03dfcaf9dae71c08618583c230121defb047fb0
7
+ data.tar.gz: bd365b3219770eaf4628cea94447ff9cb596b9aca07fb5f30b89a0f5d9f5ab92ce30844934e975250136afd31e0b0a3860a506df1dd947e2cade309288223d12
@@ -1,3 +1,11 @@
1
+ # v0.2.1 2016-09-29
2
+
3
+ ### Fixed
4
+
5
+ * Correctly require declarative heritage for Formular::Element::Module - (@fran-worley)
6
+ * Update readme & include example gemgem links - (@fran-worley)
7
+
8
+
1
9
  # v0.2.0 2016-09-27
2
10
 
3
11
  First public release
data/README.md CHANGED
@@ -13,7 +13,7 @@ Formular renders HTML forms in a similar fashion to [SimpleForm](https://github.
13
13
 
14
14
  ## Example
15
15
 
16
- While you can instantiate the form builder manually, it's easiest to use the `form` helper to do so. Include `Formular::Helper` into your cell, view, or in a Rails controller as a helper.
16
+ While you can instantiate the form builder manually, it's easiest to use the `form` helper to do so. Include `Formular::Helper` or in rails, `Formular::RailsHelper` into your cell, view, or in a Rails controller as a helper.
17
17
 
18
18
  ```ruby
19
19
  module Post::Cell
@@ -25,7 +25,7 @@ or
25
25
 
26
26
  ```ruby
27
27
  class PostsController < ApplicationController
28
- helper Formular::Helper
28
+ helper Formular::RailsHelper
29
29
  ```
30
30
 
31
31
  You should also configure what builder you want to use. This will wrap inputs correctly, and so on.
@@ -36,59 +36,47 @@ Formular::Helper.builder= :bootstrap3
36
36
 
37
37
  In your view, you're now ready to use Formular's API to render forms.
38
38
 
39
- ```slim
40
- = form(model.contract, url) do |f|
41
-
42
- = f.input :title, placeholder: "Title"
43
- = f.input :url_slug, placeholder: "URL slug"
44
- .form-group
45
- = f.checkbox :is_public, label: "Public?"
46
- .form-group
47
- = f.radio :owner, label: "Flori", value: 1
48
- = f.radio :owner, label: "Konsti", value: 2
49
-
50
- .row
51
- .col-md-2
52
- = f.radio :owner, collection: [["Flori", 1], ["Konsti", 2]], label: "Owners"
53
- .col-md-3
54
- = f.radio :owner, collection: [["Flori", 1], ["Konsti", 2]], label: "Owners, inline", inline: true
55
- = f.checkbox :roles, collection: [["Admin", 1], ["Owner", 2], ["Maintainer", 3]], checked: model.contract.roles, label: "Roles"
56
-
57
- = f.select :select_roles, collection: [["Admin", 1], ["Owner", 2], ["Maintainer", 3]], selected: model.contract.select_roles, label: "Selectable Roles"
58
-
59
- .form-group
60
- = f.textarea :content, placeholder: "And your story...", rows: 9
61
- .form-group
62
- = f.button type: :submit, value: "Submit!", class: [:btn, :'btn-lg', :'btn-default']
63
- ```
64
-
65
- Note that a lot of this code can be done automatically by Formular.
66
-
67
- ## Documentation
68
-
69
- Formular's API docs and information on how to extend it can be found on the [Trailblazer project page](http://trailblazer.to/gems/formular).
70
-
71
- Formular's rendering is easily customizable. It provides built-in support for Foundation 6, Bootstrap 3 and Bootstrap 4 so far with more to come.
72
-
73
- The list of builders provided by default can be seen in the BUILDERS constant. Try the following in an IRB session with your project loaded (rails console).
74
-
75
- ```ruby
76
- Formular::Helper::BUILDERS
77
- ```
78
-
79
-
39
+ Our basic builder ships with the following elements:
40
+ * error_notification
41
+ * form
42
+ * fieldset
43
+ * legend
44
+ * div
45
+ * span
46
+ * p
47
+ * input
48
+ * hidden
49
+ * label
50
+ * error
51
+ * hint
52
+ * textarea
53
+ * submit
54
+ * select
55
+ * checkbox
56
+ * radio
57
+ * wrapper
58
+ * error_wrapper
59
+
60
+ We also provide builders for Twitter Bootstrap (v.3&4) and Zurb's Foundation (v.6)
61
+
62
+ To help you get started we've got some example Sinatra apps so you can see Formular in action:
63
+ [Bootstrap3 (slim)](https://github.com/fran-worley/gemgem-sinatra/tree/formular-slim-bootstrap3)
64
+ [Bootstrap4 (slim)](https://github.com/fran-worley/gemgem-sinatra/tree/formular-slim-bootstrap4)
65
+ Foundation6 (slim)
66
+
67
+ Formular's API docs and information on how to extend it will be found on the [Trailblazer project page](http://trailblazer.to/gems/formular) once the page has been added 😉.
80
68
 
81
69
  ## Key Features
82
70
 
83
71
  * Incredibly fast.
84
- * Customization: "Wrappers" are self-explaining objects. Ships with renderers for Foundation 5 and Bootstrap 3
85
- * No magic. No `respond_to?`, no guessing, no hidden semantics.
72
+ * Customization: "Wrappers" are self-explaining objects. Ships with renderers for Foundation 6 and Bootstrap 3&4
73
+ * No magic, no guessing, no hidden semantics.
86
74
  * A well-designed API instead of a configuration DSL. If you need to change behavior, program it.
87
75
 
88
76
  ## Limitations
89
77
 
90
78
  * Currently, nested hashes aren't suffixed with `_attributes`, as it's usually done in ActiveRecord.
91
- * Capturing only works with Slim and Hamlit. A 'blockless' API is provided to enable use in ERB
79
+ * Capturing only works with Slim and Hamlit. A 'blockless' API is provided to enable use in ERB but watch this space as improvements are coming for ERB
92
80
 
93
81
  ## Installation
94
82
 
@@ -98,7 +86,7 @@ Add this line to your application's Gemfile:
98
86
  gem 'formular'
99
87
  ```
100
88
 
101
- Requires Ruby >= 2.1.
89
+ Requires Ruby >= 2.0.0
102
90
 
103
91
  ## License
104
92
 
@@ -23,8 +23,6 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency "bundler"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
- spec.add_development_dependency "reform"
27
- spec.add_development_dependency "dry-validation"
28
26
  spec.add_development_dependency "trailblazer-cells"
29
27
  spec.add_development_dependency "cells-slim"
30
28
  spec.add_development_dependency "cells-erb"
@@ -1,8 +1,8 @@
1
1
  # Include this in every module that gets further included.
2
2
  # This is literally a copy and past from reform. Could we dry this up ??
3
3
  # https://github.com/apotonick/reform/blob/master/lib/reform/form/module.rb
4
-
5
- # require 'declarative/heritage'
4
+ require 'declarative'
5
+ require 'declarative/heritage'
6
6
  module Formular
7
7
  class Element
8
8
  module Module
@@ -1,3 +1,3 @@
1
1
  module Formular
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-09-28 00:00:00.000000000 Z
12
+ date: 2016-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: declarative
@@ -67,34 +67,6 @@ dependencies:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '10.0'
70
- - !ruby/object:Gem::Dependency
71
- name: reform
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: '0'
84
- - !ruby/object:Gem::Dependency
85
- name: dry-validation
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: '0'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: '0'
98
70
  - !ruby/object:Gem::Dependency
99
71
  name: trailblazer-cells
100
72
  requirement: !ruby/object:Gem::Requirement
@@ -240,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
212
  version: '0'
241
213
  requirements: []
242
214
  rubyforge_project:
243
- rubygems_version: 2.5.1
215
+ rubygems_version: 2.4.6
244
216
  signing_key:
245
217
  specification_version: 4
246
218
  summary: Form builder based on Cells. Fast, Furious, and Framework-Agnostic.