Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 4d3991e561cda90e3ce03aba7602fa62bf577393 2 parents 3d149f6 + 0e529c2
Yukihiro "Matz" Matsumoto matz authored
2  MITL
... ... @@ -1,4 +1,4 @@
1   -Copyright (c) 2012 mruby developers
  1 +Copyright (c) 2013 mruby developers
2 2
3 3 Permission is hereby granted, free of charge, to any person obtaining a
4 4 copy of this software and associated documentation files (the "Software"),
2  README.md
Source Rendered
@@ -71,7 +71,7 @@ documentation with examples under *examples/mrbgems*.
71 71
72 72 ## License
73 73
74   -Copyright (c) 2012 mruby developers
  74 +Copyright (c) 2013 mruby developers
75 75
76 76 Permission is hereby granted, free of charge, to any person obtaining a
77 77 copy of this software and associated documentation files (the "Software"),
51 doc/mrbgems/README.md
Source Rendered
@@ -98,19 +98,50 @@ The mrbgems build process will use this specification to compile Object and Ruby
98 98 files. The compilation results will be add to *lib/libmruby.a*. This file is used
99 99 by tools like `mruby` and `mirb` to empower the GEM functionality.
100 100
  101 +The following properties can be set inside of your `MRuby::Gem::Specification` for
  102 +information purpose:
  103 +
  104 +* `spec.license` or `spec.licenses` (A single license or a list of them under which this GEM is licensed)
  105 +* `spec.author` or `spec.authors` (Developer name or a list of them)
  106 +* `spec.version` (Current version)
  107 +* `spec.description` (Detailed description)
  108 +* `spec.summary` (Short summary)
  109 +* `spec.homepage` (Homepage)
  110 +* `spec.requirements` (External requirements as information for user)
  111 +
  112 +It is required for every GEM to have a license and an author!
  113 +
  114 +In case your GEM is depending on other GEMs please use
  115 +`spec.add_dependency(gem, *requirements)` like:
  116 +
  117 + MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec|
  118 + spec.license = 'MIT'
  119 + spec.authors = 'mruby developers'
  120 +
  121 + # add GEM dependency mruby-parser.
  122 + # Version has to be between 1.0.0 and 1.5.2
  123 + spec.add_dependency('mruby-parser', '> 1.0.0', '< 1.5.2')
  124 + end
  125 +
  126 +The usage of versions is optional.
  127 +
  128 +__ATTENTION:__
  129 +The dependency system is currently (May 2013) under development and doesn't check
  130 +or resolve dependencies!
  131 +
101 132 In case your GEM has more complex build requirements you can use
102 133 the following options additionally inside of your GEM specification:
103 134
104   -* spec.cflags (C compiler flags for this GEM)
105   -* spec.mruby_cflags (global C compiler flags for everything)
106   -* spec.mruby_ldflags (global linker flags for everything)
107   -* spec.mruby_libs (global libraries for everything)
108   -* spec.mruby_includes (global includes for everything)
109   -* spec.rbfiles (Ruby files to compile)
110   -* spec.objs (Object files to compile)
111   -* spec.test_rbfiles (Ruby test files for integration into mrbtest)
112   -* spec.test_objs (Object test files for integration into mrbtest)
113   -* spec.test_preload (Initialization files for mrbtest)
  135 +* `spec.cflags` (C compiler flags)
  136 +* `spec.mruby_cflags` (global C compiler flags for everything)
  137 +* `spec.mruby_ldflags` (global linker flags for everything)
  138 +* `spec.mruby_libs` (global libraries for everything)
  139 +* `spec.mruby_includes` (global includes for everything)
  140 +* `spec.rbfiles` (Ruby files to compile)
  141 +* `spec.objs` (Object files to compile)
  142 +* `spec.test_rbfiles` (Ruby test files for integration into mrbtest)
  143 +* `spec.test_objs` (Object test files for integration into mrbtest)
  144 +* `spec.test_preload` (Initialization files for mrbtest)
114 145
115 146 ## C Extension
116 147
2  include/mruby.h
... ... @@ -1,7 +1,7 @@
1 1 /*
2 2 ** mruby - An embeddable Ruby implementation
3 3 **
4   -** Copyright (c) mruby developers 2010-2012
  4 +** Copyright (c) mruby developers 2010-2013
5 5 **
6 6 ** Permission is hereby granted, free of charge, to any person obtaining
7 7 ** a copy of this software and associated documentation files (the
12 tasks/mrbgem_spec.rake
@@ -30,6 +30,9 @@ module MRuby
30 30
31 31 attr_accessor :bins
32 32
  33 + attr_accessor :requirements
  34 + attr_reader :dependencies
  35 +
33 36 attr_block MRuby::Build::COMMANDS
34 37
35 38 def initialize(name, &block)
@@ -63,6 +66,9 @@ module MRuby
63 66
64 67 @bins = []
65 68
  69 + @requirements = []
  70 + @dependencies = []
  71 +
66 72 instance_eval(&@initializer)
67 73
68 74 if !name || !licenses || !authors
@@ -80,6 +86,12 @@ module MRuby
80 86 define_gem_init_builder
81 87 end
82 88
  89 + def add_dependency(name, *requirements)
  90 + requirements = ['> 0.0.0'] if requirements.empty?
  91 + requirements.flatten!
  92 + @dependencies << [:gem => name, :requirements => requirements]
  93 + end
  94 +
83 95 def self.bin=(bin)
84 96 @bins = [bin].flatten
85 97 end

0 comments on commit 4d3991e

Please sign in to comment.
Something went wrong with that request. Please try again.