diff options
| author | Daniel Bovensiepen <[email protected]> | 2013-05-02 13:42:10 +0800 |
|---|---|---|
| committer | Daniel Bovensiepen <[email protected]> | 2013-05-02 13:42:10 +0800 |
| commit | b754cf1f6799197294076b6911b028f37af532ec (patch) | |
| tree | 5a03ddb79b0d98986208dc1224a6079a4a8a2b05 /tasks | |
| parent | fd2e32e971a59ff3b20d7f5fede2aa4dd3c8263d (diff) | |
| download | mruby-b754cf1f6799197294076b6911b028f37af532ec.tar.gz mruby-b754cf1f6799197294076b6911b028f37af532ec.zip | |
Improve Gem::Specification for support of dependencies and requirements
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/mrbgem_spec.rake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake index 468a594ac..7b6751390 100644 --- a/tasks/mrbgem_spec.rake +++ b/tasks/mrbgem_spec.rake @@ -30,6 +30,9 @@ module MRuby attr_accessor :bins + attr_accessor :requirements + attr_reader :dependencies + attr_block MRuby::Build::COMMANDS def initialize(name, &block) @@ -63,6 +66,9 @@ module MRuby @bins = [] + @requirements = [] + @dependencies = [] + instance_eval(&@initializer) if !name || !licenses || !authors @@ -80,6 +86,12 @@ module MRuby define_gem_init_builder end + def add_dependency(name, *requirements) + requirements = ['> 0.0.0'] if requirements.empty? + requirements.flatten! + @dependencies << [:gem => name, :requirements => requirements] + end + def self.bin=(bin) @bins = [bin].flatten end |
