fdist 0.2.2 → 0.2.3

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/fdist.gemspec +2 -2
  4. data/lib/fdist.rb +18 -8
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b1742aa7764c4f14f9e9e42a6e11c5f1d13ce39
4
- data.tar.gz: b4e48e02e5646ee25ea48fff7fb16bdf4a2cc81c
3
+ metadata.gz: 0216707f5d39c93a960097368dda3934683b64f9
4
+ data.tar.gz: fcc0d6163da3c0a7251b48c77a7f9a24933a2d65
5
5
  SHA512:
6
- metadata.gz: 58cfe7cf332f2277ba1f52ca070ac895ca9976e2d2ff7c608afccc4a0e149e242be788394be6c5fc99b0e0ad17ac206ee68277ee8b868efa5893a916db355a88
7
- data.tar.gz: da9ff0d41b06dbd59c94022fdd3a171516b70f8a633bae55fb0f03d217f9da0f0c874642b323bae3d7cf8be99fbdab10d8e817e949d67e34c119a3ff45d53239
6
+ metadata.gz: d3b3d7db20cb8b0f6d616262512dcfa63aa2d928bac22a06a712f5d073e98f40946c1aad9b959a94c87963d5a16d0e484e92f96f5b8e7cfa2d33c6a0b4620b4f
7
+ data.tar.gz: bf5016df4f548ab6180b20df3ecc8e27ecef218ffa09406d6a14b76b6a4238189baac341110f3897cbb6d83d62a7f9a682023f56ff0f843032257e2240c2ef43
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
data/fdist.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fdist"
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["michael d. towle"]
12
- s.date = "2013-11-28"
12
+ s.date = "2013-11-29"
13
13
  s.description = "Array methods now include :freq and :fdist, the first of which returns a Rational, and the second of which returns a hash of expression => count pairs"
14
14
  s.email = "gametheoretic@gmail.com"
15
15
  s.extra_rdoc_files = [
data/lib/fdist.rb CHANGED
@@ -12,14 +12,26 @@ module Headers
12
12
 
13
13
  def headers= param_list
14
14
  if first.class != Hash
15
- map! do |val_set|
16
-
15
+ if first.class != String
16
+ map! do |val_set|
17
+
17
18
 
18
- hash = {}
19
- arrayify(val_set).each_with_index do |elem, idx|
20
- hash[param_list[idx += 1]] = elem
19
+ hash = {}
20
+ val_set.each_with_index do |elem, idx|
21
+ hash[param_list[idx += 1]] = elem
22
+ end
23
+ hash
24
+ end
25
+ else
26
+ map! do |val_set|
27
+
28
+
29
+ hash = {}
30
+ arrayify(val_set).each_with_index do |elem, idx|
31
+ hash[param_list[idx += 1]] = elem
32
+ end
33
+ hash
21
34
  end
22
- hash
23
35
  end
24
36
  end
25
37
  map! do |val_hash|
@@ -43,8 +55,6 @@ private
43
55
  thing.values
44
56
  rescue
45
57
  thing.strip.split ","
46
- rescue
47
- thing
48
58
  end
49
59
  end
50
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fdist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - michael d. towle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-28 00:00:00.000000000 Z
11
+ date: 2013-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler