string_with_unit 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c99dc8b650dac023740fef0aa7fc165fb773b5d
4
- data.tar.gz: f5af8de870c9ff948ad80622131da86608456202
3
+ metadata.gz: 55cfdf6d1f71bcd53e986e5b4548a1f419e81631
4
+ data.tar.gz: 15d640d157f82f038edaa2f4957cab68390c6325
5
5
  SHA512:
6
- metadata.gz: 969c9e634b2262a6e7ce42207e3c55d29d1d9aabbb29a8eacfcebbf17589a98a8969acd74832d50d17709f025766d2e4dd3454792cfa5bf0cdd87b5aae8f2d62
7
- data.tar.gz: f88ea61c1a8e19a8e31f5eff6a8c1c3f356c8d95c5bd617a4c7dca954612590e581e46bcc0bd159881133fbe0186f98994dba1529f13bd6d901d8ac89d6b5465
6
+ metadata.gz: d9c010e5458836151730b96222621258926cc4cf2f6e59a9028463ff630723091568feeb80b56c43a5c3fe5e790d52bd8022029a3fe31b5d424a18762a347c4c
7
+ data.tar.gz: a2882a80dc2d5651ee537384efece8b8a2ccb2364b40652928f384e08bce24fe85afb934ac6bf6e7369d3dbacae64744f3dfc0652d1ca83c8ddff359bfcc6218
data/README.md CHANGED
@@ -1,21 +1,12 @@
1
1
  # StringWithUnit
2
+ [![Gem Version](https://badge.fury.io/rb/string_with_unit.svg)](https://badge.fury.io/rb/string_with_unit) [![Build Status](https://travis-ci.org/meganemura/string_with_unit.svg?branch=master)](https://travis-ci.org/meganemura/string_with_unit)
2
3
 
3
4
  ## Installation
4
5
 
5
- Add this line to your application's Gemfile:
6
-
7
6
  ```ruby
8
7
  gem 'string_with_unit'
9
8
  ```
10
9
 
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- Or install it yourself as:
16
-
17
- $ gem install string_with_unit
18
-
19
10
  ## Usage
20
11
 
21
12
  ```ruby
@@ -36,8 +27,10 @@ puts 101.to_s_with_unit('dalmatian', 'dalmatians') # => "101 dalmatians"
36
27
 
37
28
  ### With ActiveSupport::Inflector
38
29
 
39
- ```
30
+ ```ruby
31
+ require 'string_with_unit'
40
32
  require 'active_support/inflector'
33
+
41
34
  (-2..2).each do |i|
42
35
  puts i.to_string_with_unit('gem') # Specify singular unit only
43
36
  end
@@ -18,7 +18,7 @@ module StringWithUnit
18
18
  end
19
19
 
20
20
  def singular_number?
21
- value.abs == 1
21
+ value == 1
22
22
  end
23
23
 
24
24
  def plural_unit
@@ -1,3 +1,3 @@
1
1
  module StringWithUnit
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["meganemura"]
10
10
  spec.email = ["meganemura@users.noreply.github.com"]
11
11
 
12
- spec.summary = "Add Integer#to_string_with_unit to express a number with singular/plural unit"
12
+ spec.summary = "Add Integer#to_string_with_unit to easily express a number with singular/plural unit"
13
13
  spec.description = spec.summary
14
14
  spec.homepage = "https://github.com/meganemura/string_with_unit"
15
15
  spec.license = "MIT"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string_with_unit
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
  - meganemura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Add Integer#to_string_with_unit to express a number with singular/plural
69
+ description: Add Integer#to_string_with_unit to easily express a number with singular/plural
70
70
  unit
71
71
  email:
72
72
  - meganemura@users.noreply.github.com
@@ -111,6 +111,6 @@ rubyforge_project:
111
111
  rubygems_version: 2.5.1
112
112
  signing_key:
113
113
  specification_version: 4
114
- summary: Add Integer#to_string_with_unit to express a number with singular/plural
114
+ summary: Add Integer#to_string_with_unit to easily express a number with singular/plural
115
115
  unit
116
116
  test_files: []