picrate 0.6.0-java → 0.7.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.mvn/extensions.xml +1 -1
- data/CHANGELOG.md +2 -0
- data/Rakefile +4 -3
- data/docs/_editors/geany.md +9 -1
- data/docs/_posts/2018-05-06-install_jruby.md +3 -3
- data/docs/about.md +8 -1
- data/docs/assets/new_with_template.png +0 -0
- data/docs/assets/picrate_template.png +0 -0
- data/lib/picrate/creators/parameters.rb +23 -0
- data/lib/picrate/creators/sketch_factory.rb +1 -1
- data/lib/picrate/creators/sketch_writer.rb +56 -13
- data/lib/picrate/runner.rb +2 -1
- data/lib/picrate/version.rb +1 -1
- data/picrate.gemspec +11 -11
- data/pom.rb +2 -2
- data/pom.xml +6 -6
- data/src/main/java/monkstone/MathToolModule.java +1 -1
- data/src/main/java/monkstone/fastmath/Deglut.java +1 -1
- data/src/main/java/monkstone/vecmath/package-info.java +1 -1
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -1
- data/src/main/java/monkstone/videoevent/VideoInterface.java +1 -1
- data/src/main/java/monkstone/videoevent/package-info.java +1 -1
- data/vendors/Rakefile +36 -33
- metadata +11 -12
- data/lib/picrate/creators/sketch_class.rb +0 -57
- data/test/create_test.rb +0 -68
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 503789e011ca3a619d42a03d351463c02e8cf64c8119dab588b8e0f826415ad0
|
4
|
+
data.tar.gz: e2092cab3393155d0a29da02616755a9e4c14e1d5a9ecb9eadec68b248383348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7459a92d1eb700e7c4c3c71f57de09453456768789b1878380e699c118a6e7f382bae314308e8a01cfbf9a601621f826ba91720b981bd049ba330d328605e7da
|
7
|
+
data.tar.gz: 9a84ceac91c0b6f3c26baf6f1eb497ef73cd872940bac442942c55c19ce329fe26a49bb2b87bcb934455de072166948fabea5b3c09594e8d8ad3b7799a214f9c
|
data/.mvn/extensions.xml
CHANGED
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# frozen_string_literal: false
|
2
|
+
|
3
|
+
require 'fileutils'
|
2
4
|
require_relative 'lib/picrate/version'
|
3
5
|
|
4
6
|
HOME_DIR = ENV['HOME']
|
@@ -20,7 +22,7 @@ desc 'Create Manifest and Copy Jars'
|
|
20
22
|
task :init do
|
21
23
|
create_manifest
|
22
24
|
# processing_root = File.dirname(`readlink -f $(which processing)`) # for Archlinux etc
|
23
|
-
processing_root = File.join(HOME_DIR, 'processing-3.
|
25
|
+
processing_root = File.join(HOME_DIR, 'processing-3.5.3') # alternative for debian linux etc
|
24
26
|
jar_dir = File.join(processing_root, 'core', 'library')
|
25
27
|
opengl = Dir.entries(jar_dir).grep(/amd64|armv6hf/).select { |jar| jar =~ /linux/ }
|
26
28
|
opengl.concat %w[jogl-all.jar gluegen-rt.jar]
|
@@ -31,7 +33,7 @@ end
|
|
31
33
|
|
32
34
|
desc 'Install'
|
33
35
|
task :install do
|
34
|
-
|
36
|
+
FileUtils.mv "target/picrate-#{PiCrate::VERSION}.jar", 'lib'
|
35
37
|
end
|
36
38
|
|
37
39
|
desc 'Gem'
|
@@ -53,7 +55,6 @@ desc 'Test'
|
|
53
55
|
task :test do
|
54
56
|
sh 'jruby test/helper_methods_test.rb'
|
55
57
|
sh 'jruby test/respond_to_test.rb' # Skip this test on Travis etc
|
56
|
-
sh 'jruby test/create_test.rb'
|
57
58
|
sh 'jruby test/math_tool_test.rb'
|
58
59
|
sh 'jruby test/deglut_spec_test.rb'
|
59
60
|
sh 'jruby test/vecmath_spec_test.rb'
|
data/docs/_editors/geany.md
CHANGED
@@ -4,12 +4,20 @@ title: "Geany"
|
|
4
4
|
permalink: /editors/geany/
|
5
5
|
keywords: editor, ide, ruby, picrate, vim, emacs, geany
|
6
6
|
---
|
7
|
-
Geany is highly configurable, and we have created a `geany` project file `picrate.geany` and sketch template `picrate.rb` for you,
|
7
|
+
Geany is highly configurable, and we have created a `geany` project file `picrate.geany` and sketch template `picrate.rb` for you, that get installed when you:-
|
8
8
|
|
9
9
|
```bash
|
10
10
|
picrate --install samples
|
11
11
|
```
|
12
12
|
|
13
|
+
#### Using picrate.rb template ####
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
Remember to give untitled sketch a new name (PS: it's easy to create your own templates):-
|
18
|
+
|
19
|
+

|
20
|
+
|
13
21
|
Use `make` to check syntax and `run` to run sketch
|
14
22
|
|
15
23
|
See running sketch below:-
|
@@ -14,7 +14,7 @@ mkdir installer
|
|
14
14
|
cd installer
|
15
15
|
rake
|
16
16
|
```
|
17
|
-
Currently installs jruby-9.2.
|
17
|
+
Currently installs jruby-9.2.7.0
|
18
18
|
|
19
19
|
### Manual install ###
|
20
20
|
|
@@ -25,7 +25,7 @@ Get the latest version from [http://jruby.org/download][download]
|
|
25
25
|
|
26
26
|
```bash
|
27
27
|
cd /opt
|
28
|
-
sudo tar xzvf /pathToDownload/jruby-bin-9.2.
|
28
|
+
sudo tar xzvf /pathToDownload/jruby-bin-9.2.7.0.tar.gz
|
29
29
|
```
|
30
30
|
|
31
31
|
Then use the excellent `update-alternatives` tool to provide symbolic links to `jruby`, `jgem`, `jirb` and `rake` especially if you haven't installed `mri` ruby.
|
@@ -49,5 +49,5 @@ export PATH="${PATH}:${GEM_PATH}/bin"
|
|
49
49
|
|
50
50
|
If you know better please post on wiki
|
51
51
|
|
52
|
-
[download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.
|
52
|
+
[download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.7.0/jruby-dist-9.2.7.0-bin.tar.gz"
|
53
53
|
[rake_gist]:https://gist.github.com/monkstone/159c5a9813c9cd181040b4715e74f6b2
|
data/docs/about.md
CHANGED
@@ -8,7 +8,14 @@ PiCrate is both a `library` and an `app` that allows you to create [processing][
|
|
8
8
|
|
9
9
|
#### Executable ####
|
10
10
|
|
11
|
-
|
11
|
+
PiCrate sketches are executable scripts that (but without the executable permission), that will run directly from jruby.
|
12
|
+
|
13
|
+
|
14
|
+
```bash
|
15
|
+
jruby my_sketch.rb
|
16
|
+
```
|
17
|
+
|
18
|
+
The gem executable is `picrate`, which can be used to install samples (and to configure [GeanyIDE][geany]) and some processing libraries
|
12
19
|
|
13
20
|
#### Library ###
|
14
21
|
|
Binary file
|
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
# module to read sketch.yml
|
7
|
+
# and or create sketch.yml with default parameters
|
8
|
+
module Parameters
|
9
|
+
PATH = File.join(ENV['HOME'], '.picrate').freeze
|
10
|
+
FILE = File.join(PATH, 'sketch.yml').freeze
|
11
|
+
PARAM = { 'sketch' =>
|
12
|
+
{ 'width' => 640, 'height' => 480, 'mode' => 'P2D' } }.freeze
|
13
|
+
|
14
|
+
def self.write
|
15
|
+
FileUtils.mkdir_p PATH
|
16
|
+
File.write(FILE, PARAM.to_yaml)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.read
|
20
|
+
write unless File.exist?(FILE)
|
21
|
+
YAML.load_file(FILE)
|
22
|
+
end
|
23
|
+
end
|
@@ -1,21 +1,64 @@
|
|
1
|
-
# frozen_string_literal:
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'parameters'
|
4
|
+
require 'erb'
|
5
|
+
|
6
|
+
TEMPLATE = ERB.new <<~SKETCH
|
7
|
+
require 'picrate'
|
8
|
+
|
9
|
+
class <%= @class %> < Processing::App
|
10
|
+
def settings
|
11
|
+
size <%= @width %>, <%= @height %>, <%= @mode %>
|
12
|
+
end
|
13
|
+
|
14
|
+
def setup
|
15
|
+
sketch_title '<%= @title %>'
|
16
|
+
end
|
17
|
+
|
18
|
+
def draw
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
<%= @class %>.new
|
24
|
+
SKETCH
|
25
|
+
|
26
|
+
# The SketchClass class knows how to format title & class name
|
27
|
+
class SketchClass
|
28
|
+
attr_reader :name
|
29
|
+
def initialize(name)
|
30
|
+
@name = name
|
31
|
+
end
|
32
|
+
|
33
|
+
def class_name
|
34
|
+
name.split('_').collect(&:capitalize).join
|
35
|
+
end
|
36
|
+
|
37
|
+
def title
|
38
|
+
name.split('_').collect(&:capitalize).join(' ')
|
39
|
+
end
|
40
|
+
|
41
|
+
def filename
|
42
|
+
name << '.rb'
|
43
|
+
end
|
44
|
+
end
|
3
45
|
|
4
46
|
# The file writer can write a sketch when given instance of Sketch type
|
5
47
|
class SketchWriter
|
6
|
-
attr_reader :file, :sketch
|
7
|
-
|
8
|
-
|
9
|
-
@sketch = SketchClass.new(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
)
|
15
|
-
@
|
48
|
+
attr_reader :file, :name, :width, :height, :mode, :sketch
|
49
|
+
def initialize(path)
|
50
|
+
param = Parameters.read
|
51
|
+
@sketch = SketchClass.new(path)
|
52
|
+
@class = sketch.class_name
|
53
|
+
@title = sketch.title
|
54
|
+
sketch_param = param.fetch('sketch')
|
55
|
+
@width = sketch_param.fetch('width')
|
56
|
+
@height = sketch_param.fetch('height')
|
57
|
+
@mode = sketch_param.fetch('mode')
|
58
|
+
binding
|
16
59
|
end
|
17
60
|
|
18
61
|
def write
|
19
|
-
File.open(
|
62
|
+
File.open(sketch.filename, 'w+') { |f| f.write TEMPLATE.result(binding) }
|
20
63
|
end
|
21
64
|
end
|
data/lib/picrate/runner.rb
CHANGED
@@ -63,7 +63,8 @@ module Processing
|
|
63
63
|
|
64
64
|
def create
|
65
65
|
require_relative 'creators/sketch_writer'
|
66
|
-
|
66
|
+
# in case user supplied extension, we remove it
|
67
|
+
SketchWriter.new(File.basename(filename, '.rb')).write
|
67
68
|
end
|
68
69
|
|
69
70
|
def show_version
|
data/lib/picrate/version.rb
CHANGED
data/picrate.gemspec
CHANGED
@@ -4,19 +4,19 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'picrate/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name
|
8
|
-
gem.version
|
9
|
-
gem.authors
|
10
|
-
gem.email
|
11
|
-
gem.licenses
|
12
|
-
gem.description
|
13
|
-
|
14
|
-
|
7
|
+
gem.name = 'picrate'
|
8
|
+
gem.version = PiCrate::VERSION
|
9
|
+
gem.authors = ['monkstone']
|
10
|
+
gem.email = ['mamba2928@yahoo.co.uk']
|
11
|
+
gem.licenses = %w(GPL-3.0 LGPL-2.0)
|
12
|
+
gem.description = <<~EOS
|
13
|
+
A batteries included version of processing in ruby, for raspberrypi and
|
14
|
+
linux. Install samples to configures geany ide.
|
15
15
|
EOS
|
16
|
-
gem.summary
|
17
|
-
gem.homepage
|
16
|
+
gem.summary = %q{ruby wrapper for processing-3.5.3 on raspberrypi and linux64}
|
17
|
+
gem.homepage = 'https://ruby-processing.github.io/PiCrate/'
|
18
18
|
gem.post_install_message = %q{Use 'picrate --install Samples' to install samples}
|
19
|
-
gem.files
|
19
|
+
gem.files = `git ls-files`.split($/)
|
20
20
|
gem.files << "lib/picrate-#{PiCrate::VERSION}.jar"
|
21
21
|
gem.files << 'lib/gluegen-rt.jar'
|
22
22
|
gem.files << 'lib/jogl-all.jar'
|
data/pom.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
project 'picrate', 'http://maven.apache.org' do
|
2
2
|
|
3
3
|
model_version '4.0.0'
|
4
|
-
id 'ruby-processing:picrate:0.
|
4
|
+
id 'ruby-processing:picrate:0.7.0'
|
5
5
|
packaging 'jar'
|
6
6
|
|
7
7
|
description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'
|
@@ -31,7 +31,7 @@ project 'picrate', 'http://maven.apache.org' do
|
|
31
31
|
'project.build.sourceEncoding' => 'utf-8',
|
32
32
|
'polyglot.dump.pom' => 'pom.xml',
|
33
33
|
'maven.compiler.source' => '1.8' )
|
34
|
-
pom 'org.jruby:jruby:9.2.
|
34
|
+
pom 'org.jruby:jruby:9.2.7.0'
|
35
35
|
jar 'org.processing:video:3.2.3'
|
36
36
|
jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
|
37
37
|
jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
|
data/pom.xml
CHANGED
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
|
|
11
11
|
<modelVersion>4.0.0</modelVersion>
|
12
12
|
<groupId>ruby-processing</groupId>
|
13
13
|
<artifactId>picrate</artifactId>
|
14
|
-
<version>0.
|
14
|
+
<version>0.7.0</version>
|
15
15
|
<name>picrate</name>
|
16
16
|
<description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
|
17
17
|
<url>http://maven.apache.org</url>
|
@@ -66,19 +66,19 @@ DO NOT MODIFIY - GENERATED CODE
|
|
66
66
|
<properties>
|
67
67
|
<jogl.version>2.3.2</jogl.version>
|
68
68
|
<jruby.api>http://jruby.org/apidocs/</jruby.api>
|
69
|
-
<source.
|
69
|
+
<maven.compiler.source>1.8</maven.compiler.source>
|
70
70
|
<maven.compiler.target>1.8</maven.compiler.target>
|
71
|
+
<picrate.basedir>${project.basedir}</picrate.basedir>
|
72
|
+
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
|
71
73
|
<processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
|
72
74
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
73
|
-
<
|
74
|
-
<maven.compiler.source>1.8</maven.compiler.source>
|
75
|
-
<picrate.basedir>${project.basedir}</picrate.basedir>
|
75
|
+
<source.directory>src/main</source.directory>
|
76
76
|
</properties>
|
77
77
|
<dependencies>
|
78
78
|
<dependency>
|
79
79
|
<groupId>org.jruby</groupId>
|
80
80
|
<artifactId>jruby</artifactId>
|
81
|
-
<version>9.2.
|
81
|
+
<version>9.2.7.0</version>
|
82
82
|
<type>pom</type>
|
83
83
|
</dependency>
|
84
84
|
<dependency>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* The purpose of this tool is to allow picrate users to use an alternative
|
3
3
|
* to processing.org map, lerp and norm methods in their sketches
|
4
|
-
* Copyright (c) 2018 Martin Prout. This tool is free software; you can
|
4
|
+
* Copyright (c) 2018-19 Martin Prout. This tool is free software; you can
|
5
5
|
* redistribute it and/or modify it under the terms of the GNU Lesser General
|
6
6
|
* Public License as published by the Free Software Foundation; either version
|
7
7
|
* 2.1 of the License, or (at your option) any later version.
|
data/vendors/Rakefile
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fileutils'
|
2
4
|
require 'rake/clean'
|
3
5
|
|
4
|
-
WARNING = 'WARNING: wget download failed you could do a manual download'
|
5
|
-
SOUND = 'sound.zip'
|
6
|
+
WARNING = 'WARNING: wget download failed you could do a manual download'
|
7
|
+
SOUND = 'sound.zip'
|
6
8
|
SOUND_VERSION = 'v1.3.2'
|
7
9
|
GLVIDEO = 'processing-glvideo.zip'
|
8
10
|
VIDEO = 'video-2.zip'
|
9
11
|
VIDEO_VERSION = '2'
|
10
|
-
EXAMPLES = '0.0
|
12
|
+
EXAMPLES = '0.2.0'
|
11
13
|
HOME_DIR = ENV['HOME']
|
12
14
|
CLOBBER.include(EXAMPLES, SOUND, GLVIDEO, VIDEO)
|
13
15
|
|
@@ -15,7 +17,7 @@ desc 'download, and copy picrate examples'
|
|
15
17
|
task default: [:download_and_copy_samples]
|
16
18
|
|
17
19
|
desc 'download and copy examples to user home'
|
18
|
-
task download_and_copy_samples: [
|
20
|
+
task download_and_copy_samples: %i[download_examples copy_examples config_geany]
|
19
21
|
|
20
22
|
task :download_examples
|
21
23
|
file_name = "#{EXAMPLES}.tar.gz"
|
@@ -30,22 +32,23 @@ file file_name do
|
|
30
32
|
end
|
31
33
|
|
32
34
|
desc 'download and copy sound library to ~/.picrate'
|
33
|
-
task download_and_copy_sound: [
|
35
|
+
task download_and_copy_sound: %i[init_dir download_sound copy_sound clobber]
|
34
36
|
|
35
37
|
desc 'download and copy video library to ~/.picrate'
|
36
|
-
task download_and_copy_video: [
|
38
|
+
task download_and_copy_video: %i[init_dir download_video copy_video clobber]
|
37
39
|
|
38
40
|
desc 'download and copy glvideo library to ~/.picrate'
|
39
|
-
task download_and_copy_glvideo: [
|
41
|
+
task download_and_copy_glvideo: %i[init_dir download_glvideo copy_glvideo clobber]
|
40
42
|
|
41
43
|
desc 'download sound library'
|
42
44
|
task :download_sound do
|
43
|
-
wget_base = 'wget https://github.com/processing/processing-sound'
|
44
|
-
wget_string = [wget_base, 'releases/download',
|
45
|
+
wget_base = 'wget https://github.com/processing/processing-sound/'
|
46
|
+
wget_string = [wget_base, 'releases/download/latest', SOUND].join('/')
|
45
47
|
begin
|
46
48
|
sh wget_string
|
47
49
|
rescue
|
48
|
-
|
50
|
+
puts 'Not Currently Available'
|
51
|
+
# warn(WARNING)
|
49
52
|
end
|
50
53
|
end
|
51
54
|
|
@@ -74,52 +77,52 @@ end
|
|
74
77
|
desc 'initialize ~/.picrate directories'
|
75
78
|
task :init_dir do
|
76
79
|
unless File.exist? "#{HOME_DIR}/.picrate/libraries"
|
77
|
-
|
80
|
+
FileUtils.mkdir_p "#{HOME_DIR}/.picrate/libraries"
|
78
81
|
end
|
79
82
|
end
|
80
83
|
|
81
84
|
desc 'configure geany'
|
82
85
|
task :config_geany do
|
83
86
|
unless File.exist? "#{HOME_DIR}/.config/geany/templates/files/picrate.rb"
|
84
|
-
|
85
|
-
|
87
|
+
FileUtils.mkdir_p "#{HOME_DIR}/.config/geany/templates/files"
|
88
|
+
FileUtils.cp 'picrate.rb' "#{HOME_DIR}/.config/geany/templates/files"
|
86
89
|
end
|
87
90
|
unless File.exist? "#{HOME_DIR}/projects/picrate.geany"
|
88
|
-
|
89
|
-
|
91
|
+
FileUtils.mkdir_p "#{HOME_DIR}/projects"
|
92
|
+
FileUtils.cp 'picrate.geany', "#{HOME_DIR}/projects"
|
90
93
|
end
|
91
94
|
end
|
92
95
|
|
93
96
|
desc 'copy examples'
|
94
|
-
task :
|
97
|
+
task copy_examples: file_name do
|
95
98
|
sh "tar xzvf #{EXAMPLES}.tar.gz"
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
+
FileUtils.rm_r "#{HOME_DIR}/picrate_samples" if File.exist? "#{HOME_DIR}/picrate_samples"
|
100
|
+
FileUtils.cp_r "picrate-examples-#{EXAMPLES}", "#{HOME_DIR}/picrate_samples"
|
101
|
+
FileUtils.rm_r "picrate-examples-#{EXAMPLES}"
|
99
102
|
end
|
100
103
|
|
101
104
|
desc 'copy sound library'
|
102
|
-
task :
|
105
|
+
task copy_sound: SOUND do
|
103
106
|
sh "unzip #{SOUND}"
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
107
|
+
FileUtils.rm_r "#{HOME_DIR}/.picrate/libraries/sound" if File.exist? "#{HOME_DIR}/.picrate/libraries/sound"
|
108
|
+
FileUtils.cp_r 'sound', "#{HOME_DIR}/.picrate/libraries"
|
109
|
+
FileUtils.rm_r 'sound'
|
110
|
+
FileUtils.rm_r '__MACOSX'
|
108
111
|
end
|
109
112
|
|
110
113
|
desc 'copy video library'
|
111
|
-
task :
|
114
|
+
task copy_video: VIDEO do
|
112
115
|
sh "unzip #{VIDEO}"
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
+
FileUtils.rm_r "#{HOME_DIR}/.picrate/libraries/video" if File.exist? "#{HOME_DIR}/.picrate/libraries/video"
|
117
|
+
FileUtils.cp_r 'video', "#{HOME_DIR}/.picrate/libraries/video"
|
118
|
+
FileUtils.rm_r 'video'
|
116
119
|
end
|
117
120
|
|
118
121
|
desc 'copy glvideo library'
|
119
|
-
task :
|
120
|
-
directory "
|
122
|
+
task copy_glvideo: GLVIDEO do
|
123
|
+
directory "#{HOME_DIR}/.picrate/libraries/glvideo"
|
121
124
|
sh "unzip #{GLVIDEO}"
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
+
FileUtils.rm_r "#{HOME_DIR}/.picrate/libraries/glvideo" if File.exist? "#{HOME_DIR}/.picrate/libraries/glvideo"
|
126
|
+
FileUtils.cp_r 'glvideo', "#{HOME_DIR}/.picrate/libraries/glvideo"
|
127
|
+
FileUtils.rm_r 'glvideo'
|
125
128
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- monkstone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -58,9 +58,9 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '1.0'
|
61
|
-
description: |
|
62
|
-
|
63
|
-
|
61
|
+
description: |
|
62
|
+
A batteries included version of processing in ruby, for raspberrypi and
|
63
|
+
linux. Install samples to configures geany ide.
|
64
64
|
email:
|
65
65
|
- mamba2928@yahoo.co.uk
|
66
66
|
executables:
|
@@ -157,7 +157,9 @@ files:
|
|
157
157
|
- docs/assets/favicon.ico
|
158
158
|
- docs/assets/geany.png
|
159
159
|
- docs/assets/jwishy_picrate.png
|
160
|
+
- docs/assets/new_with_template.png
|
160
161
|
- docs/assets/picrate.svg
|
162
|
+
- docs/assets/picrate_template.png
|
161
163
|
- docs/classes.md
|
162
164
|
- docs/css/main.scss
|
163
165
|
- docs/editors.md
|
@@ -177,10 +179,10 @@ files:
|
|
177
179
|
- lib/jogl-all-natives-linux-amd64.jar
|
178
180
|
- lib/jogl-all-natives-linux-armv6hf.jar
|
179
181
|
- lib/jogl-all.jar
|
180
|
-
- lib/picrate-0.
|
182
|
+
- lib/picrate-0.7.0.jar
|
181
183
|
- lib/picrate.rb
|
182
184
|
- lib/picrate/app.rb
|
183
|
-
- lib/picrate/creators/
|
185
|
+
- lib/picrate/creators/parameters.rb
|
184
186
|
- lib/picrate/creators/sketch_factory.rb
|
185
187
|
- lib/picrate/creators/sketch_writer.rb
|
186
188
|
- lib/picrate/helper_methods.rb
|
@@ -318,7 +320,6 @@ files:
|
|
318
320
|
- src/main/resources/icon/icon-64.png
|
319
321
|
- src/main/resources/license.txt
|
320
322
|
- test/color_group_test.rb
|
321
|
-
- test/create_test.rb
|
322
323
|
- test/deglut_spec_test.rb
|
323
324
|
- test/helper_methods_test.rb
|
324
325
|
- test/math_tool_test.rb
|
@@ -351,14 +352,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
351
352
|
version: '0'
|
352
353
|
requirements:
|
353
354
|
- java runtime >= 1.8.0_161+
|
354
|
-
|
355
|
-
rubygems_version: 2.7.8
|
355
|
+
rubygems_version: 3.0.1
|
356
356
|
signing_key:
|
357
357
|
specification_version: 4
|
358
|
-
summary: ruby wrapper for processing-3.
|
358
|
+
summary: ruby wrapper for processing-3.5.3 on raspberrypi and linux64
|
359
359
|
test_files:
|
360
360
|
- test/color_group_test.rb
|
361
|
-
- test/create_test.rb
|
362
361
|
- test/deglut_spec_test.rb
|
363
362
|
- test/helper_methods_test.rb
|
364
363
|
- test/math_tool_test.rb
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: false
|
2
|
-
|
3
|
-
# the sketch class
|
4
|
-
class SketchClass
|
5
|
-
attr_reader :name, :width, :height, :mode
|
6
|
-
|
7
|
-
def initialize(name:, width: 150, height: 150, mode: nil)
|
8
|
-
@name, @width, @height, @mode = name, width, height, mode
|
9
|
-
end
|
10
|
-
|
11
|
-
def class_sketch
|
12
|
-
format('class %s < Processing::App', sketch_class)
|
13
|
-
end
|
14
|
-
|
15
|
-
def sketch_class
|
16
|
-
name.split('_').collect(&:capitalize).join
|
17
|
-
end
|
18
|
-
|
19
|
-
def sketch_new
|
20
|
-
format('%s.new', sketch_class)
|
21
|
-
end
|
22
|
-
|
23
|
-
def indent(line)
|
24
|
-
format(' %s', line)
|
25
|
-
end
|
26
|
-
|
27
|
-
def size
|
28
|
-
return format(' size %d, %d', width.to_i, height.to_i) unless mode
|
29
|
-
format(' size %d, %d, %s', width.to_i, height.to_i, mode.upcase)
|
30
|
-
end
|
31
|
-
|
32
|
-
def sketch_title
|
33
|
-
human = name.split('_').collect(&:capitalize).join(' ')
|
34
|
-
format(" sketch_title '%s'", human)
|
35
|
-
end
|
36
|
-
|
37
|
-
def method_lines(name, content = nil)
|
38
|
-
return [format(' def %s', name), '', ' end'] unless content
|
39
|
-
[format(' def %s', name), content, ' end', '']
|
40
|
-
end
|
41
|
-
|
42
|
-
def lines
|
43
|
-
lines = [
|
44
|
-
'#!/usr/bin/env jruby',
|
45
|
-
'# frozen_string_literal: false',
|
46
|
-
"require 'picrate'",
|
47
|
-
'',
|
48
|
-
class_sketch
|
49
|
-
]
|
50
|
-
lines.concat method_lines('settings', size)
|
51
|
-
lines.concat method_lines('setup', sketch_title)
|
52
|
-
lines.concat method_lines('draw')
|
53
|
-
lines << 'end'
|
54
|
-
lines << ''
|
55
|
-
lines << sketch_new
|
56
|
-
end
|
57
|
-
end
|
data/test/create_test.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
require_relative 'test_helper'
|
2
|
-
require_relative '../lib/picrate/creators/sketch_class'
|
3
|
-
require_relative '../lib/picrate/creators/sketch_writer'
|
4
|
-
|
5
|
-
CLASS_SKETCH = <<~CODE
|
6
|
-
|
7
|
-
#!/usr/bin/env jruby
|
8
|
-
# frozen_string_literal: false
|
9
|
-
require 'picrate'
|
10
|
-
|
11
|
-
class FredSketch < Processing::App
|
12
|
-
def settings
|
13
|
-
size 200, 200
|
14
|
-
end
|
15
|
-
|
16
|
-
def setup
|
17
|
-
sketch_title 'Fred Sketch'
|
18
|
-
end
|
19
|
-
|
20
|
-
def draw
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
FredSketch.new
|
26
|
-
|
27
|
-
CODE
|
28
|
-
|
29
|
-
class SketchClassTest < Minitest::Test
|
30
|
-
|
31
|
-
def setup
|
32
|
-
@basic = SketchClass.new(name: 'fred_sketch', width: 200, height: 200)
|
33
|
-
@sketch = SketchClass.new(name: 'fred_sketch', width: 200, height: 200, mode: 'p2d')
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_class
|
37
|
-
result = CLASS_SKETCH.split(/\n/, -1)
|
38
|
-
class_lines = @sketch.lines
|
39
|
-
class_lines.each_with_index do |line, i|
|
40
|
-
assert_equal result[i], line
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_indent
|
45
|
-
assert_equal ' indent', @sketch.indent('indent')
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_size
|
49
|
-
assert_equal ' size 200, 200, P2D', @sketch.size
|
50
|
-
assert_equal ' size 200, 200', @basic.size
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_sketch_title
|
54
|
-
assert_equal " sketch_title 'Fred Sketch'", @sketch.sketch_title
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_class
|
58
|
-
assert_equal "FredSketch", @sketch.sketch_class
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_class_new
|
62
|
-
assert_equal "FredSketch.new", @sketch.sketch_new
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_sketch_class
|
66
|
-
assert_equal "class FredSketch < Processing::App", @basic.class_sketch
|
67
|
-
end
|
68
|
-
end
|