octopuses 0.0.1 → 0.0.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/.travis.yml +1 -0
- data/README.md +4 -3
- data/Rakefile +9 -1
- data/lib/octopuses.rb +9 -9
- data/lib/octopuses/version.rb +1 -1
- data/octopuses.gemspec +2 -1
- data/test/octopuses_test.rb +39 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eb095ff615c935f4d6d10157c4a8faf89ff1dfa
|
4
|
+
data.tar.gz: 1569267d303618bca26bb828291d356ccdd373c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 679df5054189b41c847115babe91097c9027cefff1236802e819d507eba1197d73df9fbbbb6ee11c9cc7b82ebe4cc4e1faa04b8a5304b4468188f4591961e89e
|
7
|
+
data.tar.gz: 6cf40ac80e61e2e1e3466fd65068340c49adca21f3d6b78279a9989cff5563e0cab520c0dba80932b44948c86b02e459b7610483f4bbe296d5e2556b63248074
|
data/.travis.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
language: ruby
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
# Octopuses
|
1
|
+
# :octopus: Octopuses :octopus:
|
2
2
|
|
3
|
-
Everyone knows that the proper plural of octopus is octopuses
|
3
|
+
Everyone knows that the proper plural of octopus (:octopus:) is octopuses
|
4
|
+
(:octopus::octopus:).
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
@@ -21,7 +22,7 @@ Or install it yourself as:
|
|
21
22
|
## Usage
|
22
23
|
|
23
24
|
```ruby
|
24
|
-
|
25
|
+
"octopus".pluralize
|
25
26
|
=> "octopuses"
|
26
27
|
```
|
27
28
|
|
data/Rakefile
CHANGED
data/lib/octopuses.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require
|
1
|
+
require 'octopuses/version'
|
2
|
+
require 'active_support/inflector/inflections'
|
2
3
|
|
3
4
|
module Octopuses
|
4
|
-
|
5
|
-
|
5
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
inflect.plural(/(octopus|virus)(es)?$/i, '\1es')
|
7
|
+
inflect.plural(/\u{1F419}+$/i, "\u{1F419}\u{1F419}")
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
inflect.singular(/(octopus|virus)es$/i, '\1')
|
10
|
-
inflect.uncountable(%w(platypus))
|
11
|
-
end
|
9
|
+
inflect.singular(/(octopus|virus)(es)?$/i, '\1')
|
10
|
+
inflect.singular(/\u{1F419}+$/, "\u{1F419}")
|
12
11
|
|
13
|
-
|
12
|
+
inflect.uncountable(%w(platypus))
|
14
13
|
end
|
15
14
|
end
|
15
|
+
|
data/lib/octopuses/version.rb
CHANGED
data/octopuses.gemspec
CHANGED
@@ -16,8 +16,9 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency "
|
19
|
+
spec.add_dependency "activesupport", [">= 3.2"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "minitest"
|
23
24
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
lib = File.expand_path('../../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
require 'minitest/autorun'
|
5
|
+
require 'active_support/inflector'
|
6
|
+
require 'octopuses'
|
7
|
+
|
8
|
+
class OctopusesTest < Minitest::Test
|
9
|
+
def test_pluralize_octopus
|
10
|
+
assert_equal "octopuses", ActiveSupport::Inflector.pluralize("octopus")
|
11
|
+
assert_equal "Octopuses", ActiveSupport::Inflector.pluralize("Octopus")
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_pluralize_virus
|
15
|
+
assert_equal "viruses", ActiveSupport::Inflector.pluralize("virus")
|
16
|
+
assert_equal "Viruses", ActiveSupport::Inflector.pluralize("Virus")
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_pluralize_platypus
|
20
|
+
assert_equal "platypus", ActiveSupport::Inflector.pluralize("platypus")
|
21
|
+
assert_equal "Platypus", ActiveSupport::Inflector.pluralize("Platypus")
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_singularize_octopuses
|
25
|
+
assert_equal "octopus", ActiveSupport::Inflector.singularize("octopuses")
|
26
|
+
assert_equal "Octopus", ActiveSupport::Inflector.singularize("Octopuses")
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_singularize_viruses
|
30
|
+
assert_equal "virus", ActiveSupport::Inflector.singularize("viruses")
|
31
|
+
assert_equal "Virus", ActiveSupport::Inflector.singularize("Viruses")
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_singularize_platypus
|
35
|
+
assert_equal "platypus", ActiveSupport::Inflector.singularize("platypus")
|
36
|
+
assert_equal "Platypus", ActiveSupport::Inflector.singularize("Platypus")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopuses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hidde-Jan Jongsma
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2015-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Everyone knows the proper plural of octopus is octopuses, not octopi.
|
56
70
|
email:
|
57
71
|
- me@hidde-jan.nl
|
@@ -60,6 +74,7 @@ extensions: []
|
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
76
|
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
63
78
|
- Gemfile
|
64
79
|
- LICENSE.txt
|
65
80
|
- README.md
|
@@ -67,6 +82,7 @@ files:
|
|
67
82
|
- lib/octopuses.rb
|
68
83
|
- lib/octopuses/version.rb
|
69
84
|
- octopuses.gemspec
|
85
|
+
- test/octopuses_test.rb
|
70
86
|
homepage: https://github.com/hidde-jan/octopuses
|
71
87
|
licenses:
|
72
88
|
- MIT
|