coffee-processing 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,4 +1,16 @@
1
+ 0.0.3
2
+ =====
3
+ - Constants (e.g. `P3D`, `RGB`) are now directly accessible without `processing` variable or shortcut methods.
4
+ - The same holds true for `ArrayList`, `HashMap`, `PVector`, `ObjectIterator` and `PConstants`
5
+
1
6
  0.0.2
2
7
  =====
3
8
  - Prevents accidental assignment of `processing` variable which breaks the sketch.
4
9
 
10
+ ```coffee
11
+ # This used to break the whole sketch
12
+ processing = null
13
+
14
+ setup = -> # ...
15
+ ```
16
+
data/README.md CHANGED
@@ -67,14 +67,15 @@ usage: coffee-processing [--template] <js object name> <sketch file>
67
67
  Caveats
68
68
  -------
69
69
 
70
- Instance variables of Processing object, such as `width`, `frameCount` and `__mousePressed` (among others)
70
+ Non-constant, instance variables of Processing object,
71
+ such as `width`, `frameCount` and `__mousePressed` (among others)
71
72
  should be accessed through their corresponding shortcut functions as follows.
72
73
 
73
74
  ```coffee
74
- # P3D, __mousePressed, frameCount, width and height are functions, not values.
75
+ # __mousePressed, frameCount, width and height are functions, not values.
75
76
 
76
77
  setup = ->
77
- size 100, 100, P3D()
78
+ size 100, 100, P3D
78
79
 
79
80
  draw = ->
80
81
  if __mousePressed()
@@ -89,7 +90,7 @@ This is slightly more efficient.
89
90
  p5 = processing
90
91
 
91
92
  setup = ->
92
- size 100, 100, p5.P3D
93
+ size 100, 100, P3D
93
94
 
94
95
  draw = ->
95
96
  if p5.__mousePressed
@@ -101,6 +102,8 @@ Examples
101
102
 
102
103
  Check out [examples](https://github.com/junegunn/coffee-processing/tree/master/examples) directory.
103
104
 
105
+ Also check out [a Sinatra demo app](https://github.com/junegunn/coffee-processing-live).
106
+
104
107
  Contributing
105
108
  ------------
106
109
 
@@ -4,7 +4,13 @@
4
4
  eval "var #{__sym} = function() { return __processing.#{__sym}.apply(__processing, arguments) }"
5
5
  else
6
6
  eval "var #{__sym} = function() { return __processing.#{__sym} }"
7
- null
7
+
8
+ for __const of __processing.PConstants
9
+ eval "var #{__const} = __processing.PConstants.#{__const}"
10
+
11
+ for __sym in ['ArrayList', 'HashMap', 'PVector', 'ObjectIterator', 'PConstants']
12
+ eval "var #{__sym} = __processing.#{__sym}"
13
+
8
14
  processing = __processing
9
15
 
10
16
  <%= code %>
@@ -1,3 +1,3 @@
1
1
  module CoffeeProcessing
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+ # gunn@daumcorp.com
4
+
5
+ # DISCLAIMER:
6
+ # Not a real test!
7
+ # Just a helper script for running scripts with local source
8
+
9
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '../lib')
10
+ load File.join(File.dirname(__FILE__), '../bin/', File.basename(ARGV.shift))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffee-processing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-26 00:00:00.000000000 Z
12
+ date: 2012-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: coffee-script
16
- requirement: &2156567920 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 2.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156567920
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.2.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: erubis
27
- requirement: &2156565480 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: 2.7.0
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *2156565480
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 2.7.0
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: test-unit
38
- requirement: &2156564900 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,7 +53,12 @@ dependencies:
43
53
  version: 2.4.8
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *2156564900
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.4.8
47
62
  description: Helps writing Processing.js sketches in Coffeescript
48
63
  email:
49
64
  - junegunn.c@gmail.com
@@ -67,6 +82,7 @@ files:
67
82
  - lib/coffee-processing/boilerplate.coffee.erb
68
83
  - lib/coffee-processing/template.html.erb
69
84
  - lib/coffee-processing/version.rb
85
+ - test/bin_helper.rb
70
86
  - test/test_coffee_processing.rb
71
87
  homepage: https://github.com/junegunn/coffee-processing
72
88
  licenses: []
@@ -88,9 +104,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
104
  version: '0'
89
105
  requirements: []
90
106
  rubyforge_project:
91
- rubygems_version: 1.8.11
107
+ rubygems_version: 1.8.24
92
108
  signing_key:
93
109
  specification_version: 3
94
110
  summary: Helps writing Processing.js sketches in Coffeescript
95
111
  test_files:
112
+ - test/bin_helper.rb
96
113
  - test/test_coffee_processing.rb