tweet_validator 0.0.1.beta2 → 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.
- checksums.yaml +4 -4
- data/README.md +41 -1
- data/lib/tweet_validator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 793588e80427f715a7817bc49999ce10d962504a
|
4
|
+
data.tar.gz: d11e59328d7a39ec793ed99b08e41b3581c22996
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 464178eba9468210e647d43e6d7ec0a550143b23ec95ace0f7f3774367b59625ebf1b67190ab22c2a5c6bfa8e8eb21573a6369e22996c022b11709958f456075
|
7
|
+
data.tar.gz: dae0fb0131cad2153c11b781228ee51fdbb39357bab3790bdae1956942b78fe192d897170bd4695a6ac251c2b6fe185eda5e6472293e7d22b6ba11e920041133
|
data/README.md
CHANGED
@@ -26,7 +26,47 @@ Or install it yourself as:
|
|
26
26
|
|
27
27
|
## Usage
|
28
28
|
|
29
|
-
|
29
|
+
```ruby
|
30
|
+
class Tweet < ActiveRecord::Base
|
31
|
+
validates :message, tweet_length: true
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
### Not Rails
|
36
|
+
|
37
|
+
include `TweetValidator` manually
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
class Tweet < ActiveRecord::Base
|
41
|
+
include TweetValidator
|
42
|
+
|
43
|
+
validates :message, tweet_length: true
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
## Specification
|
48
|
+
calculate the length excluding `%<〜>` and `%{〜}`
|
49
|
+
|
50
|
+
### Example
|
51
|
+
```ruby
|
52
|
+
tweet.message = "a" * 140
|
53
|
+
tweet.valid?
|
54
|
+
# => true
|
55
|
+
|
56
|
+
tweet.message = "a" * 141
|
57
|
+
tweet.valid?
|
58
|
+
# => false
|
59
|
+
|
60
|
+
tweet.message = "a" * 140 + "%{screen_name}"
|
61
|
+
tweet.valid?
|
62
|
+
# => true
|
63
|
+
```
|
64
|
+
|
65
|
+
## Changelog
|
66
|
+
[full changelog](https://github.com/sue445/tweet_validatorcompare/0.0.1...master)
|
67
|
+
|
68
|
+
### 0.0.1
|
69
|
+
* first release
|
30
70
|
|
31
71
|
## Contributing
|
32
72
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tweet_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sueyoshi_go
|
@@ -160,9 +160,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
|
-
- - "
|
163
|
+
- - ">="
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
165
|
+
version: '0'
|
166
166
|
requirements: []
|
167
167
|
rubyforge_project:
|
168
168
|
rubygems_version: 2.2.2
|