polyglot 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/README.txt +1 -1
- data/config/hoe.rb +2 -2
- data/lib/polyglot.rb +14 -7
- data/lib/polyglot/version.rb +1 -1
- data/website/index.html +1 -1
- metadata +4 -4
data/History.txt
CHANGED
data/README.txt
CHANGED
data/config/hoe.rb
CHANGED
@@ -58,14 +58,14 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
58
58
|
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
59
59
|
|
60
60
|
# == Optional
|
61
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("
|
61
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
62
62
|
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
63
63
|
|
64
64
|
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
65
65
|
|
66
66
|
end
|
67
67
|
|
68
|
-
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("
|
68
|
+
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
|
69
69
|
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
70
70
|
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
71
71
|
hoe.rsync_args = '-av --delete --ignore-errors'
|
data/lib/polyglot.rb
CHANGED
@@ -2,6 +2,7 @@ $:.unshift File.dirname(__FILE__)
|
|
2
2
|
|
3
3
|
module Polyglot
|
4
4
|
@registrations ||= {} # Guard against reloading
|
5
|
+
@loaded ||= {}
|
5
6
|
|
6
7
|
def self.register(extension, klass)
|
7
8
|
extension = [extension] unless Enumerable === extension
|
@@ -22,21 +23,27 @@ module Polyglot
|
|
22
23
|
}
|
23
24
|
return nil
|
24
25
|
end
|
25
|
-
end
|
26
|
-
|
27
|
-
module Kernel
|
28
|
-
alias polyglot_original_require require
|
29
26
|
|
30
|
-
def
|
31
|
-
|
32
|
-
rescue LoadError => load_error
|
27
|
+
def self.load(*a, &b)
|
28
|
+
return if @loaded[a[0]] # Check for $: changes or file time changes and reload?
|
33
29
|
begin
|
34
30
|
source_file, loader = Polyglot.find(*a, &b)
|
35
31
|
if (loader)
|
36
32
|
loader.load(source_file)
|
33
|
+
@loaded[a[0]] = true
|
37
34
|
else
|
38
35
|
raise load_error
|
39
36
|
end
|
40
37
|
end
|
41
38
|
end
|
42
39
|
end
|
40
|
+
|
41
|
+
module Kernel
|
42
|
+
alias polyglot_original_require require
|
43
|
+
|
44
|
+
def require(*a, &b)
|
45
|
+
polyglot_original_require(*a, &b)
|
46
|
+
rescue LoadError => load_error
|
47
|
+
Polyglot.load(*a, &b)
|
48
|
+
end
|
49
|
+
end
|
data/lib/polyglot/version.rb
CHANGED
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>polyglot</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/polyglot"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/polyglot" class="numbers">0.
|
36
|
+
<a href="http://rubyforge.org/projects/polyglot" class="numbers">0.2.0</a>
|
37
37
|
</div>
|
38
38
|
<h2>Poly → many, glot → languages</h2>
|
39
39
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyglot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
platform:
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clifford Heath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2008-02-13 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements: []
|
74
74
|
|
75
75
|
rubyforge_project: polyglot
|
76
|
-
rubygems_version: 0.
|
76
|
+
rubygems_version: 1.0.1
|
77
77
|
signing_key:
|
78
78
|
specification_version: 2
|
79
79
|
summary: Allows custom language loaders for specified file extensions to be hooked into require
|