sugar-high 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ begin
9
9
  gem.authors = ["Kristian Mandrup"]
10
10
  gem.add_development_dependency "rspec", "~> 2.0.0.beta.22"
11
11
 
12
- gem.add_dependency "require_all", "~> 1.1.0"
12
+ gem.add_dependency "require_all", "~> 1.2.0"
13
13
  gem.add_dependency "mocha", "~> 0.9.8"
14
14
  end
15
15
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.10
1
+ 0.2.11
@@ -10,4 +10,16 @@ class Array
10
10
  def to_strings option=nil
11
11
  self.flatten.select_labels.map(&:to_s)
12
12
  end
13
- end
13
+
14
+ def none?
15
+ self.flatten.compact.empty?
16
+ end
17
+ end
18
+
19
+ class NilClass
20
+ def none?
21
+ true
22
+ end
23
+ end
24
+
25
+
@@ -30,6 +30,7 @@ describe "SugarHigh" do
30
30
 
31
31
  it "should return the :hello => 'abe' " do
32
32
  last_arg({:hi => :def}, 3,4, :hi => 'abe').should == {:hi => 'abe'}
33
+ last_arg({:hi => :def}, [3,4, :hi => 'abe']).should == {:hi => 'abe'}
33
34
  end
34
35
  end
35
36
  end
@@ -38,6 +39,7 @@ describe "SugarHigh" do
38
39
  context 'Last arg with default hello' do
39
40
  it "should return the arg value 'abe' " do
40
41
  last_arg_value({:hi => :def}, 3,4, :hi => 'abe').should == 'abe'
42
+ last_arg_value({:hi => :def}, [3,4, :hi => 'abe']).should == 'abe'
41
43
  end
42
44
 
43
45
  it "should return the arg value :def " do
@@ -16,5 +16,18 @@ describe "SugarHigh" do
16
16
  [['blip', [3, :hello]]].to_strings.should == ['blip', 'hello']
17
17
  end
18
18
  end
19
+
20
+ describe '#to_strings' do
21
+ it "should translate nested array of numbers and strings into symbols only array, excluding numbers" do
22
+ [1, 'blip', [3, "hello"]].to_strings.should == ['blip', 'hello']
23
+ end
24
+ end
25
+
26
+ describe '#none?' do
27
+ it "should be none if no real values in array" do
28
+ [nil, nil].none?.should be_true
29
+ nil.none?.should be_true
30
+ end
31
+ end
19
32
  end
20
33
  end
data/sugar-high.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sugar-high}
8
- s.version = "0.2.10"
8
+ s.version = "0.2.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = %q{2010-09-17}
12
+ s.date = %q{2010-09-23}
13
13
  s.description = %q{More Ruby sugar - inspired by the 'zuker' project}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -87,16 +87,16 @@ Gem::Specification.new do |s|
87
87
 
88
88
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
89
89
  s.add_development_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
90
- s.add_runtime_dependency(%q<require_all>, ["~> 1.1.0"])
90
+ s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
91
91
  s.add_runtime_dependency(%q<mocha>, ["~> 0.9.8"])
92
92
  else
93
93
  s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
94
- s.add_dependency(%q<require_all>, ["~> 1.1.0"])
94
+ s.add_dependency(%q<require_all>, ["~> 1.2.0"])
95
95
  s.add_dependency(%q<mocha>, ["~> 0.9.8"])
96
96
  end
97
97
  else
98
98
  s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
99
- s.add_dependency(%q<require_all>, ["~> 1.1.0"])
99
+ s.add_dependency(%q<require_all>, ["~> 1.2.0"])
100
100
  s.add_dependency(%q<mocha>, ["~> 0.9.8"])
101
101
  end
102
102
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 10
9
- version: 0.2.10
8
+ - 11
9
+ version: 0.2.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-17 00:00:00 +02:00
17
+ date: 2010-09-23 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -44,9 +44,9 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  segments:
46
46
  - 1
47
- - 1
47
+ - 2
48
48
  - 0
49
- version: 1.1.0
49
+ version: 1.2.0
50
50
  type: :runtime
51
51
  version_requirements: *id002
52
52
  - !ruby/object:Gem::Dependency