gem_plugin 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +15 -9
- data/bin/gpgen +60 -0
- data/doc/rdoc/classes/GemPlugin.html +3 -2
- data/doc/rdoc/classes/GemPlugin.src/M000001.html +5 -5
- data/doc/rdoc/classes/GemPlugin/Base.html +1 -1
- data/doc/rdoc/classes/GemPlugin/Base.src/M000002.html +6 -6
- data/doc/rdoc/classes/GemPlugin/Base.src/M000003.html +4 -4
- data/doc/rdoc/classes/GemPlugin/Base.src/M000004.html +4 -4
- data/doc/rdoc/classes/GemPlugin/Manager.html +107 -8
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000005.html +9 -5
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000006.html +30 -29
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000007.html +5 -5
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000008.html +15 -15
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000009.html +5 -5
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000010.html +28 -0
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000011.html +28 -0
- data/doc/rdoc/classes/GemPlugin/PluginNotLoaded.html +111 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +3 -6
- data/doc/rdoc/files/lib/gem_plugin_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +3 -1
- data/lib/gem_plugin.rb +89 -13
- data/resources/COPYING +1 -0
- data/resources/LICENSE +1 -0
- data/resources/README +5 -0
- data/resources/Rakefile +37 -0
- data/resources/lib/project/init.rb +6 -0
- data/resources/resources/defaults.yaml +2 -0
- data/resources/tools/rakehelp.rb +105 -0
- data/test/test_plugins.rb +3 -4
- data/tools/rakehelp.rb +5 -11
- metadata +36 -11
data/resources/COPYING
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
No copying restrictions/license given.
|
data/resources/LICENSE
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
No license given.
|
data/resources/README
ADDED
data/resources/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/gempackagetask'
|
5
|
+
require 'rake/rdoctask'
|
6
|
+
require 'tools/rakehelp'
|
7
|
+
require 'fileutils'
|
8
|
+
include FileUtils
|
9
|
+
|
10
|
+
setup_tests
|
11
|
+
setup_clean ["pkg", "lib/*.bundle", "*.gem", ".config"]
|
12
|
+
|
13
|
+
setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
|
14
|
+
|
15
|
+
desc "Does a full compile, test run"
|
16
|
+
task :default => [:test, :package]
|
17
|
+
|
18
|
+
version="0.1"
|
19
|
+
name="<%= project %>"
|
20
|
+
|
21
|
+
setup_gem(name, version) do |spec|
|
22
|
+
spec.summary = "The <%= project %> GemPlugin"
|
23
|
+
spec.description = spec.summary
|
24
|
+
spec.author="Nobody"
|
25
|
+
spec.add_dependency('gem_plugin', '>= <%= gem_plugin_version %>')
|
26
|
+
spec.files += Dir.glob("resources/**/*")
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
task :install => [:test, :package] do
|
31
|
+
sh %{sudo gem install pkg/#{name}-#{version}.gem}
|
32
|
+
end
|
33
|
+
|
34
|
+
task :uninstall => [:clean] do
|
35
|
+
sh %{sudo gem uninstall #{name}}
|
36
|
+
end
|
37
|
+
|
@@ -0,0 +1,105 @@
|
|
1
|
+
|
2
|
+
def make(makedir)
|
3
|
+
Dir.chdir(makedir) do
|
4
|
+
sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
def extconf(dir)
|
10
|
+
Dir.chdir(dir) do ruby "extconf.rb" end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def setup_tests
|
15
|
+
Rake::TestTask.new do |t|
|
16
|
+
t.libs << "test"
|
17
|
+
t.test_files = FileList['test/test*.rb']
|
18
|
+
t.verbose = true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
def setup_clean otherfiles
|
24
|
+
files = ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log'] + otherfiles
|
25
|
+
CLEAN.include(files)
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def setup_rdoc files
|
30
|
+
Rake::RDocTask.new do |rdoc|
|
31
|
+
rdoc.rdoc_dir = 'doc/rdoc'
|
32
|
+
rdoc.options << '--line-numbers'
|
33
|
+
rdoc.rdoc_files.add(files)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
def setup_extension(dir, extension)
|
39
|
+
ext = "ext/#{dir}"
|
40
|
+
ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
|
41
|
+
ext_files = FileList[
|
42
|
+
"#{ext}/*.c",
|
43
|
+
"#{ext}/*.h",
|
44
|
+
"#{ext}/extconf.rb",
|
45
|
+
"#{ext}/Makefile",
|
46
|
+
"lib"
|
47
|
+
]
|
48
|
+
|
49
|
+
task "lib" do
|
50
|
+
directory "lib"
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Builds just the #{extension} extension"
|
54
|
+
task extension.to_sym => ["#{ext}/Makefile", ext_so ]
|
55
|
+
|
56
|
+
file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
|
57
|
+
extconf "#{ext}"
|
58
|
+
end
|
59
|
+
|
60
|
+
file ext_so => ext_files do
|
61
|
+
make "#{ext}"
|
62
|
+
cp ext_so, "lib"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
def base_gem_spec(pkg_name, pkg_version)
|
68
|
+
pkg_version = pkg_version
|
69
|
+
pkg_name = pkg_name
|
70
|
+
pkg_file_name = "#{pkg_name}-#{pkg_version}"
|
71
|
+
Gem::Specification.new do |s|
|
72
|
+
s.name = pkg_name
|
73
|
+
s.version = pkg_version
|
74
|
+
s.platform = Gem::Platform::RUBY
|
75
|
+
s.has_rdoc = true
|
76
|
+
s.extra_rdoc_files = [ "README" ]
|
77
|
+
|
78
|
+
s.files = %w(COPYING LICENSE README Rakefile) +
|
79
|
+
Dir.glob("{bin,doc/rdoc,test,lib}/**/*") +
|
80
|
+
Dir.glob("ext/**/*.{h,c,rb}") +
|
81
|
+
Dir.glob("examples/**/*.rb") +
|
82
|
+
Dir.glob("tools/*.rb")
|
83
|
+
|
84
|
+
s.require_path = "lib"
|
85
|
+
s.extensions = FileList["ext/**/extconf.rb"].to_a
|
86
|
+
s.bindir = "bin"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def setup_gem(pkg_name, pkg_version)
|
91
|
+
spec = base_gem_spec(pkg_name, pkg_version)
|
92
|
+
yield spec if block_given?
|
93
|
+
|
94
|
+
Rake::GemPackageTask.new(spec) do |p|
|
95
|
+
p.gem_spec = spec
|
96
|
+
p.need_tar = true
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def setup_win32_gem(pkg_name, pkg_version)
|
101
|
+
spec = base_gem_spec(pkg_name, pkg_version)
|
102
|
+
yield spec if block_given?
|
103
|
+
|
104
|
+
Gem::Builder.new(spec).build
|
105
|
+
end
|
data/test/test_plugins.rb
CHANGED
@@ -35,16 +35,15 @@ class PluginTest < Test::Unit::TestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_load_plugins
|
38
|
-
puts "#{@pmgr.
|
39
|
-
@pmgr.
|
38
|
+
puts "#{@pmgr.plugins.inspect}"
|
39
|
+
@pmgr.plugins.each {|cat,plugins|
|
40
40
|
plugins.each do |n,p|
|
41
41
|
puts "TEST: #{cat}#{n}"
|
42
|
-
assert @names.include?(n)
|
43
42
|
end
|
44
43
|
}
|
45
44
|
|
46
45
|
@pmgr.load
|
47
|
-
@pmgr.
|
46
|
+
@pmgr.plugins.each do |cat,plugins|
|
48
47
|
plugins.each do |n,p|
|
49
48
|
STDERR.puts "#{cat}#{n}"
|
50
49
|
plugin = @pmgr.create("#{cat}#{n}", options={"name" => p})
|
data/tools/rakehelp.rb
CHANGED
@@ -64,18 +64,14 @@ def setup_extension(dir, extension)
|
|
64
64
|
end
|
65
65
|
|
66
66
|
|
67
|
-
def base_gem_spec(pkg_name, pkg_version
|
67
|
+
def base_gem_spec(pkg_name, pkg_version)
|
68
68
|
pkg_version = pkg_version
|
69
69
|
pkg_name = pkg_name
|
70
70
|
pkg_file_name = "#{pkg_name}-#{pkg_version}"
|
71
71
|
Gem::Specification.new do |s|
|
72
72
|
s.name = pkg_name
|
73
73
|
s.version = pkg_version
|
74
|
-
s.required_ruby_version = '>= 1.8.3'
|
75
74
|
s.platform = Gem::Platform::RUBY
|
76
|
-
s.author = author
|
77
|
-
s.summary = summary
|
78
|
-
s.test_file = test_file
|
79
75
|
s.has_rdoc = true
|
80
76
|
s.extra_rdoc_files = [ "README" ]
|
81
77
|
|
@@ -87,14 +83,12 @@ def base_gem_spec(pkg_name, pkg_version, author, summary, executables, test_file
|
|
87
83
|
|
88
84
|
s.require_path = "lib"
|
89
85
|
s.extensions = FileList["ext/**/extconf.rb"].to_a
|
90
|
-
|
91
|
-
s.executables = executables
|
92
86
|
s.bindir = "bin"
|
93
87
|
end
|
94
88
|
end
|
95
89
|
|
96
|
-
def setup_gem(pkg_name, pkg_version
|
97
|
-
spec = base_gem_spec(pkg_name, pkg_version
|
90
|
+
def setup_gem(pkg_name, pkg_version)
|
91
|
+
spec = base_gem_spec(pkg_name, pkg_version)
|
98
92
|
yield spec if block_given?
|
99
93
|
|
100
94
|
Rake::GemPackageTask.new(spec) do |p|
|
@@ -103,8 +97,8 @@ def setup_gem(pkg_name, pkg_version, author, summary, executables, test_file)
|
|
103
97
|
end
|
104
98
|
end
|
105
99
|
|
106
|
-
def setup_win32_gem(pkg_name, pkg_version
|
107
|
-
spec = base_gem_spec(pkg_name, pkg_version
|
100
|
+
def setup_win32_gem(pkg_name, pkg_version)
|
101
|
+
spec = base_gem_spec(pkg_name, pkg_version)
|
108
102
|
yield spec if block_given?
|
109
103
|
|
110
104
|
Gem::Builder.new(spec).build
|
metadata
CHANGED
@@ -3,24 +3,24 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: gem_plugin
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "0.
|
7
|
-
date: 2006-03-
|
8
|
-
summary: A plugin system based only on rubygems
|
6
|
+
version: "0.2"
|
7
|
+
date: 2006-03-12 00:00:00 -05:00
|
8
|
+
summary: A plugin system based only on rubygems that uses dependencies only
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email:
|
12
12
|
homepage:
|
13
13
|
rubyforge_project:
|
14
|
-
description:
|
15
|
-
autorequire:
|
14
|
+
description: A plugin system based only on rubygems that uses dependencies only
|
15
|
+
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
18
18
|
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
|
-
- - "
|
21
|
+
- - ">"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
23
|
+
version: 0.0.0
|
24
24
|
version:
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- LICENSE
|
33
33
|
- README
|
34
34
|
- Rakefile
|
35
|
+
- bin/gpgen
|
35
36
|
- doc/rdoc/classes
|
36
37
|
- doc/rdoc/created.rid
|
37
38
|
- doc/rdoc/files
|
@@ -47,6 +48,7 @@ files:
|
|
47
48
|
- doc/rdoc/classes/GemPlugin/Base.src
|
48
49
|
- doc/rdoc/classes/GemPlugin/Manager.html
|
49
50
|
- doc/rdoc/classes/GemPlugin/Manager.src
|
51
|
+
- doc/rdoc/classes/GemPlugin/PluginNotLoaded.html
|
50
52
|
- doc/rdoc/classes/GemPlugin/Base.src/M000002.html
|
51
53
|
- doc/rdoc/classes/GemPlugin/Base.src/M000003.html
|
52
54
|
- doc/rdoc/classes/GemPlugin/Base.src/M000004.html
|
@@ -55,6 +57,8 @@ files:
|
|
55
57
|
- doc/rdoc/classes/GemPlugin/Manager.src/M000007.html
|
56
58
|
- doc/rdoc/classes/GemPlugin/Manager.src/M000008.html
|
57
59
|
- doc/rdoc/classes/GemPlugin/Manager.src/M000009.html
|
60
|
+
- doc/rdoc/classes/GemPlugin/Manager.src/M000010.html
|
61
|
+
- doc/rdoc/classes/GemPlugin/Manager.src/M000011.html
|
58
62
|
- doc/rdoc/classes/GemPlugin.src/M000001.html
|
59
63
|
- doc/rdoc/files/COPYING.html
|
60
64
|
- doc/rdoc/files/lib
|
@@ -64,17 +68,38 @@ files:
|
|
64
68
|
- test/test_plugins.rb
|
65
69
|
- lib/gem_plugin.rb
|
66
70
|
- tools/rakehelp.rb
|
71
|
+
- resources/COPYING
|
72
|
+
- resources/doc
|
73
|
+
- resources/lib
|
74
|
+
- resources/LICENSE
|
75
|
+
- resources/Rakefile
|
76
|
+
- resources/README
|
77
|
+
- resources/resources
|
78
|
+
- resources/test
|
79
|
+
- resources/tools
|
80
|
+
- resources/lib/project
|
81
|
+
- resources/lib/project/init.rb
|
82
|
+
- resources/resources/defaults.yaml
|
83
|
+
- resources/tools/rakehelp.rb
|
67
84
|
test_files:
|
68
85
|
- test/test_plugins.rb
|
69
86
|
rdoc_options: []
|
70
87
|
|
71
88
|
extra_rdoc_files:
|
72
89
|
- README
|
73
|
-
executables:
|
74
|
-
|
90
|
+
executables:
|
91
|
+
- gpgen
|
75
92
|
extensions: []
|
76
93
|
|
77
94
|
requirements: []
|
78
95
|
|
79
|
-
dependencies:
|
80
|
-
|
96
|
+
dependencies:
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
version_requirement:
|
100
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: "0.7"
|
105
|
+
version:
|