sum_strings 0.1.0 → 0.1.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 +24 -2
- data/lib/sum_strings/version.rb +1 -1
- data/sum_strings.gemspec +1 -1
- data/sum_strings.png +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 435e019d9c2a764bb8c40da674f9f3ed5cc3661d
|
4
|
+
data.tar.gz: 83f7be2a0bbf9705af6a0279366cc42774827320
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be156e19cb51d7bd7423882517045b78e77ef14b8d40b90b4a0c27b9c3952b2fa816c42f75bcd94a222fe1194e168a17caeb87b5b8d3f05ce6a7d5c0d8d31f10
|
7
|
+
data.tar.gz: 38ae6eec85be7ec9fa110fd76ff6afd688ea7d7d2927acd1394b566ca837730d05d99cf7bb1fa5a8bdf8d87371f92b411788a129de25cdced94e9f154f22dd23
|
data/README.md
CHANGED
@@ -22,7 +22,29 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
Sample for summing array of string values like hours.
|
26
|
+
We have array with some hours which we need to sum.
|
27
|
+
Sample array:
|
28
|
+
`working_hours = ["09:20","5:10","08:00","23:20","10:13"]`
|
29
|
+
|
30
|
+
Summing this array we can do like:
|
31
|
+
`working_hours.sum_strings(':')`
|
32
|
+
|
33
|
+
The gem is extended method of ruby Array calss so calling method `sum_strings(':')` with providing split char as parameter.
|
34
|
+
|
35
|
+
Result would be:
|
36
|
+
`56:3`
|
37
|
+
|
38
|
+
In case that you have some other split char you just need to provide it to a method.
|
39
|
+
Sample:
|
40
|
+
`working_hours = ["09-20","5-10","08-00","23-20","10-13"]`
|
41
|
+
`sum_strings('-')`
|
42
|
+
|
43
|
+
Here is a simple project where you can see practical usage of the gem `https://github.com/nezirz/use_sum_strings`
|
44
|
+
|
45
|
+
This is how the summing looks:
|
46
|
+

|
47
|
+
|
26
48
|
|
27
49
|
## Development
|
28
50
|
|
@@ -32,7 +54,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
54
|
|
33
55
|
## Contributing
|
34
56
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
57
|
+
Bug reports and pull requests are welcome on GitHub at `https://github.com/nezirz/sum_strings`. 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.
|
36
58
|
|
37
59
|
## License
|
38
60
|
|
data/lib/sum_strings/version.rb
CHANGED
data/sum_strings.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = %q{Gem for summing string values from arrays.}
|
13
13
|
spec.description = %q{With this gem you are able to sum array of strings values. Primary ment for summing array of hours in format ["20:20","10:10"].strings_to_sum(':'). }
|
14
|
-
spec.homepage = "https://github.com/nezirz/sum_strings
|
14
|
+
spec.homepage = "https://github.com/nezirz/sum_strings"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
data/sum_strings.png
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sum_strings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nezir
|
@@ -57,7 +57,8 @@ files:
|
|
57
57
|
- lib/sum_strings.rb
|
58
58
|
- lib/sum_strings/version.rb
|
59
59
|
- sum_strings.gemspec
|
60
|
-
|
60
|
+
- sum_strings.png
|
61
|
+
homepage: https://github.com/nezirz/sum_strings
|
61
62
|
licenses:
|
62
63
|
- MIT
|
63
64
|
metadata: {}
|