Skip to content

Commit

Permalink
don't keep installing gabbler from bench
Browse files Browse the repository at this point in the history
fix ab detection
  • Loading branch information
SamSaffron committed Jan 1, 2014
1 parent cab6a3f commit 6a0072d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 4 additions & 2 deletions script/bench.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def run(command)
require 'facter'
rescue LoadError
run "gem install facter"
require 'facter'
put "please rerun script"
exit
end

@timings = {}
Expand Down Expand Up @@ -62,7 +63,8 @@ def prereqs

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"
end

Expand Down
14 changes: 6 additions & 8 deletions script/profile_db_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ def unbundled_require(gem)
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'
begin
unbundled_require 'gabbler'
Expand All @@ -37,8 +43,6 @@ def unbundled_require(gem)
unbundled_require 'gabbler'
end

user_id = nil

def sentence
@gabbler ||= Gabbler.new.tap do |gabbler|
story = File.read(File.dirname(__FILE__) + "/alice.txt")
Expand Down Expand Up @@ -72,12 +76,6 @@ def create_admin(seq)
exit
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"
users = 100.times.map do |i|
putc "."
Expand Down

0 comments on commit 6a0072d

Please sign in to comment.