capncook 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/capncook-0.1.0.gem +0 -0
- data/capncook.gemspec +2 -1
- data/lib/capncook/version.rb +1 -1
- data/lib/capncook.rb +9 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bdc5bd2b1770375d36c8435efd983c216f8a0fa
|
4
|
+
data.tar.gz: e2f5cdd6a7302b0407b65f4bd87a7f29588869b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c2be1dfcd367fd236359976fe50e501a7cdd54fb0f4c95c337e0c6453d1a306395e53a5984a450a89cbb8542fb653130209cfbf343102432910f3377d2493c9
|
7
|
+
data.tar.gz: 876523d9c5dd9fe34378d2b1bf282994649cf21818e5918cc2ab9c1a4a8ca4cca2a8a0969f0371bde9a1cef50971bd4771e4d062f8b9685cfe437b5053f680dd
|
data/capncook-0.1.0.gem
ADDED
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
|
data/lib/capncook/version.rb
CHANGED
data/lib/capncook.rb
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
require "capncook/version"
|
2
2
|
|
3
3
|
module Capncook
|
4
|
-
|
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.
|
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
|