Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: MacRuby/MacRuby
...
head fork: MacRuby/MacRuby
Checking mergeability… Don't worry, you can still create the pull request.
  • 16 commits
  • 14 files changed
  • 0 commit comments
  • 4 contributors
View
22 BSDL
@@ -0,0 +1,22 @@
+Copyright (C) 2007-2010 MacRuby Team. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
View
112 COPYING
@@ -1,59 +1,59 @@
-MacRuby is copyrighted free software by Apple Inc.
+MacRuby is copyrighted free software by the MacRuby Team.
MacRuby contains code from the Ruby project, copyrighted free software by
Yukihiro Matsumoto <matz@netlab.jp>.
-You can redistribute it and/or modify it under either the terms of the GPL
-version 2 (see the file GPL), or the conditions below:
-
- 1. You may make and give away verbatim copies of the source form of the
- software without restriction, provided that you duplicate all of the
- original copyright notices and associated disclaimers.
-
- 2. You may modify your copy of the software in any way, provided that
- you do at least ONE of the following:
-
- a) place your modifications in the Public Domain or otherwise
- make them Freely Available, such as by posting said
- modifications to Usenet or an equivalent medium, or by allowing
- the author to include your modifications in the software.
-
- b) use the modified software only within your corporation or
- organization.
-
- c) give non-standard binaries non-standard names, with
- instructions on where to get the original software distribution.
-
- d) make other distribution arrangements with the author.
-
- 3. You may distribute the software in object code or binary form,
- provided that you do at least ONE of the following:
-
- a) distribute the binaries and library files of the software,
- together with instructions (in the manual page or equivalent)
- on where to get the original distribution.
-
- b) accompany the distribution with the machine-readable source of
- the software.
-
- c) give non-standard binaries non-standard names, with
- instructions on where to get the original software distribution.
-
- d) make other distribution arrangements with the author.
-
- 4. You may modify and include the part of the software into any other
- software (possibly commercial). But some files in the distribution
- are not written by the author, so that they are not under these terms.
-
- For the list of those files and their copying conditions, see the
- file LEGAL.
-
- 5. The scripts and library files supplied as input to or produced as
- output from the software do not automatically fall under the
- copyright of the software, but belong to whomever generated them,
- and may be sold commercially, and may be aggregated with this
- software.
-
- 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE.
+You can redistribute it and/or modify it under either the terms of the
+2-clause BSDL (see the file BSDL), or the conditions below:
+
+1. You may make and give away verbatim copies of the source form of the
+software without restriction, provided that you duplicate all of the
+original copyright notices and associated disclaimers.
+
+2. You may modify your copy of the software in any way, provided that
+you do at least ONE of the following:
+
+ a) place your modifications in the Public Domain or otherwise
+ make them Freely Available, such as by posting said
+ modifications to Usenet or an equivalent medium, or by allowing
+ the author to include your modifications in the software.
+
+ b) use the modified software only within your corporation or
+ organization.
+
+ c) give non-standard binaries non-standard names, with
+ instructions on where to get the original software distribution.
+
+ d) make other distribution arrangements with the author.
+
+3. You may distribute the software in object code or binary form,
+provided that you do at least ONE of the following:
+
+ a) distribute the binaries and library files of the software,
+ together with instructions (in the manual page or equivalent)
+ on where to get the original distribution.
+
+ b) accompany the distribution with the machine-readable source of
+ the software.
+
+ c) give non-standard binaries non-standard names, with
+ instructions on where to get the original software distribution.
+
+ d) make other distribution arrangements with the author.
+
+4. You may modify and include the part of the software into any other
+software (possibly commercial). But some files in the distribution
+are not written by the author, so that they are not under these terms.
+
+For the list of those files and their copying conditions, see the
+file LEGAL.
+
+5. The scripts and library files supplied as input to or produced as
+output from the software do not automatically fall under the
+copyright of the software, but belong to whomever generated them,
+and may be sold commercially, and may be aggregated with this
+software.
+
+6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.
View
5 README.rdoc
@@ -8,8 +8,9 @@ It is the goal of MacRuby to enable the creation of full-fledged Mac OS X
applications which do not sacrifice performance in order to enjoy the benefits
of using Ruby.
-MacRuby is copyrighted free software by Apple Inc and covered by the terms of
-the Ruby license. Please refer to the COPYING file for more information.
+MacRuby is copyrighted free software by the MacRuby team and covered by the
+terms of the Ruby license. Please refer to the COPYING file for more
+information.
The project website contains more documentation, such as tutorials and guides:
http://macruby.org
View
32 bin/ruby_deploy
@@ -22,14 +22,15 @@ class Deployer
OptionParser.new do |opts|
opts.banner = "Usage: #{NAME} [options] application-bundle"
- opts.on('--compile', 'Compile the bundle source code') { @compile = true }
- opts.on('--embed', 'Embed MacRuby inside the bundle') { @embed = true }
- opts.on('--no-stdlib', 'Do not embed the standard library') { @no_stdlib = true }
- opts.on('--stdlib [LIB]', 'Embed only LIB from the standard library') { |lib| @stdlib << lib }
- opts.on('--gem [GEM]', 'Embed GEM and its dependencies') { |gem| @gems << gem }
- opts.on('--bs', 'Embed the system BridgeSupport files') { @embed_bs = true }
- opts.on('--verbose', 'Log all commands to standard out') { @verbose = true }
- opts.on('-v', '--version', 'Display the version') do
+ opts.on('--compile', 'Compile the bundle source code') { @compile = true }
+ opts.on('--embed', 'Embed MacRuby inside the bundle') { @embed = true }
+ opts.on('--no-stdlib', 'Do not embed the standard library') { @no_stdlib = true }
+ opts.on('--stdlib [LIB]', 'Embed only LIB from the standard library') { |lib| @stdlib << lib }
+ opts.on('--gem [GEM]', 'Embed GEM and its dependencies') { |gem| @gems << gem }
+ opts.on('--bs', 'Embed the system BridgeSupport files') { @embed_bs = true }
+ opts.on('--verbose', 'Log all commands to standard out') { @verbose = true }
+ opts.on('--codesign [CERT]', String, 'Sign the files with the specified certificate') { |cert| @certificate = cert }
+ opts.on('-v', '--version', 'Display the version') do
puts RUBY_DESCRIPTION
exit 1
end
@@ -72,6 +73,7 @@ class Deployer
log "Deployment started"
embed if @embed
compile if @compile
+ sign if @certificate
log "Deployment ended"
end
@@ -321,6 +323,20 @@ class Deployer
def log(msg)
$stderr.puts "*** #{msg}"
end
+
+ def sign
+ log "Using codesign to sign files with #{@certificate}"
+ files = []
+ #get the .bundle, .rbo, .rb, .dylib, and .framework
+ files += Dir.glob(File.join(@app_bundle, '**', '*.bundle'))
+ files += Dir.glob(File.join(@app_bundle, '**', '*.rbo'))
+ files += Dir.glob(File.join(@app_bundle, '**', '*.rb'))
+ files += Dir.glob(File.join(@app_bundle, '**', '*.dylib'))
+ files += Dir.glob(File.join(@app_bundle, '**', '*.framework'))
+ files << @app_bundle
+
+ execute("/usr/bin/codesign -f -s \"#{@certificate}\" #{files.collect {|f| "\"#{f}\"" }.join(' ')}")
+ end
end
Deployer.new(ARGV).run
View
2  bridgesupport.cpp
@@ -815,7 +815,7 @@ rb_vm_get_struct_fields(VALUE rval, VALUE *buf, rb_vm_bs_boxed_t *bs_boxed)
bs_boxed->as.s->name,
RSTRING_PTR(rb_inspect(rval)));
}
- int length = exclusive ? end-1-begin : end-begin;
+ int length = exclusive ? end-begin : end-begin+1;
buf[0] = INT2NUM(begin);
buf[1] = INT2NUM(length);
}
View
7 lib/timeout.rb
@@ -63,6 +63,13 @@ def timeout(sec, klass = nil) #:yield: +sec+
end
end
rescue exception => e
+ # FIXME: workaround for Ticket #1411
+ if e.backtrace.nil?
+ raise if klass
+ raise Error, e.message
+ end
+ ####################################
+
rej = /\A#{Regexp.quote(__FILE__)}:#{__LINE__-4}\z/o
(bt = e.backtrace).reject! {|m| rej =~ m}
level = -caller(CALLER_OFFSET).size
View
2  misc/release/MacRuby.pmdoc/01macruby-contents.xml
1 addition, 1 deletion not shown
View
2  misc/release/MacRuby.pmdoc/01macruby.xml
@@ -1 +1 @@
-<pkgref spec="1.12" uuid="6000E18C-626C-4263-9A58-C4898B708437"><config><identifier>com.apple.macruby.macruby.MacRuby0.pkg</identifier><version>1.0</version><description/><post-install type="none"/><requireAuthorization/><installFrom>/private/tmp/MacRuby0.10</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>parent</mod></config><contents><file-list>01macruby-contents.xml</file-list><component id="org.macruby" path="/private/tmp/MacRuby0.10/Library/Frameworks/MacRuby.framework" version="MacRuby-0.10"><component id="org.macruby" path="/private/tmp/MacRuby0.10/Library/Frameworks/MacRuby.framework/Versions/0.10" version="MacRuby-0.10"/></component><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
+<pkgref spec="1.12" uuid="6AE573D1-8167-40C6-8CA5-2559A9E90E46"><config><identifier>com.apple.macruby.macruby.MacRuby.pkg</identifier><version>1.0</version><description/><post-install type="none"/><requireAuthorization/><installFrom>/private/tmp/MacRuby</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>installTo</mod><mod>parent</mod></config><contents><file-list>01macruby-contents.xml</file-list><component id="org.macruby" path="/private/tmp/MacRuby/Library/Frameworks/MacRuby.framework" version="MacRuby-0.11"><component id="org.macruby" path="/private/tmp/MacRuby/Library/Frameworks/MacRuby.framework/Versions/0.11" version="MacRuby-0.11"/></component><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
View
53 misc/release/MacRuby.pmdoc/index.xml
@@ -1,43 +1,46 @@
<pkmkdoc spec="1.12"><properties><title>MacRuby</title><build>/Users/lrz/Documents/MacRuby 0.10.pkg</build><organization>com.apple.macruby</organization><userSees ui="easy"/><min-target os="3"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>MacRuby is a version of Ruby 1.9, ported to run directly on top of Mac OS X core technologies such as the Objective-C common runtime and garbage collector, and the CoreFoundation framework.
-While still a work in progress, it is the goal of MacRuby to enable the creation of full-fledged Mac OS X applications which do not sacrifice performance in order to enjoy the benefits of using Ruby. </description><contents><choice title="MacRuby0" id="choice13" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.apple.macruby.macruby.MacRuby0.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
+While still a work in progress, it is the goal of MacRuby to enable the creation of full-fledged Mac OS X applications which do not sacrifice performance in order to enjoy the benefits of using Ruby. </description><contents><choice title="MacRuby" id="choice14" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.apple.macruby.macruby.MacRuby.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
-\f0\fs26 \cf0 MacRuby is a free software project covered by the Ruby license.\
+\f0\fs26 \cf0 MacRuby is copyrighted free software by the MacRuby Team.\
+MacRuby contains code from the Ruby project, copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.\
\
-You can redistribute it and/or modify it under either the terms of the GPL version 2 (see the file GPL that comes with the source distribution), or the conditions below:\
+You can redistribute it and/or modify it under either the terms of the 2-clause BSDL (see the file BSDL), or the conditions below:\
\
- 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers.\
+1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers.\
\
- 2. You may modify your copy of the software in any way, provided that you do at least ONE of the following:\
+2. You may modify your copy of the software in any way, provided that you do at least ONE of the following:\
+ \
+ a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or by allowing the author to include your modifications in the software.\
+ \
+ b) use the modified software only within your corporation or organization.\
+ \
+ c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution.\
+ \
+ d) make other distribution arrangements with the author.\
\
- a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or by allowing the author to include your modifications in the software.\
+3. You may distribute the software in object code or binary form, provided that you do at least ONE of the following:\
\
- b) use the modified software only within your corporation or organization.\
+ a) distribute the binaries and library files of the software, together with instructions (in the manual page or equivalent) on where to get the original distribution.\
+ \
+ b) accompany the distribution with the machine-readable source of the software.\
+ \
+ c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution.\
+ \
+ d) make other distribution arrangements with the author.\
\
- c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution.\
+4. You may modify and include the part of the software into any other software (possibly commercial). But some files in the distribution are not written by the author, so that they are not under these terms.\
\
- d) make other distribution arrangements with the author.\
+For the list of those files and their copying conditions, see the file LEGAL.\
\
- 3. You may distribute the software in object code or binary form, provided that you do at least ONE of the following:\
+5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the copyright of the software, but belong to whomever generated them,\
+and may be sold commercially, and may be aggregated with this software.\
\
- a) distribute the binaries and library files of the software, together with instructions (in the manual page or equivalent on where to get the original distribution.\
-\
- b) accompany the distribution with the machine-readable source of the software.\
-\
- c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution.\
-\
- d) make other distribution arrangements with the author.\
-\
- 4. You may modify and include the part of the software into any other software (possibly commercial). But some files in the distribution are not written by the author, so that they are not under these terms.\
-\
- For the list of those files and their copying conditions, see the file LEGAL that is included with the source distribution.\
-\
- 5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the copyright of the software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this software.\
-\
- 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
+6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\
+PURPOSE.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red255\green0\blue0;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
View
12 rakelib/builder/templates.rb
@@ -111,12 +111,20 @@ module RbConfig
CONFIG["target_cpu"] = "i686"
CONFIG["target_vendor"] = "apple"
CONFIG["target_os"] = "darwin9.0"
- CONFIG["CC"] = "#{CC}"
+ if File.exist? "#{CC}"
+ CONFIG["CC"] = "#{CC}"
+ else
+ CONFIG["CC"] = "/usr/bin/gcc"
+ end
CONFIG["CFLAGS"] = "$(ARCH_FLAG) -fexceptions -fno-common -pipe $(cflags)"
CONFIG["LDFLAGS"] = "$(ARCH_FLAG)"
CONFIG["CPPFLAGS"] = "$(cppflags)"
CONFIG["OBJEXT"] = "o"
- CONFIG["CXX"] = "#{CXX}"
+ if File.exist? "#{CXX}"
+ CONFIG["CXX"] = "#{CXX}"
+ else
+ CONFIG["CXX"] = "/usr/bin/g++"
+ end
CONFIG["CXXFLAGS"] = "$(ARCH_FLAG)"
CONFIG["CPP"] = "/usr/bin/gcc -E"
CONFIG["GREP"] = "/usr/bin/grep"
View
2  range.c
@@ -949,6 +949,8 @@ range_relative_to(VALUE range, SEL sel, VALUE max)
{
long beg, len, m = NUM2LONG(max);
rb_range_beg_len(range, &beg, &len, m, 0);
+ if (beg + len > m)
+ len -= 1;
return rb_range_new(LONG2NUM(beg), LONG2NUM(beg + len - 1), 0);
}
View
32 spec/macruby/core/range_spec.rb
@@ -0,0 +1,32 @@
+describe "A Range object" do
+
+ it "gets turned into an NSRange struct when passed to an Objective-C method" do
+ ary = (0..10).to_a
+
+ [0..10, 2..10, 0...10, 2...10].each do |range|
+ ary.subarrayWithRange(range).should == ary.slice(range)
+ end
+ end
+
+ it "responds to #relative_to, which returns a new Range object without negative indicies" do
+ ( 0 .. 10).relative_to(11).should == (0..10)
+ ( 1 .. 9 ).relative_to(11).should == (1..9 )
+ ( 0 .. 15).relative_to(11).should == (0..10)
+ ( 0 .. 11).relative_to(11).should == (0..10)
+
+ ( 0 .. -1 ).relative_to(11).should == (0..10)
+ ( 0 .. -2 ).relative_to(11).should == (0..9 )
+ ( 1 .. -2 ).relative_to(11).should == (1..9 )
+
+ (-11.. 10).relative_to(11).should == (0..10)
+ (-5 .. 10).relative_to(11).should == (6..10)
+ (-10.. -5 ).relative_to(11).should == (1..6 )
+
+ ( 4 ... 11).relative_to(11).should == (4..10)
+ ( 4 ... 15).relative_to(11).should == (4..10)
+ ( 4 ... 10).relative_to(11).should == (4..9 )
+ ( 4 ...-1 ).relative_to(11).should == (4..9 )
+ (-11...-1 ).relative_to(11).should == (0..9 )
+ end
+
+end
View
8 spec/macruby/language/objc_method_spec.rb
@@ -368,12 +368,12 @@ def o2.to_str; 'foo' end
end
it "accepting a Range as a structure type should receive a NSRange C structure" do
- @o.methodAcceptingNSRange(0..41).should == 0
+ @o.methodAcceptingNSRange(0..41).should == 1
@o.methodAcceptingNSRange(1..42).should == 0
- @o.methodAcceptingNSRange(0..42).should == 1
- @o.methodAcceptingNSRange(0...42).should == 0
+ @o.methodAcceptingNSRange(0..42).should == 0
+ @o.methodAcceptingNSRange(0...42).should == 1
@o.methodAcceptingNSRange(1...42).should == 0
- @o.methodAcceptingNSRange(0...43).should == 1
+ @o.methodAcceptingNSRange(0...43).should == 0
lambda { @o.methodAcceptingNSRange(-1..1) }.should raise_error(ArgumentError)
lambda { @o.methodAcceptingNSRange(1..-1) }.should raise_error(ArgumentError)
View
6 string.c
@@ -6910,6 +6910,12 @@ rb_str_modify(VALUE obj)
}
VALUE
+rb_str_freeze(VALUE str)
+{
+ return rb_obj_freeze(str);
+}
+
+VALUE
rb_str_plus(VALUE str1, VALUE str2)
{
str1 = (VALUE)str_need_string(str1);

No commit comments for this range

Something went wrong with that request. Please try again.