capncook 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bde9cb9782f1a64d3f5adeec96a62a130b32499
4
- data.tar.gz: ad479e93afc5ee37e310cfac2fc0a3e595444ebd
3
+ metadata.gz: 9bdc5bd2b1770375d36c8435efd983c216f8a0fa
4
+ data.tar.gz: e2f5cdd6a7302b0407b65f4bd87a7f29588869b6
5
5
  SHA512:
6
- metadata.gz: b817c555eee429565f42eee374dd2bb49ed2c99cb3f6fcd98ce49d84b87ba5492eb5082486158c4fc50cfb020e83de9cbd3fff771c26950f2d9fcd39c0b16562
7
- data.tar.gz: 5ddb14135ccdd151bed6f306de3834860aa7231590333c2e938709066e2a7da852e8f5e3b69e4ed79b8324d254f9041414eb987b459e0c23e776a431c69e2e15
6
+ metadata.gz: 4c2be1dfcd367fd236359976fe50e501a7cdd54fb0f4c95c337e0c6453d1a306395e53a5984a450a89cbb8542fb653130209cfbf343102432910f3377d2493c9
7
+ data.tar.gz: 876523d9c5dd9fe34378d2b1bf282994649cf21818e5918cc2ab9c1a4a8ca4cca2a8a0969f0371bde9a1cef50971bd4771e4d062f8b9685cfe437b5053f680dd
File without changes
data/capncook.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.description = 'Since most user/person/customer data structures have similar db attributes,'\
14
14
  'this gem will attempt to create those classes with attribute information based on the '\
15
15
  'show Breaking Bad. For example: `User.create(name: "Walter White", email: '\
16
- '"crystalbluepersuasion@heisenberg.com", ...)'
16
+ '"crystalbluepersuasion@heisenberg.com", ...)`'
17
17
 
18
18
  spec.homepage = "https://github.com/cdpalmer/capncook"
19
19
  spec.license = "MIT"
@@ -32,4 +32,5 @@ Gem::Specification.new do |spec|
32
32
  spec.require_paths = ["lib"]
33
33
 
34
34
  spec.add_development_dependency "rspec", "~> 3.0"
35
+ spec.add_development_dependency "ffaker", "~> 2.0"
35
36
  end
@@ -1,3 +1,3 @@
1
1
  module Capncook
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/capncook.rb CHANGED
@@ -1,5 +1,13 @@
1
1
  require "capncook/version"
2
2
 
3
3
  module Capncook
4
- # Your code goes here...
4
+ def self.build(klass)
5
+ klass_name = klass.to_s.capitalize
6
+ user = Object.const_get(klass_name).new
7
+ user.first_name = "Walter"
8
+
9
+ return user
10
+ rescue NameError => error
11
+ raise Exception.new("'#{klass.to_s.capitalize}' is an unknown class.")
12
+ end
5
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capncook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Palmer
@@ -24,10 +24,24 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ffaker
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
27
41
  description: 'Since most user/person/customer data structures have similar db attributes,this
28
42
  gem will attempt to create those classes with attribute information based on the
29
43
  show Breaking Bad. For example: `User.create(name: "Walter White", email: "crystalbluepersuasion@heisenberg.com",
30
- ...)'
44
+ ...)`'
31
45
  email:
32
46
  - teampalmer.apps@gmail.com
33
47
  executables: []
@@ -43,6 +57,7 @@ files:
43
57
  - Rakefile
44
58
  - bin/console
45
59
  - bin/setup
60
+ - capncook-0.1.0.gem
46
61
  - capncook.gemspec
47
62
  - lib/capncook.rb
48
63
  - lib/capncook/version.rb