Skip to content

Commit 0bf74c8

Browse files
committed
Convert to us atom-space-pen-views-plus for secrity
1 parent a273001 commit 0bf74c8

5 files changed

Lines changed: 204 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.6.1 - For security and efficiency use atom-pen-views-plus
2+
13
## 1.0.1 - Got rid of those pesky js files (how did they get there?)
24

35
## 1.0.0 - De-caffeinated version, inlude mystery js files in menus and and keymaps folders

examples/atom_test.rb

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,52 @@
1+
attr_reader :pos, :vel, :boundary
2+
3+
# boundary helper
4+
Boundary = Struct.new(:low, :high) do
5+
def include?(val)
6+
(low..high).include?(val)
7+
end
8+
end
9+
10+
RADIUS = 30
11+
112
def settings
2-
size 200, 200
13+
size 300, 300
314
end
415

516
def setup
617
sketch_title 'Atom-K9 Test'
18+
@boundary = Boundary.new(RADIUS, width - RADIUS)
19+
@pos = Vec2D.new(
20+
rand(RADIUS..boundary.high),
21+
rand(RADIUS..boundary.high)
22+
)
23+
@vel = Vec2D.new(
24+
rand(2.0..3),
25+
rand(2.0..3)
26+
)
727
puts 'Running Dummy Sketch From Atom'
8-
no_loop
28+
end
29+
30+
def update
31+
@pos += vel
32+
check_boundary
933
end
1034

1135
def draw
1236
background 0, 200, 0
37+
update
38+
fill 200, 0, 0
39+
circle(pos.x, pos.y, RADIUS * 2)
40+
end
41+
42+
def check_boundary
43+
max = boundary.high
44+
unless boundary.include?(pos.x)
45+
pos.x = (pos.x > max ? max : RADIUS)
46+
vel.x *= -1
47+
end
48+
return if boundary.include?(pos.y)
49+
50+
pos.y > max ? max : pos.y = RADIUS
51+
vel.y *= -1
1352
end

lib/atom-k9-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use babel';
22

3-
import { ScrollView, $$ } from 'atom-space-pen-views';
3+
import { ScrollView, $$ } from 'atom-space-pen-views-plus';
44

55
export default class JRubyArtView extends ScrollView {
66

package-lock.json

Lines changed: 157 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "atom-k9",
33
"main": "./lib/atom-k9",
4-
"version": "1.6.0",
4+
"version": "1.6.1",
55
"description": "Watch JRubyArt sketches in Atom",
66
"keywords": [
77
"jruby_art",
@@ -22,9 +22,9 @@
2222
"repository": "https://github.com/ruby-processing/atom-k9",
2323
"license": "MIT",
2424
"engines": {
25-
"atom": ">=1.0.0 <2.0.0"
25+
"atom": ">=1.50.0 <2.0.0"
2626
},
2727
"dependencies": {
28-
"atom-space-pen-views": "^2.0.3"
28+
"atom-space-pen-views-plus": "^3.0.4"
2929
}
3030
}

0 commit comments

Comments
 (0)