sarah 0.0.3 → 0.0.4

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.
data/HISTORY.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 2013-07-28 Version 0.0.4
2
+ Fixed a bug in the insert! method.
3
+
1
4
  2013-07-13 Version 0.0.3
2
5
  Added << alias for push.
3
6
 
data/lib/sarah.rb CHANGED
@@ -228,7 +228,7 @@ class Sarah
228
228
  def insert! (*ahlist)
229
229
  ahlist.reverse_each do |ah|
230
230
  if ah.respond_to? :seq_values and ah.respond_to? :rnd
231
- unshift @ah.seq_values
231
+ unshift *ah.seq_values
232
232
  merge! ah.rnd
233
233
  elsif ah.respond_to? :each_pair
234
234
  merge! ah
data/sarah.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sarah"
3
- s.version = "0.0.3"
4
- s.date = "2013-07-13"
3
+ s.version = "0.0.4"
4
+ s.date = "2013-07-28"
5
5
  s.authors = ["Brian Katzung"]
6
6
  s.email = ["briank@kappacs.com"]
7
7
  s.homepage = "http://rubygems.org/gems/sarah"
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.license = "MIT"
11
11
 
12
12
  s.files = Dir.glob("lib/**/*") +
13
- %w{sarah.gemspec HISTORY.txt .yardopts}
13
+ %w{sarah.gemspec HISTORY.txt .yardopts}
14
14
  s.test_files = Dir.glob("test/**/*.rb")
15
15
  s.require_path = 'lib'
16
16
  end
data/test/04stack.rb CHANGED
@@ -27,6 +27,14 @@ class TestSarah_04 < MiniTest::Unit::TestCase
27
27
  assert_equal({ :one => 1, :two => 2 }, s.rnd, "append hsh")
28
28
  end
29
29
 
30
+ def test_append_sarah
31
+ s1 = Sarah.new :array => [1, 2], :hash => { :three => 3 }
32
+ s2 = Sarah.new :array => [4, 5], :hash => { :six => 6 }
33
+ s1.append! s2
34
+ assert_equal([1, 2, 4, 5], s1.seq, "append sarah (array)")
35
+ assert_equal({ :three => 3, :six => 6 }, s1.rnd, "append sarah (hash)")
36
+ end
37
+
30
38
  def test_insert
31
39
  s = Sarah.new
32
40
  s.insert! [1], { :one => 1 }, [2], [3]
@@ -35,6 +43,14 @@ class TestSarah_04 < MiniTest::Unit::TestCase
35
43
  assert_equal({ :one => 1, :two => 2 }, s.rnd, "insert hsh")
36
44
  end
37
45
 
46
+ def test_insert_sarah
47
+ s1 = Sarah.new :array => [1, 2], :hash => { :three => 3 }
48
+ s2 = Sarah.new :array => [4, 5], :hash => { :six => 6 }
49
+ s1.insert! s2
50
+ assert_equal([4, 5, 1, 2], s1.seq, "insert sarah (array)")
51
+ assert_equal({ :three => 3, :six => 6 }, s1.rnd, "insert sarah (hash)")
52
+ end
53
+
38
54
  end
39
55
 
40
56
  # END
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Brian Katzung
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2013-07-13 00:00:00 -05:00
17
+ date: 2013-07-28 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies: []
20
20