Commit 4d3991e5 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge branch 'master' of github.com:mruby/mruby

parents 3d149f63 0e529c22
Copyright (c) 2012 mruby developers Copyright (c) 2013 mruby developers
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
......
...@@ -71,7 +71,7 @@ documentation with examples under *examples/mrbgems*. ...@@ -71,7 +71,7 @@ documentation with examples under *examples/mrbgems*.
## License ## License
Copyright (c) 2012 mruby developers Copyright (c) 2013 mruby developers
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
......
...@@ -98,19 +98,50 @@ The mrbgems build process will use this specification to compile Object and Ruby ...@@ -98,19 +98,50 @@ The mrbgems build process will use this specification to compile Object and Ruby
files. The compilation results will be add to *lib/libmruby.a*. This file is used files. The compilation results will be add to *lib/libmruby.a*. This file is used
by tools like `mruby` and `mirb` to empower the GEM functionality. by tools like `mruby` and `mirb` to empower the GEM functionality.
The following properties can be set inside of your `MRuby::Gem::Specification` for
information purpose:
* `spec.license` or `spec.licenses` (A single license or a list of them under which this GEM is licensed)
* `spec.author` or `spec.authors` (Developer name or a list of them)
* `spec.version` (Current version)
* `spec.description` (Detailed description)
* `spec.summary` (Short summary)
* `spec.homepage` (Homepage)
* `spec.requirements` (External requirements as information for user)
It is required for every GEM to have a license and an author!
In case your GEM is depending on other GEMs please use
`spec.add_dependency(gem, *requirements)` like:
MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec|
spec.license = 'MIT'
spec.authors = 'mruby developers'
# add GEM dependency mruby-parser.
# Version has to be between 1.0.0 and 1.5.2
spec.add_dependency('mruby-parser', '> 1.0.0', '< 1.5.2')
end
The usage of versions is optional.
__ATTENTION:__
The dependency system is currently (May 2013) under development and doesn't check
or resolve dependencies!
In case your GEM has more complex build requirements you can use In case your GEM has more complex build requirements you can use
the following options additionally inside of your GEM specification: the following options additionally inside of your GEM specification:
* spec.cflags (C compiler flags for this GEM) * `spec.cflags` (C compiler flags)
* spec.mruby_cflags (global C compiler flags for everything) * `spec.mruby_cflags` (global C compiler flags for everything)
* spec.mruby_ldflags (global linker flags for everything) * `spec.mruby_ldflags` (global linker flags for everything)
* spec.mruby_libs (global libraries for everything) * `spec.mruby_libs` (global libraries for everything)
* spec.mruby_includes (global includes for everything) * `spec.mruby_includes` (global includes for everything)
* spec.rbfiles (Ruby files to compile) * `spec.rbfiles` (Ruby files to compile)
* spec.objs (Object files to compile) * `spec.objs` (Object files to compile)
* spec.test_rbfiles (Ruby test files for integration into mrbtest) * `spec.test_rbfiles` (Ruby test files for integration into mrbtest)
* spec.test_objs (Object test files for integration into mrbtest) * `spec.test_objs` (Object test files for integration into mrbtest)
* spec.test_preload (Initialization files for mrbtest) * `spec.test_preload` (Initialization files for mrbtest)
## C Extension ## C Extension
......
/* /*
** mruby - An embeddable Ruby implementation ** mruby - An embeddable Ruby implementation
** **
** Copyright (c) mruby developers 2010-2012 ** Copyright (c) mruby developers 2010-2013
** **
** Permission is hereby granted, free of charge, to any person obtaining ** Permission is hereby granted, free of charge, to any person obtaining
** a copy of this software and associated documentation files (the ** a copy of this software and associated documentation files (the
......
...@@ -30,6 +30,9 @@ module MRuby ...@@ -30,6 +30,9 @@ module MRuby
attr_accessor :bins attr_accessor :bins
attr_accessor :requirements
attr_reader :dependencies
attr_block MRuby::Build::COMMANDS attr_block MRuby::Build::COMMANDS
def initialize(name, &block) def initialize(name, &block)
...@@ -63,6 +66,9 @@ module MRuby ...@@ -63,6 +66,9 @@ module MRuby
@bins = [] @bins = []
@requirements = []
@dependencies = []
instance_eval(&@initializer) instance_eval(&@initializer)
if !name || !licenses || !authors if !name || !licenses || !authors
...@@ -80,6 +86,12 @@ module MRuby ...@@ -80,6 +86,12 @@ module MRuby
define_gem_init_builder define_gem_init_builder
end 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) def self.bin=(bin)
@bins = [bin].flatten @bins = [bin].flatten
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment