proquint 0.0.1 → 0.0.2

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: 600b3df2f02f5225349f541dc4266bd25130cf68
4
- data.tar.gz: af78b6ac37f47f43f47835356f73c0daec4f6c14
3
+ metadata.gz: 1d7038678f9248642bcca441202e98040e722789
4
+ data.tar.gz: c89a9517d7b243439014768606dd17a40796383d
5
5
  SHA512:
6
- metadata.gz: d256e818fea8f45a4c09253dfb72bec737c153dae86a4577f5fb488c4a6b8c2b00a5484d8c985b68050538acdd9f47cd3e46a00fdf35a1943ac7db5cc686fd9b
7
- data.tar.gz: 459f5580334a2cb37993da41c7122c38dba34fcb40f822483eaba85501d4f9e7999ae2f6410d8dabf780b5efc54c97f56d2651b8a70e4a3fc1b9bbe9d00a712b
6
+ metadata.gz: cd342483b4939ed2973d178ce5e42d96de6c6d25dacf677dae301900c71b163d432925bcf91e4223adc6df79d4018836a1fe3253cb1aefd2392fc60d93f2a406
7
+ data.tar.gz: 144356fd69060a43d4e896c9b1464d64ea02b8490ec8115d76cacd1d1db8935210d0ee1f461ed87ce7e618255ca20b3cd8967c760c24c3b76e0d9123cd9142c6
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.3
data/README.md CHANGED
@@ -38,3 +38,6 @@ Or install it yourself as:
38
38
  3. Commit your changes (`git commit -am 'Add some feature'`)
39
39
  4. Push to the branch (`git push origin my-new-feature`)
40
40
  5. Create a new Pull Request
41
+
42
+ [![Build
43
+ Status](https://travis-ci.org/bjjb/proquint.svg?branch=master)](https://travis-ci.org/bjjb/proquint)
data/lib/proquint.rb CHANGED
@@ -21,6 +21,10 @@ module Proquint
21
21
  DQUAD_PATTERN = /^(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})$/
22
22
  HEX_PATTERN = /^x(\h+)$/
23
23
 
24
+ def str2words(string)
25
+ string.bytes
26
+ end
27
+
24
28
  def dquad2hex(dquad)
25
29
  if dquad =~ DQUAD_PATTERN
26
30
  i = (($1.to_i << 24) + ($2.to_i << 16) + ($3.to_i << 8) + $4.to_i)
@@ -1,3 +1,3 @@
1
1
  module Proquint
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/proquint.gemspec CHANGED
@@ -9,6 +9,10 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["JJ Buckley"]
10
10
  spec.email = ["jj@bjjb.org"]
11
11
  spec.summary = %q{Readable, spellable, pronounceable identifiers}
12
+ spec.description = <<-DESC
13
+ A proquint is a readable, spellable, pronouncable identifier that can be
14
+ encoded back to a number. See http://arxiv.org/html/0901.4016.
15
+ DESC
12
16
  spec.homepage = "http://bjjb.github.io/proquint"
13
17
  spec.license = "MIT"
14
18
 
@@ -35,6 +35,10 @@ describe Proquint do
35
35
  Proquint.encode(0x1234567890abcdef).must_equal 'damuh-jinum-nafor-suloz'
36
36
  end
37
37
 
38
+ it "can encode strings" do
39
+ Proquint.encode("Hello").must_equal 'badam-badoj-bados-bados-badoz'
40
+ end
41
+
38
42
  it "can encode and decode IP addresses" do
39
43
  Proquint.encode("192.168.1.1").must_equal "safom-bahad"
40
44
  Proquint.decode("safom-bahad").must_equal [49320, 257]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proquint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JJ Buckley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-22 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,7 +52,9 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 5.4.3
55
- description:
55
+ description: |
56
+ A proquint is a readable, spellable, pronouncable identifier that can be
57
+ encoded back to a number. See http://arxiv.org/html/0901.4016.
56
58
  email:
57
59
  - jj@bjjb.org
58
60
  executables: []
@@ -60,6 +62,7 @@ extensions: []
60
62
  extra_rdoc_files: []
61
63
  files:
62
64
  - ".gitignore"
65
+ - ".travis.yml"
63
66
  - Gemfile
64
67
  - LICENSE.txt
65
68
  - README.md
@@ -89,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
92
  version: '0'
90
93
  requirements: []
91
94
  rubyforge_project:
92
- rubygems_version: 2.2.2
95
+ rubygems_version: 2.5.1
93
96
  signing_key:
94
97
  specification_version: 4
95
98
  summary: Readable, spellable, pronounceable identifiers