real_include 0.1.0-i386-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/README.markdown +36 -0
- data/Rakefile +37 -0
- data/lib/real_include.rb +14 -0
- data/lib/real_include.so +0 -0
- data/lib/real_include/version.rb +3 -0
- metadata +69 -0
data/CHANGELOG
ADDED
data/README.markdown
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
Real Include
|
2
|
+
--------------
|
3
|
+
|
4
|
+
(c) John Mair (banisterfiend)
|
5
|
+
MIT license
|
6
|
+
|
7
|
+
** Currently only Ruby 1.9 only **
|
8
|
+
|
9
|
+
Removes the shackles from Module#include - use Module#real_include to
|
10
|
+
bring in singleton classes from modules. No more ugly ClassMethods and
|
11
|
+
included() hook hacks.
|
12
|
+
|
13
|
+
example:
|
14
|
+
|
15
|
+
module M
|
16
|
+
# class method
|
17
|
+
def self.hello
|
18
|
+
puts "hello!"
|
19
|
+
end
|
20
|
+
|
21
|
+
# instance method
|
22
|
+
def bye
|
23
|
+
puts "bye!"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class A
|
28
|
+
real_include M
|
29
|
+
end
|
30
|
+
|
31
|
+
# invoke class method
|
32
|
+
A.hello #=> hello!
|
33
|
+
|
34
|
+
# invoke instance method
|
35
|
+
A.new.bye #=> bye!
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
$LOAD_PATH.unshift File.join(File.expand_path(__FILE__), '..')
|
2
|
+
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/gempackagetask'
|
5
|
+
|
6
|
+
# get the texplay version
|
7
|
+
require 'lib/real_include/version'
|
8
|
+
|
9
|
+
$dlext = Config::CONFIG['DLEXT']
|
10
|
+
|
11
|
+
CLEAN.include("ext/**/*.#{$dlext}", "ext/**/*.log", "ext/**/*.o", "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "ext/**/*.def", "ext/**/*.pdb")
|
12
|
+
CLOBBER.include("**/*.#{$dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
|
13
|
+
|
14
|
+
specification = Gem::Specification.new do |s|
|
15
|
+
s.name = "real_include"
|
16
|
+
s.summary = "Fixing the limitation in traditional Module#include"
|
17
|
+
s.version = RealInclude::VERSION
|
18
|
+
s.date = Time.now.strftime '%Y-%m-%d'
|
19
|
+
s.author = "John Mair (banisterfiend)"
|
20
|
+
s.email = 'jrmair@gmail.com'
|
21
|
+
s.description = s.summary
|
22
|
+
s.require_path = 'lib'
|
23
|
+
#s.platform = Gem::Platform::RUBY
|
24
|
+
s.platform = 'i386-mingw32'
|
25
|
+
s.homepage = "http://banisterfiend.wordpress.com"
|
26
|
+
s.has_rdoc = false
|
27
|
+
|
28
|
+
# s.extensions = ["ext/real_include/extconf.rb"]
|
29
|
+
s.files = ["Rakefile", "README.markdown", "CHANGELOG",
|
30
|
+
"lib/real_include.rb", "lib/real_include/version.rb", "lib/real_include.so"]
|
31
|
+
FileList["ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c"].to_a
|
32
|
+
end
|
33
|
+
|
34
|
+
Rake::GemPackageTask.new(specification) do |package|
|
35
|
+
package.need_zip = false
|
36
|
+
package.need_tar = false
|
37
|
+
end
|
data/lib/real_include.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# bring in user-defined extensions to TexPlay
|
2
|
+
direc = File.dirname(__FILE__)
|
3
|
+
dlext = Config::CONFIG['DLEXT']
|
4
|
+
begin
|
5
|
+
if RUBY_VERSION && RUBY_VERSION =~ /1.9/
|
6
|
+
require "#{direc}/1.9/real_include.#{dlext}"
|
7
|
+
else
|
8
|
+
require "#{direc}/1.8/real_include.#{dlext}"
|
9
|
+
end
|
10
|
+
rescue LoadError => e
|
11
|
+
require "#{direc}/real_include.#{dlext}"
|
12
|
+
end
|
13
|
+
|
14
|
+
require "#{direc}/real_include/version"
|
data/lib/real_include.so
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: real_include
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
|
+
platform: i386-mingw32
|
11
|
+
authors:
|
12
|
+
- John Mair (banisterfiend)
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-10-04 00:00:00 +13:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Fixing the limitation in traditional Module#include
|
22
|
+
email: jrmair@gmail.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- Rakefile
|
31
|
+
- README.markdown
|
32
|
+
- CHANGELOG
|
33
|
+
- lib/real_include.rb
|
34
|
+
- lib/real_include/version.rb
|
35
|
+
- lib/real_include.so
|
36
|
+
has_rdoc: false
|
37
|
+
homepage: http://banisterfiend.wordpress.com
|
38
|
+
licenses: []
|
39
|
+
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
segments:
|
51
|
+
- 0
|
52
|
+
version: "0"
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
requirements: []
|
62
|
+
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 1.3.7
|
65
|
+
signing_key:
|
66
|
+
specification_version: 3
|
67
|
+
summary: Fixing the limitation in traditional Module#include
|
68
|
+
test_files: []
|
69
|
+
|