sugar-high 0.4.9.3 → 0.4.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +3 -0
- data/VERSION +1 -1
- data/lib/sugar-high/class_ext.rb +2 -1
- data/spec/autoload_blank_root/hello.rb +6 -0
- data/spec/autoload_blank_root.rb +3 -0
- data/spec/sugar-high/class_ext_spec.rb +15 -8
- data/sugar-high.gemspec +4 -2
- metadata +10 -8
data/README.markdown
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.9.
|
1
|
+
0.4.9.5
|
data/lib/sugar-high/class_ext.rb
CHANGED
@@ -16,7 +16,8 @@ class Module
|
|
16
16
|
|
17
17
|
options = args.extract_options!
|
18
18
|
root = options[:root] || AutoLoader.root || ''
|
19
|
-
|
19
|
+
path = root.strip.empty? ? self.name.to_s.underscore : [root, self.name.to_s.underscore].join('/')
|
20
|
+
from = options[:from] || path
|
20
21
|
|
21
22
|
# Here also could be adding of the file in top of load_paths like: $:.unshift File.dirname(__FILE__)
|
22
23
|
# It is very useful for situations of having not load_paths built Rails or Gems way.
|
@@ -56,19 +56,26 @@ describe Module do
|
|
56
56
|
require 'fixtures/autoload_modules'
|
57
57
|
AutoloadModules::Third.should respond_to(:test)
|
58
58
|
end
|
59
|
-
|
60
|
-
it 'should autoload modules using ClassExt#autoload_root' do
|
61
|
-
AutoLoader.root = 'fixtures'
|
62
|
-
require 'fixtures/autoload_modules_root'
|
63
|
-
AutoloadModulesRoot::Third.should respond_to(:test)
|
64
|
-
end
|
65
|
-
|
59
|
+
|
66
60
|
it "should autoload modules from __FILE__'s dir if :from is omitted'" do
|
67
61
|
require 'fixtures/autoload_modulez'
|
68
62
|
AutoloadModulez::ThirdOneHere.should respond_to(:test)
|
69
63
|
end
|
64
|
+
|
65
|
+
context 'using AutoLoader.root' do
|
66
|
+
it 'empty root' do
|
67
|
+
AutoLoader.root = ''
|
68
|
+
require 'autoload_blank_root'
|
69
|
+
AutoloadBlankRoot::Hello.should respond_to(:test)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'should autoload modules using ClassExt#autoload_root' do
|
73
|
+
AutoLoader.root = 'fixtures'
|
74
|
+
require 'fixtures/autoload_modules_root'
|
75
|
+
AutoloadModulesRoot::Third.should respond_to(:test)
|
76
|
+
end
|
77
|
+
end
|
70
78
|
end
|
71
|
-
|
72
79
|
end
|
73
80
|
|
74
81
|
describe ClassExt do
|
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.4.9.
|
8
|
+
s.version = "0.4.9.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Kristian Mandrup}]
|
12
|
-
s.date = %q{2011-06-
|
12
|
+
s.date = %q{2011-06-30}
|
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 = [
|
@@ -58,6 +58,8 @@ Gem::Specification.new do |s|
|
|
58
58
|
"lib/sugar-high/rspec/matchers/have_aliases.rb",
|
59
59
|
"lib/sugar-high/string.rb",
|
60
60
|
"sandbox/test_routes_mutate.rb",
|
61
|
+
"spec/autoload_blank_root.rb",
|
62
|
+
"spec/autoload_blank_root/hello.rb",
|
61
63
|
"spec/fixtures/application_file.rb",
|
62
64
|
"spec/fixtures/autoload_modules.rb",
|
63
65
|
"spec/fixtures/autoload_modules/subdir/first.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugar-high
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.9.
|
4
|
+
version: 0.4.9.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-06-
|
12
|
+
date: 2011-06-30 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2161649020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2161649020
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: active_support
|
27
|
-
requirement: &
|
27
|
+
requirement: &2161648440 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2161648440
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &2161647840 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '2.5'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2161647840
|
47
47
|
description: More Ruby sugar - inspired by the 'zuker' project
|
48
48
|
email: kmandrup@gmail.com
|
49
49
|
executables: []
|
@@ -93,6 +93,8 @@ files:
|
|
93
93
|
- lib/sugar-high/rspec/matchers/have_aliases.rb
|
94
94
|
- lib/sugar-high/string.rb
|
95
95
|
- sandbox/test_routes_mutate.rb
|
96
|
+
- spec/autoload_blank_root.rb
|
97
|
+
- spec/autoload_blank_root/hello.rb
|
96
98
|
- spec/fixtures/application_file.rb
|
97
99
|
- spec/fixtures/autoload_modules.rb
|
98
100
|
- spec/fixtures/autoload_modules/subdir/first.rb
|