natural_number_string 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 +4 -4
- data/README.md +23 -7
- data/changelog.md +11 -0
- data/example/setup.rb +3 -1
- data/lib/natural_number_string.rb +8 -0
- data/lib/natural_number_string/version.rb +1 -1
- data/natural_number_string.gemspec +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: c0e3b134f407c2223c5b811d00d392b9e989a017
|
4
|
+
data.tar.gz: 010d9310aa376410c6380a2e887e06cd5430e9ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4af9e6624ce57b60ba1edf1d0c08408d1838e59121731cb85ca762003c00152af28df042f8c9c2765ea0c5bc996b1d3f66dfd7ca96a3b60b8f3461b7f0d916b8
|
7
|
+
data.tar.gz: 5a198f7188142981d8867402ff83b04458e8de69243625e4da7850a4b12c7dc764d4dcc45a6c14a9c66beb9c3a0fd0bf93f5884de67715b6b352e0ba4bdffe24
|
data/README.md
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
# NaturalNumberString
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem version][gem-image]][gem-url] [![Travis-CI Status][travis-image]][travis-url]
|
4
|
+
|
5
|
+
> Check the string is a natural number?
|
6
|
+
|
7
|
+
|
8
|
+
## Usage
|
9
|
+
|
10
|
+
|
11
|
+
## API
|
12
|
+
|
13
|
+
|
14
|
+
## Changelog
|
15
|
+
|
16
|
+
[changelog.md](./changelog.md).
|
4
17
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
18
|
|
7
19
|
## Installation
|
8
20
|
|
@@ -20,22 +32,26 @@ Or install it yourself as:
|
|
20
32
|
|
21
33
|
$ gem install natural_number_string
|
22
34
|
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
35
|
|
27
36
|
## Development
|
28
37
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
|
38
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
39
|
|
31
40
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
41
|
|
42
|
+
|
33
43
|
## Contributing
|
34
44
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
45
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/packsaddle/ruby-natural_number_string. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
46
|
|
37
47
|
|
38
48
|
## License
|
39
49
|
|
50
|
+
© [sanemat](http://sane.jp)
|
51
|
+
|
40
52
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
53
|
|
54
|
+
[travis-url]: https://travis-ci.org/packsaddle/ruby-natural_number_string
|
55
|
+
[travis-image]: https://img.shields.io/travis/packsaddle/ruby-natural_number_string/master.svg?style=flat-square&label=build%20%28linux%29
|
56
|
+
[gem-url]: https://rubygems.org/gems/natural_number_string
|
57
|
+
[gem-image]: http://img.shields.io/gem/v/natural_number_string.svg?style=flat-square
|
data/changelog.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
<a name="0.2.1"></a>
|
2
|
+
## [0.2.1](https://github.com/packsaddle/ruby-natural_number_string/compare/v0.2.0...v0.2.1) (2015-09-26)
|
3
|
+
|
4
|
+
|
5
|
+
### Features
|
6
|
+
|
7
|
+
* **positive:** add positive_integer_string? ([69ecf8a](https://github.com/packsaddle/ruby-natural_number_string/commit/69ecf8a))
|
8
|
+
* **zero-or-positive:** add zero_or_positive_integer_string? ([6d3c46b](https://github.com/packsaddle/ruby-natural_number_string/commit/6d3c46b))
|
9
|
+
|
10
|
+
|
11
|
+
|
1
12
|
<a name="0.2.0"></a>
|
2
13
|
# [0.2.0](https://github.com/packsaddle/ruby-natural_number_string/compare/v0.1.0...v0.2.0) (2015-09-26)
|
3
14
|
|
data/example/setup.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'open3'
|
4
|
-
out, err, status = Open3.capture3(
|
4
|
+
out, err, status = Open3.capture3(
|
5
|
+
'bundle', 'install', '--path', 'vendor/bundle'
|
6
|
+
)
|
5
7
|
$stdout.puts out
|
6
8
|
$stderr.puts err
|
7
9
|
exit status.exitstatus if !status.exitstatus.nil? && status.exitstatus != 0
|
@@ -6,4 +6,12 @@ module NaturalNumberString
|
|
6
6
|
def natural_number_string?(value)
|
7
7
|
value.is_a?(String) && /^\d+$/ =~ value ? true : false
|
8
8
|
end
|
9
|
+
|
10
|
+
def zero_or_positive_integer_string?(value)
|
11
|
+
value.is_a?(String) && /^\d+$/ =~ value ? true : false
|
12
|
+
end
|
13
|
+
|
14
|
+
def positive_integer_string?(value)
|
15
|
+
value.is_a?(String) && /^[1-9]\d*$/ =~ value ? true : false
|
16
|
+
end
|
9
17
|
end
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.description =
|
15
15
|
'Check the string is a natural number?'
|
16
16
|
spec.homepage =
|
17
|
-
|
17
|
+
'https://github.com/packsaddle/ruby-natural_number_string'
|
18
18
|
spec.license = 'MIT'
|
19
19
|
|
20
20
|
spec.files =
|