Skip to content

Commit b93620f

Browse files
Update gems, start ruby from a <script>
1 parent b394bb0 commit b93620f

6 files changed

Lines changed: 99 additions & 109 deletions

File tree

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
source 'https://rubygems.org'
22

3-
gem "opal", "~> 0.7.2"
3+
gem "opal", "~> 0.10.5"
44
gem "opal-jquery"
5-
gem "middleman", "~> 3.4.1"
6-
gem "middleman-livereload", "~> 3.4.6"
5+
gem "middleman", "~> 4.2.1"
6+
gem "middleman-livereload"
77
gem "middleman-syntax"
88
gem "middleman-sprockets"
99
gem "middleman-blog"

Gemfile.lock

Lines changed: 80 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,153 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (4.2.8)
5-
i18n (~> 0.7)
4+
activesupport (5.0.7)
5+
concurrent-ruby (~> 1.0, >= 1.0.2)
6+
i18n (>= 0.7, < 2)
67
minitest (~> 5.1)
7-
thread_safe (~> 0.3, >= 0.3.4)
88
tzinfo (~> 1.1)
9-
addressable (2.3.8)
10-
capybara (2.4.4)
11-
mime-types (>= 1.16)
12-
nokogiri (>= 1.3.3)
13-
rack (>= 1.0.0)
14-
rack-test (>= 0.5.4)
15-
xpath (~> 2.0)
16-
chunky_png (1.3.8)
9+
addressable (2.5.2)
10+
public_suffix (>= 2.0.2, < 4.0)
11+
backports (3.11.3)
1712
coffee-script (2.4.1)
1813
coffee-script-source
1914
execjs
2015
coffee-script-source (1.12.2)
21-
compass (1.0.3)
22-
chunky_png (~> 1.2)
23-
compass-core (~> 1.0.2)
24-
compass-import-once (~> 1.0.5)
25-
rb-fsevent (>= 0.9.3)
26-
rb-inotify (>= 0.9)
27-
sass (>= 3.3.13, < 3.5)
28-
compass-core (1.0.3)
29-
multi_json (~> 1.0)
30-
sass (>= 3.3.0, < 3.5)
3116
compass-import-once (1.0.5)
3217
sass (>= 3.2, < 3.5)
18+
concurrent-ruby (1.0.5)
19+
contracts (0.13.0)
20+
dotenv (2.4.0)
3321
em-websocket (0.5.1)
3422
eventmachine (>= 0.12.9)
3523
http_parser.rb (~> 0.6.0)
3624
erubis (2.7.0)
37-
eventmachine (1.2.3)
25+
eventmachine (1.2.7)
3826
execjs (2.7.0)
39-
ffi (1.9.18)
27+
fast_blank (1.0.0)
28+
fastimage (2.1.3)
29+
ffi (1.9.23)
4030
haml (4.0.7)
4131
tilt
32+
hamster (3.0.0)
33+
concurrent-ruby (~> 1.0)
34+
hashie (3.5.7)
4235
hike (1.2.3)
43-
hooks (0.4.1)
44-
uber (~> 0.0.14)
4536
http_parser.rb (0.6.0)
4637
i18n (0.7.0)
47-
json (2.1.0)
48-
kramdown (1.13.2)
38+
kramdown (1.16.2)
4939
libv8 (3.16.14.19)
5040
listen (3.0.8)
5141
rb-fsevent (~> 0.9, >= 0.9.4)
5242
rb-inotify (~> 0.9, >= 0.9.7)
53-
middleman (3.4.1)
43+
memoist (0.16.0)
44+
middleman (4.2.1)
5445
coffee-script (~> 2.2)
55-
compass (>= 1.0.0, < 2.0.0)
5646
compass-import-once (= 1.0.5)
57-
execjs (~> 2.0)
5847
haml (>= 4.0.5)
5948
kramdown (~> 1.2)
60-
middleman-core (= 3.4.1)
61-
middleman-sprockets (>= 3.1.2)
49+
middleman-cli (= 4.2.1)
50+
middleman-core (= 4.2.1)
6251
sass (>= 3.4.0, < 4.0)
63-
uglifier (~> 2.5)
64-
middleman-blog (3.5.3)
65-
addressable (~> 2.3.5)
66-
middleman-core (~> 3.2)
52+
middleman-blog (4.0.2)
53+
addressable (~> 2.3)
54+
middleman-core (~> 4.0)
6755
tzinfo (>= 0.3.0)
68-
middleman-core (3.4.1)
69-
activesupport (~> 4.1)
56+
middleman-cli (4.2.1)
57+
thor (>= 0.17.0, < 2.0)
58+
middleman-core (4.2.1)
59+
activesupport (>= 4.2, < 5.1)
60+
addressable (~> 2.3)
61+
backports (~> 3.6)
7062
bundler (~> 1.1)
71-
capybara (~> 2.4.4)
63+
contracts (~> 0.13.0)
64+
dotenv
7265
erubis
73-
hooks (~> 0.3)
66+
execjs (~> 2.0)
67+
fast_blank
68+
fastimage (~> 2.0)
69+
hamster (~> 3.0)
70+
hashie (~> 3.4)
7471
i18n (~> 0.7.0)
75-
listen (~> 3.0.3)
76-
padrino-helpers (~> 0.12.3)
77-
rack (>= 1.4.5, < 2.0)
78-
thor (>= 0.15.2, < 2.0)
79-
tilt (~> 1.4.1, < 2.0)
72+
listen (~> 3.0.0)
73+
memoist (~> 0.14)
74+
padrino-helpers (~> 0.13.0)
75+
parallel
76+
rack (>= 1.4.5, < 3)
77+
sass (>= 3.4)
78+
servolux
79+
tilt (~> 2.0)
80+
uglifier (~> 3.0)
8081
middleman-gh-pages (0.3.1)
8182
rake (> 0.9.3)
8283
middleman-livereload (3.4.6)
8384
em-websocket (~> 0.5.1)
8485
middleman-core (>= 3.3)
8586
rack-livereload (~> 0.3.15)
86-
middleman-sprockets (3.5.0)
87-
middleman-core (>= 3.3)
88-
sprockets (~> 2.12.1)
89-
sprockets-helpers (~> 1.1.0)
90-
sprockets-sass (~> 1.3.0)
87+
middleman-sprockets (4.1.1)
88+
middleman-core (~> 4.0)
89+
sprockets (>= 3.0)
9190
middleman-syntax (3.0.0)
9291
middleman-core (>= 3.2)
9392
rouge (~> 2.0)
94-
mime-types (3.1)
95-
mime-types-data (~> 3.2015)
96-
mime-types-data (3.2016.0521)
97-
mini_portile2 (2.1.0)
98-
minitest (5.10.2)
99-
multi_json (1.12.1)
100-
nokogiri (1.7.2)
101-
mini_portile2 (~> 2.1.0)
102-
opal (0.7.2)
93+
minitest (5.11.3)
94+
opal (0.10.5)
10395
hike (~> 1.2)
10496
sourcemap (~> 0.1.0)
105-
sprockets (>= 2.2.3, < 3.0.0)
106-
tilt (~> 1.4)
97+
sprockets (~> 3.1)
98+
tilt (>= 1.4)
10799
opal-jquery (0.4.2)
108100
opal (>= 0.7.0, < 0.11.0)
109-
padrino-helpers (0.12.8.1)
101+
padrino-helpers (0.13.3.4)
110102
i18n (~> 0.6, >= 0.6.7)
111-
padrino-support (= 0.12.8.1)
112-
tilt (~> 1.4.1)
113-
padrino-support (0.12.8.1)
103+
padrino-support (= 0.13.3.4)
104+
tilt (>= 1.4.1, < 3)
105+
padrino-support (0.13.3.4)
114106
activesupport (>= 3.1)
115-
rack (1.6.6)
116-
rack-livereload (0.3.16)
107+
parallel (1.12.1)
108+
public_suffix (3.0.2)
109+
rack (2.0.5)
110+
rack-livereload (0.3.17)
117111
rack
118-
rack-test (0.6.3)
119-
rack (>= 1.0)
120-
rake (12.0.0)
121-
rb-fsevent (0.9.8)
122-
rb-inotify (0.9.8)
123-
ffi (>= 0.5.0)
112+
rake (12.3.1)
113+
rb-fsevent (0.10.3)
114+
rb-inotify (0.9.10)
115+
ffi (>= 0.5.0, < 2)
124116
redcarpet (3.4.0)
125117
ref (2.0.0)
126-
rouge (2.0.7)
127-
sass (3.4.23)
118+
rouge (2.2.1)
119+
sass (3.4.25)
120+
servolux (0.13.0)
128121
sourcemap (0.1.1)
129-
sprockets (2.12.4)
130-
hike (~> 1.2)
131-
multi_json (~> 1.0)
132-
rack (~> 1.0)
133-
tilt (~> 1.1, != 1.3.0)
134-
sprockets-helpers (1.1.0)
135-
sprockets (~> 2.0)
136-
sprockets-sass (1.3.1)
137-
sprockets (~> 2.0)
138-
tilt (~> 1.1)
122+
sprockets (3.7.1)
123+
concurrent-ruby (~> 1.0)
124+
rack (> 1, < 3)
139125
therubyracer (0.12.3)
140126
libv8 (~> 3.16.14.15)
141127
ref
142-
thor (0.19.4)
128+
thor (0.20.0)
143129
thread_safe (0.3.6)
144-
tilt (1.4.1)
145-
tzinfo (1.2.3)
130+
tilt (2.0.8)
131+
tzinfo (1.2.5)
146132
thread_safe (~> 0.1)
147-
uber (0.0.15)
148-
uglifier (2.7.2)
149-
execjs (>= 0.3.0)
150-
json (>= 1.8.0)
151-
xpath (2.0.0)
152-
nokogiri (~> 1.3)
133+
uglifier (3.2.0)
134+
execjs (>= 0.3.0, < 3)
153135

154136
PLATFORMS
155137
ruby
156138

157139
DEPENDENCIES
158140
haml (~> 4.0.7)
159-
middleman (~> 3.4.1)
141+
middleman (~> 4.2.1)
160142
middleman-blog
161143
middleman-gh-pages
162-
middleman-livereload (~> 3.4.6)
144+
middleman-livereload
163145
middleman-sprockets
164146
middleman-syntax
165-
opal (~> 0.7.2)
147+
opal (~> 0.10.5)
166148
opal-jquery
167149
redcarpet
168150
therubyracer
169151

170152
BUNDLED WITH
171-
1.12.5
153+
1.16.1

source/index.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ description: Learn to program in Ruby in 15 minutes
8484
</div>
8585
</div>
8686
</div>
87+
88+
<script>Opal.load('try_ruby');</script>

source/javascripts/application.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
//= require opal
2-
//= require opal-parser
3-
//= require opal-jquery
4-
//= require try_ruby
1+
//= require try_ruby
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
require 'opal'
2+
require 'opal-parser'
3+
require 'opal-jquery'
4+
15
INITIAL_TRY_CODE = <<-RUBY
26
3.times do
37
print 'Welcome '
@@ -230,7 +234,9 @@ def do_run
230234
return if source.empty?
231235

232236
# Add additional code if available
233-
source = "#{@current_item.load_code}\n#{source}" if @loaded && @current_item && @current_item.load_code
237+
if @loaded && @current_item && @current_item.load_code
238+
source = "#{@current_item.load_code}\n#{source}"
239+
end
234240

235241
# Compile
236242
begin
@@ -356,8 +362,7 @@ def print_to_output(str, term = "\n")
356362
end
357363
end
358364

359-
# Start TryRuby when document is loaded and ready
360-
Document.ready? do
365+
def start_tryruby
361366
# Bind puts and print methods. Make sure they return a string, not an array
362367
def $stdout.puts(*strs)
363368
strs.each { |str| TryRuby.instance.print_to_output str}
@@ -372,3 +377,5 @@ def $stdout.print(*strs)
372377
# Start TryRuby
373378
TryRuby.instance
374379
end
380+
381+
start_tryruby

source/playground.html.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ description: Play around with Ruby programs
3838

3939
</div>
4040
</div>
41-
</div>
41+
</div>
42+
43+
<script>Opal.load('try_ruby');</script>

0 commit comments

Comments
 (0)