Skip to content

Commit

Permalink
Getting ready for ruby-processing-2.6.15 release
Browse files Browse the repository at this point in the history
  • Loading branch information
monkstone committed Aug 21, 2015
1 parent 99619d1 commit 214349e
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 709 deletions.
11 changes: 7 additions & 4 deletions CHANGELOG
@@ -1,13 +1,16 @@
v2.6.15 added guard against running 'watch' in top level directories, rescue error
when processing-3.0 is specified, and suggest updating to JRubyArt
* when processing-3.0 is specified, and suggest updating to JRubyArt update to
* jruby-complete-1.7.22 (this may be the final release of 1.7.XX series)
* features deprecation of processing map in favor of p5map (or map1d) which
* are now both jruby extensions, along with lerp and norm

v2.6.14 revert to using 'require to load jars' because everything just worked
* before, and sometimes just doesn't with java classpath loading.
v2.6.14 revert to using 'require to load jars' because everything just worked
* before, and sometimes just doesn't with java classpath loading.
* jruby-9.0.0.0 has been fixed, so now we don't need compability changes...
* use pry-java for live mode

v2.6.13 update to jruby-complete-1.7.21
* the perfomance of 1.7.** series still exceeds jruby-9.0.0.0
* the perfomance of 1.7.XX series still exceeds jruby-9.0.0.0

v2.6.12 Changes to make jruby and PApplet use same classloader
* to make ruby-processing compatible with JRuby-9.0.0.0.rc1+
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -24,7 +24,7 @@ To install jruby-complete use our built in tool (relies on `wget` to download [j

since ruby-processing-2.5.0 `rp5 setup install` (was `install_jruby_complete`)

If you haven't got `wget` just download jruby-complete-1.7.21 (for ruby-processing-2.6.14) to the vendors folder (then run above tool)
If you haven't got `wget` just download jruby-complete-1.7.22 (for ruby-processing-2.6.15) to the vendors folder (then run above tool)

The vendored jruby-complete is only required for application export, and running certain sketches (eg shader sketches see [wiki][]).

Expand Down
7 changes: 7 additions & 0 deletions Rakefile
Expand Up @@ -42,6 +42,13 @@ task :test do
ruby "test/rp5_test.rb"
end

desc 'Spec'
task :spec do
Dir['./spec/processing/*.rb'].each do |sp|
sh "jruby -S rspec #{sp}"
end
end

desc 'Clean'
task :clean do
Dir['./**/*.%w{jar gem}'].each do |path|
Expand Down
13 changes: 9 additions & 4 deletions ext/monkstone/ColorUtil.java
@@ -1,7 +1,12 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
/**
* The purpose of this uilit is to allow ruby-processing users to use an alternative
* to processing.org color their sketches (to cope with ruby FixNumber vs java int)
* Copyright (C) 2015 Martin Prout. This tool is free software; you can
* redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* Obtain a copy of the license at http://www.gnu.org/licenses/lgpl-2.1.html
*/
package monkstone;

Expand Down
37 changes: 3 additions & 34 deletions lib/ruby-processing/helper_methods.rb
@@ -1,8 +1,10 @@
# processing module wrapper
require_relative '../rpextras'


module Processing
# Provides some convenience methods available in vanilla processing
Java::Monkstone::MathToolLibrary.new.load(JRuby.runtime, false)
module HelperMethods
# processings epsilon may not be defined yet
EPSILON ||= 1.0e-04
Expand Down Expand Up @@ -59,40 +61,7 @@ def thread(&block)
def map(value, start1, stop1, start2, stop2)
start2 + (stop2 - start2) * ((value - start1).to_f / (stop1 - start1))
end

# ruby alternative implementation of map using range parameters
# (begin..end) and excluded end (begin...end) produce the same result
def map1d(val, r_in, r_out)
r_out.begin + (r_out.end - r_out.begin) *
((val - r_in.begin).to_f / (r_in.end - r_in.begin))
end

# Explicitly provides 'processing.org' map instance method, where
# value is mapped from range 1 to range 2 where values are clamped to
# range 2.
# @param val input
# @param [r_in] start1, stop1
# @param [r_out] start2, stop2
# @return mapped value
def constrained_map(val, r_in, r_out)
unless r_in.include? val
return r_out.begin if (val < r_in.begin && r_in.begin < r_in.end) ||
(val > r_in.begin && r_in.begin > r_in.end)
return r_out.end
end
r_out.begin + (r_out.end - r_out.begin) *
((val - r_in.begin).to_f / (r_in.end - r_in.begin))
end

# explicitly provide 'processing.org' norm instance method
def norm(value, start, stop)
(value - start).to_f / (stop - start)
end

# explicitly provide 'processing.org' lerp instance method
def lerp(start, stop, amt)
start + (stop - start) * amt
end
# deprecate :map, :p5map, 2015, 12

# explicitly provide 'processing.org' min instance method
# to return a float:- a, b and c need to be floats
Expand Down
9 changes: 5 additions & 4 deletions ruby-processing.gemspec
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.email = "jeremy@ashkenas.com"
spec.description = <<-EOS
Ruby-Processing is a ruby wrapper for the processing-2.0 art framework.
This version supports processing-2.2.1, and uses jruby-complete-1.7.XX or an
This version supports processing-2.2.1, and uses jruby-complete-1.7.22 or an
installed jruby as the glue between ruby and java. Use both processing
libraries and ruby gems in your sketches. The "watch" mode, provides a
nice REPL-ish way to work on your processing sketches.
Expand All @@ -31,10 +31,11 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]
spec.required_ruby_version = '>= 1.9.3'

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake", "~> 10.3"
spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "rake", "~> 10.4"
spec.add_development_dependency "rake-compiler", "~> 0.9"
spec.add_development_dependency "minitest", "~> 5.3"
spec.add_development_dependency "minitest", "~> 5.8"
spec.add_development_dependency "rspec", "~> 3.3"
spec.requirements << 'A decent graphics card'
spec.requirements << 'java runtime >= 1.7+'
spec.requirements << 'processing = 2.2.1'
Expand Down
28 changes: 0 additions & 28 deletions spec/arc_spec.rb

This file was deleted.

24 changes: 0 additions & 24 deletions spec/deglut_spec.rb

This file was deleted.

134 changes: 0 additions & 134 deletions spec/helper_methods_spec.rb

This file was deleted.

13 changes: 0 additions & 13 deletions spec/let_spec.rb

This file was deleted.

0 comments on commit 214349e

Please sign in to comment.