IZ, RS; Moved every instance of hardcoded backer info out to yml file config/deploy_config.yml
This commit is contained in:
parent
124fa7c78a
commit
bffb63d9f0
5 changed files with 13 additions and 190 deletions
|
|
@ -23,26 +23,11 @@ def warzombie
|
|||
|
||||
def zombiefriends
|
||||
render :nothing => true
|
||||
backer_info = ["http://washington.joindiaspora.com/",
|
||||
"http://adams.joindiaspora.com/",
|
||||
"http://jefferson.joindiaspora.com/",
|
||||
"http://madison.joindiaspora.com/",
|
||||
"http://monroe.joindiaspora.com/",
|
||||
"http://quincyadams.joindiaspora.com/",
|
||||
"http://jackson.joindiaspora.com/",
|
||||
"http://buren.joindiaspora.com/",
|
||||
"http://harrison.joindiaspora.com/",
|
||||
"http://tyler.joindiaspora.com/",
|
||||
"http://polk.joindiaspora.com/",
|
||||
#"http://taylor.joindiaspora.com/",
|
||||
#"http://fillmore.joindiaspora.com/",
|
||||
#"http://pierce.joindiaspora.com/",
|
||||
]
|
||||
|
||||
backer_info
|
||||
if User.owner.email == "tom@tom.joindiaspora.com" && Person.friends.first.nil?
|
||||
backer_info.each do |backer|
|
||||
logger.info "Zombefriending #{backer}"
|
||||
User.owner.send_friend_request_to(backer)
|
||||
logger.info "Zombefriending #{backer['given_name']} #{backer['family_name']}"
|
||||
User.owner.send_friend_request_to("http://#{backer['username']}.joindiaspora.com/")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -53,6 +38,10 @@ def warzombie
|
|||
User.owner.accept_friend_request(r.id)
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
def backer_info
|
||||
config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml')
|
||||
config['servers']['backer']
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
41
db/seeds.rb
41
db/seeds.rb
|
|
@ -8,44 +8,3 @@
|
|||
|
||||
require 'config/environment'
|
||||
|
||||
# Create seed user
|
||||
user = User.create( :email => "tom@joindiaspora.com", :password => "aaaaaa", :profile => Profile.new( :first_name => "Diaspora", :last_name => "Tom" ))
|
||||
|
||||
names = [ ["George", "Washington"],
|
||||
["John", "Adams"],
|
||||
["Thomas", "Jefferson"],
|
||||
["James", "Madison"],
|
||||
["James", "Monroe"],
|
||||
["John Quincy", "Adams"],
|
||||
["Andrew", "Jackson"],
|
||||
["Martin Van", "Buren"],
|
||||
["William Henry","Harrison"],
|
||||
["John", "Tyler"],
|
||||
["James K." , "Polk"],
|
||||
["Zachary", "Taylor"],
|
||||
["Millard", "Fillmore"],
|
||||
["Franklin", "Pierce"],
|
||||
["James", "Buchanan"],
|
||||
["Abraham", "Lincoln"]
|
||||
]
|
||||
|
||||
# Make people
|
||||
(1..10).each { |n|
|
||||
People.create( :email => "b#{n}@joindiaspora.com", :url => "http://b#{n}.joindiaspora.com/", :profile => Profile.new(:first_name => names[n-1][0], :last_name => names[n-1][1]))
|
||||
}
|
||||
|
||||
# Populate feed
|
||||
StatusMessage.create(:message => "There's a bomb in the lasagna!?", :person => user)
|
||||
Bookmark.create(:title => "xkcd", :link => "http://xkcd.com/743/", :person => user )
|
||||
StatusMessage.create(:message => "I switched to Motoroi today, a Motorola Android-based phone, in Korea. Now, I am using Android phones in both the U.S. and Korea", :person => user, :created_at => Time.now-930)
|
||||
StatusMessage.create(:message => "I had 5 hours to study for it :-( GREs on Thursday. Wunderbar.", :person => user, :created_at => Time.now-43990)
|
||||
StatusMessage.create(:message => "Spotted in toy story 3: google maps, OSX, and windows XP. Two out of three isn't bad.", :person => user, :created_at => Time.now-4390)
|
||||
Bookmark.create( :title => "Reddit", :link => "http://reddit.com", :person => user, :created_at => Time.now-54390)
|
||||
Blog.create(:title => "I Love Rock'N'Roll - Joan Jett & The Blackhearts", :body => "<p>The loudspeakers played this song as we walked into the city pool for the first time this summer. Those loudspeakers make every song sound fresh even if I have heard it a thousand times and their effect on this song was no different. Joan sounded young and strong and ready, and for a moment I forgot where or when I was.</p> <p>also i can tell it won’t be long and also happy summer imaginary constructs -mumblelard</p>", :person => user, :created_at => Time.now-3090)
|
||||
StatusMessage.create(:message => "Commercials for IE make me SO MAD and my friends just don't get why.", :person => user, :created_at => Time.now-30900)
|
||||
Bookmark.create(:title => "Zombo.com", :link => "http://zombo.com", :person => user, :created_at => Time.now-9090)
|
||||
StatusMessage.create(:message => "Why do I have \"No More Heroes\" by Westlife on repeat all day?", :person => user, :created_at => Time.now-590000)
|
||||
StatusMessage.create(:message => "Mmm. Friday night. Acknowledged.", :person => user, :created_at => Time.now-503900)
|
||||
StatusMessage.create(:message => "Getting a universal remote is the epitome of laziness, I do declare.", :person => user, :created_at => Time.now-4400)
|
||||
StatusMessage.create(:message => "Does anyone know how to merge two Skype contact entries of the same person? (i.e. one Skype ID and one mobile number)", :person => user, :created_at => Time.now-400240)
|
||||
StatusMessage.create(:message => "A cool, cool morning for once.", :person => user, :created_at => Time.now-150000)
|
||||
|
|
|
|||
|
|
@ -9,50 +9,15 @@
|
|||
require 'config/environment'
|
||||
|
||||
def create(backer_number)
|
||||
backer_info = [ [5072,"George", "Washington"],
|
||||
[3742,"John", "Adams"],
|
||||
[7782,"Thomas", "Jefferson"],
|
||||
[2691,"James", "Madison"],
|
||||
[6133,"James", "Monroe"],
|
||||
[7558,"John", "Quincy Adams"],
|
||||
[8670,"Andrew", "Jackson"],
|
||||
[1559,"Martin Van", "Buren"],
|
||||
[5404,"William Henry","Harrison"],
|
||||
[6431,"John", "Tyler"],
|
||||
[1957,"James K." , "Polk"],
|
||||
[5323,"Zachary", "Taylor"],
|
||||
[8784,"Millard", "Fillmore"],
|
||||
[4267,"Franklin", "Pierce"],
|
||||
[8891,"James", "Buchanan"],
|
||||
[2324,"Abraham", "Lincoln"],
|
||||
[6948,"Andrew", "Johnson"],
|
||||
[8176,"Ulysses S.", "Grant"],
|
||||
[6928,"Rutherford B.", "Hayes"],
|
||||
[5677,"James A.", "Garfield"],
|
||||
[7966,"Chester A.", "Arthur"],
|
||||
[2893,"Grover", "Cleveland"],
|
||||
[6828,"Benjamin", "Harrison"],
|
||||
[2982,"William", "McKinley"],
|
||||
[6756,"Theodore", "Roosevelt"],
|
||||
[6658,"William Howard", "Taft"],
|
||||
[3551,"Woodrow", "Wilson"],
|
||||
[3088,"Warren G.", "Harding"],
|
||||
[8379,"Calvin", "Coolidge"],
|
||||
[7493,"Herbert", "Hoover"],
|
||||
[2759,"Franklin D.", "Roosevelt"],
|
||||
[1029,"Harry S.", "Truman"],
|
||||
[4013,"Dwight D.", "Eisenhower"],
|
||||
[8507,"John F.", "Kennedy"],
|
||||
[1508,"Lyndon B.", "Johnson"],
|
||||
[5258,"Richard", "Nixon"]
|
||||
]
|
||||
config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml')
|
||||
backer_info = config['servers']['backer']
|
||||
|
||||
|
||||
# Create seed user
|
||||
username = backer_info[backer_number][2].gsub(/ /,'').downcase
|
||||
username = backer_info[backer_number]['username'].gsub(/ /,'').downcase
|
||||
user = User.create( :email => "#{username}@#{username}.joindiaspora.com",
|
||||
:password => "#{username+backer_info[backer_number][0].to_s}",
|
||||
:profile => Profile.new( :first_name => backer_info[backer_number][1], :last_name => backer_info[backer_number][2] ),
|
||||
:password => "#{username+backer_info[backer_number]['pin'].to_s}",
|
||||
:profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'] ),
|
||||
:url=> "#{username}.joindiaspora.com")
|
||||
|
||||
# Make connection with Diaspora Tom
|
||||
|
|
|
|||
|
|
@ -11,48 +11,3 @@ require 'config/environment'
|
|||
# Create seed user
|
||||
user = User.create( :email => "robert@joindiaspora.com", :password => "evankorth", :profile => Profile.new( :first_name => "bobert", :last_name => "brin" ))
|
||||
|
||||
names = [ ["George", "Washington"],
|
||||
["John", "Adams"],
|
||||
["Thomas", "Jefferson"],
|
||||
["James", "Madison"],
|
||||
["James", "Monroe"],
|
||||
["John", "Quincy Adams"],
|
||||
["Andrew", "Jackson"],
|
||||
["Martin Van", "Buren"],
|
||||
["William Henry","Harrison"],
|
||||
["John", "Tyler"],
|
||||
["James K." , "Polk"],
|
||||
["Zachary", "Taylor"],
|
||||
["Millard", "Fillmore"],
|
||||
["Franklin", "Pierce"],
|
||||
["James", "Buchanan"],
|
||||
["Abraham", "Lincoln"],
|
||||
["Andrew", "Johnson"],
|
||||
["Ulysses S.", "Grant"],
|
||||
["Rutherford B.", "Hayes"],
|
||||
["James A.", "Garfield"],
|
||||
["Chester A.", "Arthur"],
|
||||
["Grover", "Cleveland"],
|
||||
["Benjamin", "Harrison"],
|
||||
["William", "McKinley"],
|
||||
["Theodore", "Roosevelt"],
|
||||
["William Howard", "Taft"],
|
||||
["Woodrow", "Wilson"],
|
||||
["Warren G.", "Harding"],
|
||||
["Calvin", "Coolidge"],
|
||||
["Herbert", "Hoover"],
|
||||
["Franklin D.", "Roosevelt"],
|
||||
["Harry S.", "Truman"],
|
||||
["Dwight D.", "Eisenhower"],
|
||||
["John F.", "Kennedy"],
|
||||
["Lyndon B.", "Johnson"],
|
||||
["Richard", "Nixon"]
|
||||
]
|
||||
|
||||
# Make people
|
||||
(0..10).each { |n|
|
||||
username = names[n][1].gsub(/ /,'').downcase
|
||||
Person.create( :email => "#{username}@#{username}joindiaspora.com", :url => "http://#{username}.joindiaspora.com/", :active => true, :profile => Profile.new(:first_name => names[n][0], :last_name => names[n][1]))
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,48 +11,3 @@ require 'config/environment'
|
|||
# Create seed user
|
||||
user = User.create( :email => "tom@tom.joindiaspora.com", :password => "evankorth", :url => "http://tom.joindiaspora.com/", :profile => Profile.new( :first_name => "Alexander", :last_name => "Hamiltom" ))
|
||||
|
||||
names = [ ["George", "Washington"],
|
||||
["John", "Adams"],
|
||||
["Thomas", "Jefferson"],
|
||||
["James", "Madison"],
|
||||
["James", "Monroe"],
|
||||
["John", "Quincy Adams"],
|
||||
["Andrew", "Jackson"],
|
||||
["Martin Van", "Buren"],
|
||||
["William Henry","Harrison"],
|
||||
["John", "Tyler"],
|
||||
["James K." , "Polk"],
|
||||
["Zachary", "Taylor"],
|
||||
["Millard", "Fillmore"],
|
||||
["Franklin", "Pierce"],
|
||||
["James", "Buchanan"],
|
||||
["Abraham", "Lincoln"],
|
||||
["Andrew", "Johnson"],
|
||||
["Ulysses S.", "Grant"],
|
||||
["Rutherford B.", "Hayes"],
|
||||
["James A.", "Garfield"],
|
||||
["Chester A.", "Arthur"],
|
||||
["Grover", "Cleveland"],
|
||||
["Benjamin", "Harrison"],
|
||||
["William", "McKinley"],
|
||||
["Theodore", "Roosevelt"],
|
||||
["William Howard", "Taft"],
|
||||
["Woodrow", "Wilson"],
|
||||
["Warren G.", "Harding"],
|
||||
["Calvin", "Coolidge"],
|
||||
["Herbert", "Hoover"],
|
||||
["Franklin D.", "Roosevelt"],
|
||||
["Harry S.", "Truman"],
|
||||
["Dwight D.", "Eisenhower"],
|
||||
["John F.", "Kennedy"],
|
||||
["Lyndon B.", "Johnson"],
|
||||
["Richard", "Nixon"]
|
||||
]
|
||||
|
||||
# Make people
|
||||
#(0..10).each { |n|
|
||||
#email = names[n][1].gsub(/ /,'').downcase
|
||||
#Person.create( :email => "#{email}@joindiaspora.com", :url => "http://#{email}.joindiaspora.com/", :active => true, :profile => Profile.new(:first_name => names[n][0], :last_name => names[n][1]))
|
||||
#}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue