sane 0.17.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.17.1
1
+ 0.18.0
data/lib/sane/pps.rb ADDED
@@ -0,0 +1,14 @@
1
+ class Object
2
+ # a method that outputs several items on one line
3
+ # similar to using pp, this space separates the items passed in and writes them to one line
4
+ # sputs 1,2,3
5
+ # => 1 2 3
6
+ def pps *args
7
+ for arg in args
8
+ out = arg.to_s
9
+ print out
10
+ print " " if out[-1..-1] != " "
11
+ end
12
+ puts
13
+ end
14
+ end
@@ -58,19 +58,6 @@ class Object
58
58
  end
59
59
  end
60
60
 
61
- # a method that outputs several items on one line
62
- # similar to Java's println, but it adds spaces between items, ex:
63
- # sputs 1,2,3
64
- # => 1 2 3
65
- def sputs *args
66
- for arg in args
67
- out = arg.to_s
68
- print out
69
- print " " if out[-1..-1] != " "
70
- end
71
- puts
72
- end
73
-
74
61
  def singleton_class
75
62
  class << self; self; end
76
63
  end
data/spec/spec.sane.rb CHANGED
@@ -59,18 +59,15 @@ describe Sane do
59
59
 
60
60
  end
61
61
 
62
- it "should allow regexes to be added" do
63
- /a/ + /b/
64
- end
65
-
66
62
  # my first implementation of this was *awful* LOL
67
63
  # leave out for now
64
+ # just use enumerator.to_a
68
65
  # it "should allow for brackets on enumerators" do
69
66
  # require 'backports' # ugh
70
67
  # assert "ab\r\nc".lines[0] == "ab\r\n"
71
68
  # end
72
69
 
73
- it "should have good looking float#inspect" do
70
+ it "should have verbose looking float#inspect" do
74
71
  assert( (1.1 - 0.9).inspect.include? '0.2000000' ) # 0.20000000000000006661 or something close to it
75
72
  end
76
73
 
@@ -82,8 +79,8 @@ describe Sane do
82
79
  [1,2,3].ave.should == 2
83
80
  end
84
81
 
85
- it "should have an sputs method " do
86
- sputs 1,2,3
82
+ it "should have a pps method " do
83
+ pps 1,2,3
87
84
  end
88
85
 
89
86
  it "should allow for map_by" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Pack
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-06 00:00:00 -07:00
12
+ date: 2010-01-08 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -60,7 +60,6 @@ files:
60
60
  - VERSION
61
61
  - lib/_dbg.rb
62
62
  - lib/sane.rb
63
- - lib/sane/add_regexes.rb
64
63
  - lib/sane/array_ave.rb
65
64
  - lib/sane/array_blank.rb
66
65
  - lib/sane/array_contain.rb
@@ -74,6 +73,7 @@ files:
74
73
  - lib/sane/hash_hashes.rb
75
74
  - lib/sane/hash_minus_hash.rb
76
75
  - lib/sane/irb_startup_options.rb
76
+ - lib/sane/pps.rb
77
77
  - lib/sane/sane_random.rb
78
78
  - lib/sane/string_blank.rb
79
79
  - spec/spec.sane.rb
@@ -1,13 +0,0 @@
1
- class Regexp
2
- def +(other)
3
- if other.is_a?(Regexp)
4
- if self.options == other.options
5
- Regexp.new(source + other.source, options)
6
- else
7
- Regexp.new(source + other.to_s, options)
8
- end
9
- else
10
- Regexp.new(source + Regexp.escape(other.to_s), options)
11
- end
12
- end
13
- end