sane 0.25.4 → 0.25.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -0
- data/Rakefile +6 -4
- data/TODO +3 -1
- data/VERSION +1 -1
- data/lib/sane/try2.rb +27 -0
- data/spec/spec.sane.rb +11 -4
- data/todo +3 -0
- metadata +48 -21
data/ChangeLog
CHANGED
data/Rakefile
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
2
|
+
require 'jeweler2'
|
3
3
|
Jeweler::Tasks.new do |s|
|
4
4
|
s.name = %q{sane}
|
5
|
-
s.homepage = 'http://github.com/rogerdpack/
|
5
|
+
s.homepage = 'http://github.com/rogerdpack/sane'
|
6
6
|
s.authors = ["Roger Pack"]
|
7
|
-
s.description = s.summary = %q{Helpers for ruby core to make
|
7
|
+
s.description = s.summary = %q{Helpers for ruby core classes to make life easier-i.e. things that are missing from core but should be there <sigh>}
|
8
8
|
s.email = ["rogerdpack@gmail.com"]
|
9
|
-
s.add_dependency 'os'
|
9
|
+
s.add_dependency 'os' # *necessary*
|
10
10
|
#s.add_dependency 'andand' # turns out to be pretty useful...
|
11
11
|
end
|
12
|
+
|
13
|
+
Jeweler::RubygemsDotOrgTasks.new
|
data/TODO
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.25.
|
1
|
+
0.25.5
|
data/lib/sane/try2.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
class Object
|
2
|
+
def try2
|
3
|
+
self
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
if RUBY_VERSION < '1.9.0'
|
8
|
+
class NilClass
|
9
|
+
def try2
|
10
|
+
obj = Object.new # basic object?
|
11
|
+
def obj.method_missing(*)
|
12
|
+
nil
|
13
|
+
end
|
14
|
+
obj
|
15
|
+
end
|
16
|
+
end
|
17
|
+
else
|
18
|
+
class NilClass
|
19
|
+
def try2
|
20
|
+
obj = BasicObject.new
|
21
|
+
def obj.method_missing(*)
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
obj
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/spec/spec.sane.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
raise 'must be in spec dir' unless File.basename(Dir.pwd) == 'spec'
|
1
2
|
$:.unshift File.expand_path('../lib')
|
2
3
|
require 'rubygems'
|
3
4
|
require File.dirname(__FILE__) + '/../lib/sane.rb'
|
@@ -204,9 +205,15 @@ describe Sane do
|
|
204
205
|
|
205
206
|
it 'should have String#last' do
|
206
207
|
'abc'.last(2).should == 'bc'
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
208
|
+
'abc'.last(3).should == 'abc'
|
209
|
+
'abc'.last(1).should == 'c'
|
210
|
+
'abc'.last(0).should == '' # this is feeling weird now...
|
211
|
+
'abc'.last(44).should == 'abc'
|
212
|
+
end
|
213
|
+
|
214
|
+
it "should have a try2 method" do
|
215
|
+
'a'.try2.gsub(/a/, 'b').should == 'b'
|
216
|
+
nil.try2.gsub(/a/, 'b').should == nil
|
217
|
+
proc { false.try2.gsub(/a/, 'b')}.should raise_exception(NoMethodError) # why would you want try on false? huh?
|
211
218
|
end
|
212
219
|
end
|
data/todo
ADDED
metadata
CHANGED
@@ -1,29 +1,53 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 0.25.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Roger Pack
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: os
|
16
|
-
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: !binary |-
|
21
|
+
MA==
|
17
22
|
none: false
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
18
24
|
requirements:
|
19
25
|
- - ! '>='
|
20
26
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
27
|
+
version: !binary |-
|
28
|
+
MA==
|
29
|
+
none: false
|
30
|
+
prerelease: false
|
22
31
|
type: :runtime
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: os
|
34
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: !binary |-
|
39
|
+
MA==
|
40
|
+
none: false
|
41
|
+
requirement: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: !binary |-
|
46
|
+
MA==
|
47
|
+
none: false
|
23
48
|
prerelease: false
|
24
|
-
|
25
|
-
description: Helpers for ruby core to make
|
26
|
-
missing from core but should arguably be there
|
49
|
+
type: :runtime
|
50
|
+
description: Helpers for ruby core classes to make life easier-i.e. things that are missing from core but should be there <sigh>
|
27
51
|
email:
|
28
52
|
- rogerdpack@gmail.com
|
29
53
|
executables: []
|
@@ -36,7 +60,6 @@ files:
|
|
36
60
|
- ChangeLog
|
37
61
|
- README
|
38
62
|
- Rakefile
|
39
|
-
- TODO
|
40
63
|
- VERSION
|
41
64
|
- lib/_dbg.rb
|
42
65
|
- lib/sane.rb
|
@@ -67,6 +90,7 @@ files:
|
|
67
90
|
- lib/sane/test.rb
|
68
91
|
- lib/sane/test/assertions.rb
|
69
92
|
- lib/sane/thread.rb
|
93
|
+
- lib/sane/try2.rb
|
70
94
|
- spec/files/pp_after.rb
|
71
95
|
- spec/files/pp_before_hand.rb
|
72
96
|
- spec/files/test.rb
|
@@ -75,29 +99,32 @@ files:
|
|
75
99
|
- spec/spec.sane.rb
|
76
100
|
- spec/subdir/go.rb
|
77
101
|
- spec/subdir2/require_relative2.rb
|
78
|
-
|
102
|
+
- todo
|
103
|
+
- TODO
|
104
|
+
homepage: http://github.com/rogerdpack/sane
|
79
105
|
licenses: []
|
80
|
-
post_install_message:
|
106
|
+
post_install_message:
|
81
107
|
rdoc_options: []
|
82
108
|
require_paths:
|
83
109
|
- lib
|
84
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
111
|
requirements:
|
87
112
|
- - ! '>='
|
88
113
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
90
|
-
|
114
|
+
version: !binary |-
|
115
|
+
MA==
|
91
116
|
none: false
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
118
|
requirements:
|
93
119
|
- - ! '>='
|
94
120
|
- !ruby/object:Gem::Version
|
95
|
-
version:
|
121
|
+
version: !binary |-
|
122
|
+
MA==
|
123
|
+
none: false
|
96
124
|
requirements: []
|
97
|
-
rubyforge_project:
|
98
|
-
rubygems_version: 1.8.
|
99
|
-
signing_key:
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 1.8.24
|
127
|
+
signing_key:
|
100
128
|
specification_version: 3
|
101
|
-
summary: Helpers for ruby core to make
|
102
|
-
from core but should arguably be there
|
129
|
+
summary: Helpers for ruby core classes to make life easier-i.e. things that are missing from core but should be there <sigh>
|
103
130
|
test_files: []
|