From b754cf1f6799197294076b6911b028f37af532ec Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Thu, 2 May 2013 13:42:10 +0800 Subject: Improve Gem::Specification for support of dependencies and requirements --- tasks/mrbgem_spec.rake | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- cgit v1.2.3 From bb7d404e64e155f2c3c966c6ad621ba5b78dbb09 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Thu, 2 May 2013 13:42:26 +0800 Subject: Add more documentation for Gem::Specification --- doc/mrbgems/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/mrbgems/README.md b/doc/mrbgems/README.md index 1ad39a02b..5b43ccff2 100644 --- a/doc/mrbgems/README.md +++ b/doc/mrbgems/README.md @@ -98,6 +98,37 @@ 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 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 (License [String] or Licenses [Array] for this GEM) +* spec.author or spec.authors (Developer names author [String] authors [Array]) +* spec.version (Current Version [String] +* spec.description (Detailed description [String]) +* spec.summary (Short summary [String]) +* spec.homepage (Homepage [String]) +* spec.requirements + +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 parser. + # Version has to be between 1.0.0 and 1.5.2 + spec.add_dependency('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 for now! + In case your GEM has more complex build requirements you can use the following options additionally inside of your GEM specification: -- cgit v1.2.3 From 823dc380aa834efb34e461305480834c38c9c0ea Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Thu, 2 May 2013 13:50:45 +0800 Subject: Improve mrbgems documentation --- doc/mrbgems/README.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/mrbgems/README.md b/doc/mrbgems/README.md index 5b43ccff2..046717f8c 100644 --- a/doc/mrbgems/README.md +++ b/doc/mrbgems/README.md @@ -101,13 +101,13 @@ 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 (License [String] or Licenses [Array] for this GEM) -* spec.author or spec.authors (Developer names author [String] authors [Array]) -* spec.version (Current Version [String] -* spec.description (Detailed description [String]) -* spec.summary (Short summary [String]) -* spec.homepage (Homepage [String]) -* spec.requirements +* `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! @@ -118,30 +118,30 @@ In case your GEM is depending on other GEMs please use spec.license = 'MIT' spec.authors = 'mruby developers' - # add GEM dependency parser. - # Version has to be between 1.0.0 and 1.5.2 - spec.add_dependency('parser', '> 1.0.0', '< 1.5.2') + # 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__ +__ATTENTION:__ The dependency system is currently (May 2013) under development and doesn't check -or resolve dependencies for now! +or resolve dependencies! In case your GEM has more complex build requirements you can use the following options additionally inside of your GEM specification: -* spec.cflags (C compiler flags for this GEM) -* spec.mruby_cflags (global C compiler flags for everything) -* spec.mruby_ldflags (global linker flags for everything) -* spec.mruby_libs (global libraries for everything) -* spec.mruby_includes (global includes for everything) -* spec.rbfiles (Ruby files to compile) -* spec.objs (Object files to compile) -* spec.test_rbfiles (Ruby test files for integration into mrbtest) -* spec.test_objs (Object test files for integration into mrbtest) -* spec.test_preload (Initialization files for mrbtest) +* `spec.cflags` (C compiler flags) +* `spec.mruby_cflags` (global C compiler flags for everything) +* `spec.mruby_ldflags` (global linker flags for everything) +* `spec.mruby_libs` (global libraries for everything) +* `spec.mruby_includes` (global includes for everything) +* `spec.rbfiles` (Ruby files to compile) +* `spec.objs` (Object files to compile) +* `spec.test_rbfiles` (Ruby test files for integration into mrbtest) +* `spec.test_objs` (Object test files for integration into mrbtest) +* `spec.test_preload` (Initialization files for mrbtest) ## C Extension -- cgit v1.2.3 From d8ce46feda8cfb5533719f060365aa579caadce1 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Thu, 2 May 2013 13:52:56 +0800 Subject: Fix add_dependency declaration documentation --- doc/mrbgems/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/mrbgems/README.md b/doc/mrbgems/README.md index 046717f8c..f821379de 100644 --- a/doc/mrbgems/README.md +++ b/doc/mrbgems/README.md @@ -112,7 +112,7 @@ information purpose: 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: +`spec.add_dependency(gem, *requirements)` like: MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec| spec.license = 'MIT' -- cgit v1.2.3 From f0a9b95af3d542ac1db7fcb4a3d77990a284c185 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Thu, 2 May 2013 14:11:07 +0800 Subject: Push Copyright year up to 2013 --- MITL | 2 +- README.md | 2 +- include/mruby.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MITL b/MITL index 484dcff14..917a4e1c0 100644 --- a/MITL +++ b/MITL @@ -1,4 +1,4 @@ -Copyright (c) 2012 mruby developers +Copyright (c) 2013 mruby developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/README.md b/README.md index 32d177334..28e2ffc71 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ documentation with examples under *examples/mrbgems*. ## License -Copyright (c) 2012 mruby developers +Copyright (c) 2013 mruby developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/include/mruby.h b/include/mruby.h index 1317ee17d..be52e962b 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -1,7 +1,7 @@ /* ** 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 ** a copy of this software and associated documentation files (the -- cgit v1.2.3