seedy 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.5
1
+ 0.6.6
@@ -1,7 +1,7 @@
1
1
  module Seedy
2
2
  module Generators
3
3
  def user_hash
4
- "meh"
4
+ OpenSSL::Digest::MD5.new(password)
5
5
  end
6
6
  end
7
7
  end
@@ -43,8 +43,8 @@ module Seedy
43
43
  @@buffer
44
44
  end
45
45
 
46
- def create_user
47
- user = Users.build
46
+ def create_user(offset)
47
+ user = Users.build(offset)
48
48
  puts user.to_sql
49
49
  buffer << user
50
50
  add(:users, user)
@@ -16,8 +16,8 @@ class SimpleGraph < AbstractGraph
16
16
  @@buffer = Seedy::DatabaseBuffer
17
17
 
18
18
  # Creates a new user record, and all the dependent records listed above
19
- def initialize()
20
- create_user
19
+ def initialize(offset=nil)
20
+ create_user(offset)
21
21
  create_teams
22
22
  create_accounts
23
23
  create_bugs
@@ -26,19 +26,21 @@ module Seedy
26
26
  }
27
27
 
28
28
  class << self
29
- def build
29
+ def build(offset)
30
30
  user = Users.new
31
- user.update_attributes
31
+ user.update_attributes(offset)
32
32
  user
33
33
  end
34
34
  end
35
35
 
36
- def update_attributes
37
- write_attribute(:user_name, set_user_name)
38
- write_attribute(:sugar_login, set_user_name)
36
+ def update_attributes(offset)
37
+ write_attribute(:user_name, set_user_name(offset))
38
+ write_attribute(:sugar_login, 0)
39
+ write_attribute(:user_hash, OpenSSL::Digest::MD5.new("#{offset}")) if offset
39
40
  end
40
41
 
41
- def set_user_name
42
+ def set_user_name(offset)
43
+ return "user#{offset}" if offset
42
44
  (@attributes[:first_name][0,1] + @attributes[:last_name][0,6]).downcase
43
45
  end
44
46
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{seedy}
8
- s.version = "0.6.5"
8
+ s.version = "0.6.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Carl Hicks"]
@@ -54,9 +54,7 @@ Gem::Specification.new do |s|
54
54
  "lib/seedy/generators/website.rb",
55
55
  "lib/seedy/graph.rb",
56
56
  "lib/seedy/graphs/abstract_graph.rb",
57
- "lib/seedy/graphs/instance_methods.rb",
58
57
  "lib/seedy/graphs/simple_graph.rb",
59
- "lib/seedy/graphs/user_graph.rb",
60
58
  "lib/seedy/random.rb",
61
59
  "lib/seedy/record.rb",
62
60
  "lib/seedy/records/accounts.rb",
@@ -8,7 +8,7 @@ class TestSeedy < Test::Unit::TestCase
8
8
  end
9
9
 
10
10
  should "create a User object graph when SimpleGraph#new" do
11
- 100.times {Seedy::SimpleGraph.new}
11
+ 100.times {|x| Seedy::SimpleGraph.new(x)}
12
12
  end
13
13
 
14
14
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seedy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 5
10
- version: 0.6.5
9
+ - 6
10
+ version: 0.6.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Carl Hicks
@@ -253,9 +253,7 @@ files:
253
253
  - lib/seedy/generators/website.rb
254
254
  - lib/seedy/graph.rb
255
255
  - lib/seedy/graphs/abstract_graph.rb
256
- - lib/seedy/graphs/instance_methods.rb
257
256
  - lib/seedy/graphs/simple_graph.rb
258
- - lib/seedy/graphs/user_graph.rb
259
257
  - lib/seedy/random.rb
260
258
  - lib/seedy/record.rb
261
259
  - lib/seedy/records/accounts.rb
File without changes
@@ -1,35 +0,0 @@
1
- module Seedy
2
- class UserGraph < AbstractGraph
3
- @@related_records = {
4
- 'Teams' => 1,
5
- 'Accounts' => 20,
6
- 'Bugs' => 60,
7
- 'Calls' => 480,
8
- 'Cases' => 80,
9
- 'Contacts' => 80,
10
- 'Documents'=> 80,
11
- 'Emails' => 320,
12
- 'EmailAddresses'=> 80,
13
- 'Leads' => 80,
14
- 'Meetings' => 160,
15
- 'Notes' => 80,
16
- 'Opportunities' => 40,
17
- 'Products' => 80,
18
- 'ProductBundles' => 40,
19
- 'Quotes' => 20,
20
- 'Tasks' => 80,
21
- }
22
-
23
- # Creates a new user record, and all the dependent records listed above
24
- def initialize
25
- user = Users.build
26
- @@related_records.each_pair do |module_name,count|
27
- count.times {
28
- record = module_name.build(self)
29
- DatabaseBuffer.insert(record)
30
- }
31
- end
32
- end
33
-
34
- end
35
- end