mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 08:55:25 +08:00
don't keep installing gabbler from bench
fix ab detection
This commit is contained in:
parent
cab6a3f339
commit
6a0072d36e
@ -29,7 +29,8 @@ begin
|
|||||||
require 'facter'
|
require 'facter'
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
run "gem install facter"
|
run "gem install facter"
|
||||||
require 'facter'
|
put "please rerun script"
|
||||||
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
@timings = {}
|
@timings = {}
|
||||||
@ -62,7 +63,8 @@ end
|
|||||||
|
|
||||||
puts "Ensuring config is setup"
|
puts "Ensuring config is setup"
|
||||||
|
|
||||||
unless %x{which ab > /dev/null 2>&1}
|
%x{which ab > /dev/null 2>&1}
|
||||||
|
unless $? == 0
|
||||||
abort "Apache Bench is not installed. Try: apt-get install apache2-utils or brew install ab"
|
abort "Apache Bench is not installed. Try: apt-get install apache2-utils or brew install ab"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,6 +28,12 @@ def unbundled_require(gem)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# by default, Discourse has a "system" account
|
||||||
|
if User.count > 1
|
||||||
|
puts "Only run this script against an empty DB"
|
||||||
|
exit
|
||||||
|
end
|
||||||
|
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
begin
|
begin
|
||||||
unbundled_require 'gabbler'
|
unbundled_require 'gabbler'
|
||||||
@ -37,8 +43,6 @@ rescue LoadError
|
|||||||
unbundled_require 'gabbler'
|
unbundled_require 'gabbler'
|
||||||
end
|
end
|
||||||
|
|
||||||
user_id = nil
|
|
||||||
|
|
||||||
def sentence
|
def sentence
|
||||||
@gabbler ||= Gabbler.new.tap do |gabbler|
|
@gabbler ||= Gabbler.new.tap do |gabbler|
|
||||||
story = File.read(File.dirname(__FILE__) + "/alice.txt")
|
story = File.read(File.dirname(__FILE__) + "/alice.txt")
|
||||||
@ -72,12 +76,6 @@ unless Rails.env == "profile"
|
|||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
# by default, Discourse has a "system" account
|
|
||||||
if User.count > 1
|
|
||||||
puts "Only run this script against an empty DB"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
|
|
||||||
puts "Creating 100 users"
|
puts "Creating 100 users"
|
||||||
users = 100.times.map do |i|
|
users = 100.times.map do |i|
|
||||||
putc "."
|
putc "."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user