template_params-rails 0.2.1 → 0.2.2
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 +4 -4
- data/README.md +7 -7
- data/lib/template_params/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7488c445d1c9cce7a078ffb9a99017c0624771f9
|
4
|
+
data.tar.gz: 44a70671291ae676aaf081e17e0d36d29e50aace
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77a1c2630d31e08ba0404e9f95a6b7d83dcbbc18d22832144c07cad6bec35194cd21e0e74e0ff1a03f1cd48a565a32923569f04d6d3071d29b636da7f1a5cac4
|
7
|
+
data.tar.gz: d8303acada586374e4565e9095253a0e65725857eabab9f071d4ea8b2ce26e614b3117735f9ab72006deeb0e3177feb6e4454e0f885fbc34543a523897a930c1
|
data/README.md
CHANGED
@@ -3,13 +3,13 @@ Runtime type-check for template preconditions, including instance variables
|
|
3
3
|
and local variables. Think of this as the method signature of a template.
|
4
4
|
There should be at least one of these assertions in almost every template.
|
5
5
|
|
6
|
-
|
6
|
+
template_params-rails project integrates [template_params](https://github.com/jaredbeck/template_params) for rails.
|
7
7
|
## Installation
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem '
|
12
|
+
gem 'template_params-rails'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -18,21 +18,21 @@ And then execute:
|
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
21
|
-
$ gem install
|
21
|
+
$ gem install template_params-rails
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
In template, you may want use template_param like this:
|
25
|
+
In template, you may want to use template_param like this:
|
26
26
|
|
27
27
|
```ruby
|
28
28
|
|
29
29
|
# Assert `poll` is defined. If not, raises an `ArgumentError` (the "arguments"
|
30
30
|
# of the template are invalid).
|
31
|
-
template_param { poll }
|
31
|
+
template_param { poll }
|
32
32
|
|
33
33
|
# Assert `@course` is defined. Meaningless because instance variables are
|
34
34
|
# always defined.
|
35
|
-
template_param { @course }
|
35
|
+
template_param { @course }
|
36
36
|
|
37
37
|
# Assert `poll.is_a?(::Poll)`. If not, raises a `TypeError`.
|
38
38
|
template_param(::Poll) { poll }
|
@@ -45,7 +45,7 @@ template_param(::Course, allow_nil: true) { @course }
|
|
45
45
|
```
|
46
46
|
## Contributing
|
47
47
|
|
48
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/opodartho/
|
48
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/opodartho/template_params-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
49
49
|
|
50
50
|
|
51
51
|
## License
|