Skip to content

Commit 4fb4a99

Browse files
committed
reintroduced bullring, fixed logic attr_accessible problem
1 parent e7e7fd3 commit 4fb4a99

File tree

6 files changed

+44
-43
lines changed

6 files changed

+44
-43
lines changed

.rvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rvm --create ruby-1.9.3@quadbase
1+
rvm --create ruby-1.9.3-p194@quadbase

Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ gem 'jsonify-rails', '~> 0.3.2'
4545
gem 'execjs', '~> 1.4.0'
4646
gem 'therubyracer', '~> 0.10.1'
4747

48-
gem 'bullring', '~> 0.7.4'
48+
gem 'bullring', '~> 0.8.1'
4949

5050
group :development, :test do
5151
gem 'sqlite3', '~> 1.3.6'
52-
gem 'ruby-debug19', '~> 0.11.6'
52+
gem 'debugger', '~> 1.1.4'
5353
gem 'faker', '~> 1.0.1'
5454
gem 'factory_girl_rails', '~> 3.4.0'
5555
gem 'timecop', '~> 0.3.5'
56+
gem 'thin', '~> 1.3.1'
57+
gem 'quiet_assets', '~> 1.0.1'
5658
end
5759

5860
gem 'single_test', '~> 0.5.1'

Gemfile.lock

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ GEM
3030
multi_json (~> 1.0)
3131
acts-as-taggable-on (2.3.1)
3232
rails (~> 3.0)
33-
archive-tar-minitar (0.5.2)
3433
arel (3.0.2)
3534
bcrypt-ruby (3.0.1)
3635
bcrypt-ruby (3.0.1-x86-mingw32)
3736
blankslate (2.1.2.4)
3837
builder (3.0.0)
39-
bullring (0.7.4)
38+
bullring (0.8.1)
4039
execjs
4140
therubyracer
4241
therubyrhino
@@ -56,12 +55,21 @@ GEM
5655
execjs
5756
coffee-script-source (1.3.3)
5857
columnize (0.3.6)
58+
daemons (1.1.8)
59+
debugger (1.1.4)
60+
columnize (>= 0.3.1)
61+
debugger-linecache (~> 1.1.1)
62+
debugger-ruby_core_source (~> 1.1.3)
63+
debugger-linecache (1.1.1)
64+
debugger-ruby_core_source (>= 1.1.1)
65+
debugger-ruby_core_source (1.1.3)
5966
devise (2.1.0)
6067
bcrypt-ruby (~> 3.0)
6168
orm_adapter (~> 0.0.7)
6269
railties (~> 3.1)
6370
warden (~> 1.1.1)
6471
erubis (2.7.0)
72+
eventmachine (0.12.10)
6573
execjs (1.4.0)
6674
multi_json (~> 1.0)
6775
factory_girl (3.4.0)
@@ -85,8 +93,6 @@ GEM
8593
actionpack
8694
jsonify (< 0.4.0)
8795
libv8 (3.3.10.4)
88-
linecache19 (0.5.12)
89-
ruby_core_source (>= 0.1.4)
9096
mail (2.4.4)
9197
i18n (>= 0.4.0)
9298
mime-types (~> 1.16)
@@ -114,6 +120,8 @@ GEM
114120
polyamorous (0.5.0)
115121
activerecord (~> 3.0)
116122
polyglot (0.3.3)
123+
quiet_assets (1.0.1)
124+
railties (~> 3.1)
117125
rack (1.4.1)
118126
rack-cache (1.2)
119127
rack (>= 0.4)
@@ -143,16 +151,6 @@ GEM
143151
rdoc (3.12)
144152
json (~> 1.4)
145153
recaptcha (0.3.4)
146-
ruby-debug-base19 (0.11.25)
147-
columnize (>= 0.3.1)
148-
linecache19 (>= 0.5.11)
149-
ruby_core_source (>= 0.1.4)
150-
ruby-debug19 (0.11.6)
151-
columnize (>= 0.3.1)
152-
linecache19 (>= 0.5.11)
153-
ruby-debug-base19 (>= 0.11.19)
154-
ruby_core_source (0.1.5)
155-
archive-tar-minitar (>= 0.5.2)
156154
sass (3.1.19)
157155
sass-rails (3.2.5)
158156
railties (~> 3.2.0)
@@ -173,6 +171,10 @@ GEM
173171
therubyracer (0.10.1)
174172
libv8 (~> 3.3.10)
175173
therubyrhino (1.73.4)
174+
thin (1.3.1)
175+
daemons (>= 1.0.9)
176+
eventmachine (>= 0.12.6)
177+
rack (>= 1.0.0)
176178
thor (0.15.2)
177179
tilt (1.3.3)
178180
timecop (0.3.5)
@@ -195,9 +197,10 @@ PLATFORMS
195197

196198
DEPENDENCIES
197199
acts-as-taggable-on (~> 2.3.1)
198-
bullring (~> 0.7.4)
200+
bullring (~> 0.8.1)
199201
capistrano (~> 2.12.0)
200202
coffee-rails (~> 3.2.2)
203+
debugger (~> 1.1.4)
201204
devise (~> 2.1.0)
202205
execjs (~> 1.4.0)
203206
factory_girl_rails (~> 3.4.0)
@@ -209,16 +212,17 @@ DEPENDENCIES
209212
mysql2 (~> 0.3.11)
210213
paperclip (~> 3.0.4)
211214
parslet (~> 1.4.0)
215+
quiet_assets (~> 1.0.1)
212216
rack-ssl-enforcer (~> 0.2.4)
213217
rails (= 3.2.4)
214218
rails3-jquery-autocomplete (~> 1.0.7)
215219
recaptcha (~> 0.3.4)
216-
ruby-debug19 (~> 0.11.6)
217220
sass-rails (~> 3.2.5)
218221
single_test (~> 0.5.1)
219222
sqlite3 (~> 1.3.6)
220223
squeel (~> 1.0.5)
221224
therubyracer (~> 0.10.1)
225+
thin (~> 1.3.1)
222226
timecop (~> 0.3.5)
223227
uglifier (~> 1.2.4)
224228
will_paginate (~> 3.0.3)

app/models/logic.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Logic < ActiveRecord::Base
2020
serialize :variables_array
2121
serialize :required_logic_library_version_ids
2222

23-
attr_accessible :variables
23+
attr_accessible :variables, :code, :required_logic_library_version_ids
2424

2525
JS_RESERVED_WORDS_REGEX = /^(do|if|in|for|let|new|try|var|case|else|enum|eval|
2626
false|null|this|true|void|with|break|catch|class|
@@ -35,8 +35,6 @@ class Logic < ActiveRecord::Base
3535
VARIABLE_REGEX = /^[_a-zA-Z]{1}\w*$/
3636

3737
def run(options = {})
38-
return Output.new # temp fix to block bullring
39-
4038
options[:seed] ||= rand(2e9)
4139
options[:prior_output] ||= Output.new
4240
options[:library_version_ids] ||= required_logic_library_version_ids
@@ -80,8 +78,6 @@ def content_copy
8078
protected
8179

8280
def code_compiles
83-
errors.add(:base, "Logic authoring temporarily disabled") if !code.blank?; return false # Temp fix to block bullring
84-
8581
code_errors = Bullring.check(code)
8682
code_errors.each do |code_error|
8783
next if code_error.nil?

app/models/logic_library_version.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def v_dot
3030
end
3131

3232
def send_to_bullring
33-
raise NotYetImplemented # temp fix to block Bullring
3433
Bullring.add_library(id.to_s, code)
3534
end
3635

config/initializers/bullring.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Copyright 2011-2012 Rice University. Licensed under the Affero General Public
22
# License version 3 or later. See the COPYRIGHT file for details.
33

4-
# Bullring.logger = Rails.logger
5-
#
6-
# Bullring.configure do |config|
7-
# config.execution_timeout_secs = 0.3
8-
# config.server_port = 3033
9-
# config.jvm_init_heap_size = '80m'
10-
# config.jvm_max_heap_size = '80m'
11-
# config.jvm_young_heap_size = '40m'
12-
# config.server_max_bringup_time = 40
13-
# end
14-
#
15-
# # Give Bullring all the library scripts, don't do this until the migration
16-
# # actually sets up the table!
17-
# if ActiveRecord::Base.connection.tables.include?("logic_library_versions")
18-
# LogicLibraryVersion.all.each do |version|
19-
# version.send_to_bullring
20-
# end
21-
# end
4+
Bullring.logger = Rails.logger
5+
6+
Bullring.configure do |config|
7+
config.execution_timeout_secs = 0.3
8+
config.first_server_port = 3033
9+
config.jvm_init_heap_size = '80m'
10+
config.jvm_max_heap_size = '80m'
11+
config.jvm_young_heap_size = '40m'
12+
config.server_max_bringup_time = 40
13+
end
14+
15+
# Give Bullring all the library scripts, don't do this until the migration
16+
# actually sets up the table!
17+
if ActiveRecord::Base.connection.tables.include?("logic_library_versions")
18+
LogicLibraryVersion.all.each do |version|
19+
version.send_to_bullring
20+
end
21+
end

0 commit comments

Comments
 (0)