sane 0.19.1 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ require 'rubygems'
2
2
  require 'jeweler'
3
3
  Jeweler::Tasks.new do |s|
4
4
  s.name = %q{sane}
@@ -6,7 +6,6 @@ Jeweler::Tasks.new do |s|
6
6
  s.authors = ["Roger Pack"]
7
7
  s.description = s.summary = %q{Helpers for ruby core to make it easier to work with--things that are missing from core but should arguably be there}
8
8
  s.email = ["rogerdpack@gmail.com"]
9
- s.add_dependency("rdp-require_all")
10
- s.add_dependency 'os'
11
- s.add_dependency 'andand' # turns out to be pretty useful...
9
+ s.add_dependency 'os'
10
+ s.add_dependency 'andand' # turns out to be pretty useful...
12
11
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.19.1
1
+ 0.20.0
data/lib/sane.rb CHANGED
@@ -3,10 +3,11 @@
3
3
  # shouldn't need this next line
4
4
  # require 'rubygems' if RUBY_VERSION < '1.9' # for the other requires
5
5
 
6
- require 'require_all' # for require_rel
7
6
  require 'os'
8
7
  require 'andand'
9
- require_rel 'sane' # now require all files in sub directory
8
+ for file in Dir[File.dirname(__FILE__) + '/sane/*'] do
9
+ require file
10
+ end
10
11
 
11
12
  class Sane
12
13
  # helper for installing it locally on 1.8
@@ -15,7 +16,7 @@ class Sane
15
16
  # I hate 1.8
16
17
  def self.install_local!
17
18
  if RUBY_VERSION >= '1.9'
18
- raise 'you dont need to install local for 1.9!'
19
+ raise 'you dont need to install local for 1.9!'
19
20
  end
20
21
  require 'fileutils'
21
22
  require 'rbconfig'
@@ -0,0 +1,17 @@
1
+ unless Kernel.respond_to?(:require_relative, true)
2
+
3
+ module Kernel
4
+ module_function
5
+ def require_relative(relative_feature)
6
+ c = caller.first
7
+ e = c.rindex(/:\d+:in /)
8
+ file = $`
9
+ if /\A\((.*)\)/ =~ file # eval, etc.
10
+ raise LoadError, "require_relative is called in #{$1}"
11
+ end
12
+ absolute_feature = File.expand_path(File.join(File.dirname(file), relative_feature))
13
+ require absolute_feature
14
+ end
15
+ end
16
+
17
+ end
data/spec/spec.sane.rb CHANGED
@@ -121,5 +121,11 @@ describe Sane do
121
121
  it "should have an auto-loading pp method" do
122
122
  pp 1,2,3
123
123
  end
124
+
125
+ it "should have require_relative" do
126
+ FileUtils.touch 'go.rb'
127
+ require_relative 'go.rb'
128
+ FileUtils.rm 'go.rb'
129
+ end
124
130
 
125
131
  end
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.19.1
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Pack
@@ -12,16 +12,6 @@ cert_chain: []
12
12
  date: 2010-01-12 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: rdp-require_all
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
25
15
  - !ruby/object:Gem::Dependency
26
16
  name: os
27
17
  type: :runtime
@@ -75,6 +65,7 @@ files:
75
65
  - lib/sane/irb_startup_options.rb
76
66
  - lib/sane/pp.rb
77
67
  - lib/sane/pps.rb
68
+ - lib/sane/require_relative.rb
78
69
  - lib/sane/sane_random.rb
79
70
  - lib/sane/string_blank.rb
80
71
  - spec/spec.sane.rb