huff 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: 24913de693b67cb7069ef79267aea33cc91b0d7a
4
- data.tar.gz: 1b3e99c1680f1f376112b2e300c2c5cc4b11e1ad
3
+ metadata.gz: f35b96f6ac27f8770f4a6dd4ab7306207a4e1e88
4
+ data.tar.gz: bdba8b05c1dd9f97eacca5e395d62ab2588e7351
5
5
  SHA512:
6
- metadata.gz: c959197d176dcf317fd58e1c65ef5faffcbf781d14ab3818d17ad597e5c3d3ae6dc2352f308fa111b57a58e10b55394eca5b4800aefdae74c88c60b596e59ddf
7
- data.tar.gz: 0c7befa2954eba0d02df1ecc68ffeb50f1531d82bd2017b5491f757bc4620c2f4505ebd542ef4c631a7975b961913fcf6dcfab4fb0ebd0c5698caf53ceb1124c
6
+ metadata.gz: d8c7fcb62bd557c3393a9c5e3c0cb862c9893aac5bfee40f300ab930affb2dedfb76f1152fd78a2d5090bf6de816d9766a7bcc1ba7c6470b6da89d8964cfbc99
7
+ data.tar.gz: 5280644cfda6d487069bbb7397b878e1b984f3e54318d0e73e0e1cfe64ff3a871c533d46c2919cba066a2fed84076072a65c9e69c883e71cd854f1cb0484cdb2
@@ -2,6 +2,9 @@
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="96567430-0205-40d6-9c2f-e203dffc5504" name="Default" comment="">
5
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/lib/huff/decoder_spec.rb" afterPath="$PROJECT_DIR$/spec/lib/huff/decoder_spec.rb" />
6
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/huff/encoder.rb" afterPath="$PROJECT_DIR$/lib/huff/encoder.rb" />
7
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/lib/huff/encoder_spec.rb" afterPath="$PROJECT_DIR$/spec/lib/huff/encoder_spec.rb" />
5
8
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/huff.gemspec" afterPath="$PROJECT_DIR$/huff.gemspec" />
6
9
  </list>
7
10
  <ignored path="huff.iws" />
@@ -24,31 +27,31 @@
24
27
  </component>
25
28
  <component name="FileEditorManager">
26
29
  <leaf>
27
- <file leaf-file-name="encoding_tree_builder.rb" pinned="false" current="false" current-in-tab="false">
28
- <entry file="file://$PROJECT_DIR$/lib/huff/encoding_tree_builder.rb">
30
+ <file leaf-file-name="encoder_spec.rb" pinned="false" current="false" current-in-tab="false">
31
+ <entry file="file://$PROJECT_DIR$/spec/lib/huff/encoder_spec.rb">
29
32
  <provider selected="true" editor-type-id="text-editor">
30
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="900">
31
- <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
33
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="468">
34
+ <caret line="3" column="11" selection-start-line="3" selection-start-column="11" selection-end-line="3" selection-end-column="11" />
32
35
  <folding />
33
36
  </state>
34
37
  </provider>
35
38
  </entry>
36
39
  </file>
37
- <file leaf-file-name="version.rb" pinned="false" current="false" current-in-tab="false">
38
- <entry file="file://$PROJECT_DIR$/lib/huff/version.rb">
40
+ <file leaf-file-name="encoder.rb" pinned="false" current="false" current-in-tab="false">
41
+ <entry file="file://$PROJECT_DIR$/lib/huff/encoder.rb">
39
42
  <provider selected="true" editor-type-id="text-editor">
40
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="162">
41
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
43
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="396">
44
+ <caret line="13" column="42" selection-start-line="13" selection-start-column="42" selection-end-line="13" selection-end-column="42" />
42
45
  <folding />
43
46
  </state>
44
47
  </provider>
45
48
  </entry>
46
49
  </file>
47
- <file leaf-file-name="huff.gemspec" pinned="false" current="true" current-in-tab="true">
48
- <entry file="file://$PROJECT_DIR$/huff.gemspec">
50
+ <file leaf-file-name="decoder_spec.rb" pinned="false" current="true" current-in-tab="true">
51
+ <entry file="file://$PROJECT_DIR$/spec/lib/huff/decoder_spec.rb">
49
52
  <provider selected="true" editor-type-id="text-editor">
50
- <state vertical-scroll-proportion="0.23718888" vertical-offset="0" max-vertical-offset="683">
51
- <caret line="9" column="55" selection-start-line="9" selection-start-column="52" selection-end-line="9" selection-end-column="52" />
53
+ <state vertical-scroll-proportion="0.51724136" vertical-offset="0" max-vertical-offset="696">
54
+ <caret line="20" column="39" selection-start-line="20" selection-start-column="39" selection-end-line="20" selection-end-column="39" />
52
55
  <folding />
53
56
  </state>
54
57
  </provider>
@@ -74,13 +77,13 @@
74
77
  <option value="$PROJECT_DIR$/lib/huff/encoding_tree_builder.rb" />
75
78
  <option value="$PROJECT_DIR$/lib/huff/encoding_table_builder.rb" />
76
79
  <option value="$PROJECT_DIR$/spec/lib/huff/encoding_table_builder_spec.rb" />
77
- <option value="$PROJECT_DIR$/lib/huff/encoder.rb" />
78
- <option value="$PROJECT_DIR$/spec/lib/huff/encoder_spec.rb" />
79
80
  <option value="$PROJECT_DIR$/lib/huff/decoder.rb" />
80
- <option value="$PROJECT_DIR$/spec/lib/huff/decoder_spec.rb" />
81
81
  <option value="$PROJECT_DIR$/lib/huff/frequency_meter.rb" />
82
82
  <option value="$PROJECT_DIR$/lib/huff.rb" />
83
83
  <option value="$PROJECT_DIR$/huff.gemspec" />
84
+ <option value="$PROJECT_DIR$/spec/lib/huff/encoder_spec.rb" />
85
+ <option value="$PROJECT_DIR$/lib/huff/encoder.rb" />
86
+ <option value="$PROJECT_DIR$/spec/lib/huff/decoder_spec.rb" />
84
87
  </list>
85
88
  </option>
86
89
  </component>
@@ -368,30 +371,6 @@
368
371
  </state>
369
372
  </provider>
370
373
  </entry>
371
- <entry file="file://$PROJECT_DIR$/spec/lib/huff/encoding_tree_builder_spec.rb">
372
- <provider selected="true" editor-type-id="text-editor">
373
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="666">
374
- <caret line="29" column="58" selection-start-line="26" selection-start-column="42" selection-end-line="29" selection-end-column="58" />
375
- <folding />
376
- </state>
377
- </provider>
378
- </entry>
379
- <entry file="file://$PROJECT_DIR$/spec/lib/huff/encoder_spec.rb">
380
- <provider selected="true" editor-type-id="text-editor">
381
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="468">
382
- <caret line="18" column="66" selection-start-line="18" selection-start-column="57" selection-end-line="18" selection-end-column="66" />
383
- <folding />
384
- </state>
385
- </provider>
386
- </entry>
387
- <entry file="file://$PROJECT_DIR$/spec/lib/huff/decoder_spec.rb">
388
- <provider selected="true" editor-type-id="text-editor">
389
- <state vertical-scroll-proportion="0.07906296" vertical-offset="0" max-vertical-offset="683">
390
- <caret line="3" column="17" selection-start-line="3" selection-start-column="17" selection-end-line="3" selection-end-column="17" />
391
- <folding />
392
- </state>
393
- </provider>
394
- </entry>
395
374
  <entry file="file://$PROJECT_DIR$/spec/lib/huff/encoding_table_builder_spec.rb">
396
375
  <provider selected="true" editor-type-id="text-editor">
397
376
  <state vertical-scroll-proportion="0.23718888" vertical-offset="0" max-vertical-offset="683">
@@ -424,14 +403,6 @@
424
403
  </state>
425
404
  </provider>
426
405
  </entry>
427
- <entry file="file://$PROJECT_DIR$/lib/huff/encoder.rb">
428
- <provider selected="true" editor-type-id="text-editor">
429
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="396">
430
- <caret line="11" column="38" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
431
- <folding />
432
- </state>
433
- </provider>
434
- </entry>
435
406
  <entry file="file://$PROJECT_DIR$/lib/huff/decoder.rb">
436
407
  <provider selected="true" editor-type-id="text-editor">
437
408
  <state vertical-scroll-proportion="0.38793105" vertical-offset="0" max-vertical-offset="738">
@@ -448,10 +419,10 @@
448
419
  </state>
449
420
  </provider>
450
421
  </entry>
451
- <entry file="file://$PROJECT_DIR$/lib/huff/encoding_tree_builder.rb">
422
+ <entry file="file://$PROJECT_DIR$/huff.gemspec">
452
423
  <provider selected="true" editor-type-id="text-editor">
453
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="900">
454
- <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
424
+ <state vertical-scroll-proportion="0.23718888" vertical-offset="0" max-vertical-offset="683">
425
+ <caret line="9" column="55" selection-start-line="9" selection-start-column="52" selection-end-line="9" selection-end-column="52" />
455
426
  <folding />
456
427
  </state>
457
428
  </provider>
@@ -464,10 +435,42 @@
464
435
  </state>
465
436
  </provider>
466
437
  </entry>
467
- <entry file="file://$PROJECT_DIR$/huff.gemspec">
438
+ <entry file="file://$PROJECT_DIR$/lib/huff/encoding_tree_builder.rb">
468
439
  <provider selected="true" editor-type-id="text-editor">
469
- <state vertical-scroll-proportion="0.23718888" vertical-offset="0" max-vertical-offset="683">
470
- <caret line="9" column="55" selection-start-line="9" selection-start-column="52" selection-end-line="9" selection-end-column="52" />
440
+ <state vertical-scroll-proportion="0.10344828" vertical-offset="0" max-vertical-offset="900">
441
+ <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
442
+ <folding />
443
+ </state>
444
+ </provider>
445
+ </entry>
446
+ <entry file="file://$PROJECT_DIR$/spec/lib/huff/encoding_tree_builder_spec.rb">
447
+ <provider selected="true" editor-type-id="text-editor">
448
+ <state vertical-scroll-proportion="0.75" vertical-offset="0" max-vertical-offset="696">
449
+ <caret line="29" column="58" selection-start-line="26" selection-start-column="42" selection-end-line="29" selection-end-column="58" />
450
+ <folding />
451
+ </state>
452
+ </provider>
453
+ </entry>
454
+ <entry file="file://$PROJECT_DIR$/spec/lib/huff/encoder_spec.rb">
455
+ <provider selected="true" editor-type-id="text-editor">
456
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="468">
457
+ <caret line="3" column="11" selection-start-line="3" selection-start-column="11" selection-end-line="3" selection-end-column="11" />
458
+ <folding />
459
+ </state>
460
+ </provider>
461
+ </entry>
462
+ <entry file="file://$PROJECT_DIR$/lib/huff/encoder.rb">
463
+ <provider selected="true" editor-type-id="text-editor">
464
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="396">
465
+ <caret line="13" column="42" selection-start-line="13" selection-start-column="42" selection-end-line="13" selection-end-column="42" />
466
+ <folding />
467
+ </state>
468
+ </provider>
469
+ </entry>
470
+ <entry file="file://$PROJECT_DIR$/spec/lib/huff/decoder_spec.rb">
471
+ <provider selected="true" editor-type-id="text-editor">
472
+ <state vertical-scroll-proportion="0.51724136" vertical-offset="0" max-vertical-offset="696">
473
+ <caret line="20" column="39" selection-start-line="20" selection-start-column="39" selection-end-line="20" selection-end-column="39" />
471
474
  <folding />
472
475
  </state>
473
476
  </provider>
@@ -11,7 +11,7 @@ module Huff
11
11
  end
12
12
 
13
13
  def encode_36(text)
14
- encode_string(text).to_i(2).to_s(36).upcase
14
+ encode_string(text).to_i(2).to_s(36)
15
15
  end
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module Huff
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -6,7 +6,7 @@ describe Decoder do
6
6
  encoding_tree = ['c', ['b', 'a']]
7
7
  subject = Decoder.new(encoding_tree)
8
8
  expect(subject.decode_string('11100')).to eq 'abc'
9
- expect(subject.decode_36('S')).to eq 'abc'
9
+ expect(subject.decode_36('s')).to eq 'abc'
10
10
  end
11
11
 
12
12
  it 'decodes a more complex string' do
@@ -16,6 +16,8 @@ describe Decoder do
16
16
  ['m', 'v']]]]
17
17
  subject = Decoder.new(encoding_tree)
18
18
  expect(subject.decode_string('1110000101000101001010011011000011111100100')).to eq 'mississipi river'
19
- expect(subject.decode_36('2QRT5J4RO')).to eq 'mississipi river'
19
+ # Decoding is case insensitive
20
+ expect(subject.decode_36('2QrT5J4ro')).to eq 'mississipi river'
21
+ expect(subject.decode_36('2qRt5j4RO')).to eq 'mississipi river'
20
22
  end
21
23
  end
@@ -6,7 +6,7 @@ describe Encoder do
6
6
  encoding_tree = ['c', ['b', 'a']]
7
7
  subject = Encoder.new(encoding_tree)
8
8
  expect(subject.encode_string('abc')).to eq '11100'
9
- expect(subject.encode_36('abc')).to eq 'S'
9
+ expect(subject.encode_36('abc')).to eq 's'
10
10
  end
11
11
 
12
12
  it 'encode a more complex string' do
@@ -16,6 +16,6 @@ describe Encoder do
16
16
  ['m', 'v']]]]
17
17
  subject = Encoder.new(encoding_tree)
18
18
  expect(subject.encode_string('mississipi river')).to eq '1110000101000101001010011011000011111100100'
19
- expect(subject.encode_36('mississipi river')).to eq '2QRT5J4RO'
19
+ expect(subject.encode_36('mississipi river')).to eq '2qrt5j4ro'
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: huff
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
  - Ronie Uliana