artisan-memory-repository 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ require 'artisan/repository'
2
+ require 'artisan-memory-repository/models/user'
3
+
4
+ module Memory
5
+ module UserFactory
6
+ def self.build(opts = {})
7
+ ArtisanMemoryRepository::User.new(
8
+ :full_name => opts[:full_name] || "Test User",
9
+ :projects => opts[:projects] || [],
10
+ :members => opts[:members] || [],
11
+ :login => opts[:login] || "test",
12
+ :email => opts[:email] || "test@user.com",
13
+ :gravatar_url => opts[:gravatar_url] || "",
14
+ :password => opts[:password] || "password",
15
+ :password_confirmation => opts[:password_confirmation] || "password")
16
+ end
17
+
18
+ def self.create(opts = {})
19
+ record = Memory::UserFactory.build(opts)
20
+ Artisan::Repository.user.save(record)
21
+ record
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: artisan-memory-repository
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - 8th Light Craftsmen
@@ -25,6 +25,7 @@ files:
25
25
  - lib/artisan-memory-repository/artisan_memory_repository.rb
26
26
  - lib/artisan-memory-repository/base_repository.rb
27
27
  - lib/artisan-memory-repository/change_repository.rb
28
+ - lib/artisan-memory-repository/factories/user_factory.rb
28
29
  - lib/artisan-memory-repository/future_user_repository.rb
29
30
  - lib/artisan-memory-repository/iteration_repository.rb
30
31
  - lib/artisan-memory-repository/member_repository.rb
@@ -54,7 +55,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
55
  requirements:
55
56
  - - ">="
56
57
  - !ruby/object:Gem::Version
57
- hash: 4406370865731914395
58
+ hash: -49743242202282181
58
59
  segments:
59
60
  - 0
60
61
  version: "0"