spinning_wheel 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile.lock +58 -56
- data/lib/spinning_wheel.rb +0 -11
- data/lib/spinning_wheel/fabric.rb +37 -7
- data/lib/spinning_wheel/version.rb +1 -1
- data/spinning_wheel.gemspec +6 -6
- metadata +28 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5e2d0afeca197bf2dfae6e09001f9d10832b186e449875034f4d0446d1aaf84
|
4
|
+
data.tar.gz: b5cdf34d24dcab7a7469c939255cd872351a79dc87a590c0e90511898c492426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 236c169deb1b2e0d7099ef30bde903a30872d292582d3b3c3c95e5546830fc684425b2448bd400c9a7da52dbf7212c7f7b4f8fd87fce8f7b5e909b997c898cdd
|
7
|
+
data.tar.gz: e9e1982f44ec30e2ed3bde9a66bc25be83066039971690d949df1120b15ce0f5182522dae4932e46f8d7f655a4e5ac52a9f5663b9ab05a4bdd03d048d0db7061
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.0.1
|
data/Gemfile.lock
CHANGED
@@ -1,75 +1,77 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
spinning_wheel (0.
|
5
|
-
activesupport (
|
4
|
+
spinning_wheel (0.2.2)
|
5
|
+
activesupport (>= 5.2.4.3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (
|
10
|
+
activesupport (6.1.4)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
-
i18n (>=
|
13
|
-
minitest (
|
14
|
-
tzinfo (~>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
|
+
coderay (1.1.3)
|
17
|
+
concurrent-ruby (1.1.9)
|
18
|
+
diff-lcs (1.4.4)
|
19
|
+
ffi (1.15.3-java)
|
20
|
+
i18n (1.8.10)
|
20
21
|
concurrent-ruby (~> 1.0)
|
21
|
-
method_source (0.
|
22
|
-
minitest (5.
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
rspec-
|
35
|
-
|
36
|
-
rspec-
|
37
|
-
rspec-
|
22
|
+
method_source (1.0.0)
|
23
|
+
minitest (5.14.4)
|
24
|
+
pastel (0.8.0)
|
25
|
+
tty-color (~> 0.5)
|
26
|
+
pry (0.14.1)
|
27
|
+
coderay (~> 1.1)
|
28
|
+
method_source (~> 1.0)
|
29
|
+
pry (0.14.1-java)
|
30
|
+
coderay (~> 1.1)
|
31
|
+
method_source (~> 1.0)
|
32
|
+
spoon (~> 0.0)
|
33
|
+
rake (13.0.6)
|
34
|
+
rspec (3.10.0)
|
35
|
+
rspec-core (~> 3.10.0)
|
36
|
+
rspec-expectations (~> 3.10.0)
|
37
|
+
rspec-mocks (~> 3.10.0)
|
38
|
+
rspec-core (3.10.1)
|
39
|
+
rspec-support (~> 3.10.0)
|
40
|
+
rspec-expectations (3.10.1)
|
38
41
|
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
-
rspec-support (~> 3.
|
40
|
-
rspec-mocks (3.
|
42
|
+
rspec-support (~> 3.10.0)
|
43
|
+
rspec-mocks (3.10.2)
|
41
44
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
-
rspec-support (~> 3.
|
43
|
-
rspec-support (3.
|
44
|
-
|
45
|
-
|
46
|
-
tty-color (0.
|
47
|
-
tty-cursor (0.
|
48
|
-
tty-prompt (0.
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
tty-cursor (~> 0.
|
53
|
-
tty-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
thread_safe (~> 0.1)
|
61
|
-
wisper (2.0.0)
|
45
|
+
rspec-support (~> 3.10.0)
|
46
|
+
rspec-support (3.10.2)
|
47
|
+
spoon (0.0.6)
|
48
|
+
ffi
|
49
|
+
tty-color (0.6.0)
|
50
|
+
tty-cursor (0.7.1)
|
51
|
+
tty-prompt (0.23.1)
|
52
|
+
pastel (~> 0.8)
|
53
|
+
tty-reader (~> 0.8)
|
54
|
+
tty-reader (0.9.0)
|
55
|
+
tty-cursor (~> 0.7)
|
56
|
+
tty-screen (~> 0.8)
|
57
|
+
wisper (~> 2.0)
|
58
|
+
tty-screen (0.8.1)
|
59
|
+
tzinfo (2.0.4)
|
60
|
+
concurrent-ruby (~> 1.0)
|
61
|
+
wisper (2.0.1)
|
62
|
+
zeitwerk (2.4.2)
|
62
63
|
|
63
64
|
PLATFORMS
|
65
|
+
java
|
64
66
|
ruby
|
65
67
|
|
66
68
|
DEPENDENCIES
|
67
|
-
bundler (~> 1
|
68
|
-
pry (~> 0.
|
69
|
-
rake (~>
|
70
|
-
rspec (~> 3.
|
69
|
+
bundler (~> 2.1)
|
70
|
+
pry (~> 0.13)
|
71
|
+
rake (~> 13.0)
|
72
|
+
rspec (~> 3.1)
|
71
73
|
spinning_wheel!
|
72
|
-
tty-prompt (~> 0.
|
74
|
+
tty-prompt (~> 0.22)
|
73
75
|
|
74
76
|
BUNDLED WITH
|
75
|
-
|
77
|
+
2.2.15
|
data/lib/spinning_wheel.rb
CHANGED
@@ -19,14 +19,3 @@ module SpinningWheel
|
|
19
19
|
@fabrics[fabric.name] = fabric
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
23
|
-
# def initialize(&block)
|
24
|
-
# instance_eval(&block)
|
25
|
-
# end
|
26
|
-
|
27
|
-
# def fabric(options, &block)
|
28
|
-
# fabric
|
29
|
-
# # fabric = SpinningWheel::Fabric.new(options)
|
30
|
-
# # object = fabric.create(&block)
|
31
|
-
# # register(fabric.name, object)
|
32
|
-
# end
|
@@ -6,13 +6,12 @@ module SpinningWheel
|
|
6
6
|
def initialize(name:, class_name:, &block)
|
7
7
|
@name = name
|
8
8
|
@class_name = class_name
|
9
|
-
@attributes = {}
|
10
9
|
@block = block
|
11
10
|
end
|
12
11
|
|
13
12
|
def build
|
14
13
|
@klass = @class_name.constantize
|
15
|
-
|
14
|
+
attributes = DSL.run(@block)
|
16
15
|
parameters = @klass.instance_method(:initialize).parameters
|
17
16
|
required_parametes = []
|
18
17
|
parameters.each do |parameter|
|
@@ -20,15 +19,46 @@ module SpinningWheel
|
|
20
19
|
required_parametes << parameter[1]
|
21
20
|
end
|
22
21
|
end
|
23
|
-
if required_parametes ==
|
24
|
-
@klass.new(
|
22
|
+
if required_parametes == attributes.keys
|
23
|
+
@klass.new(*attributes.values)
|
25
24
|
else
|
26
|
-
@klass.new(
|
25
|
+
@klass.new(**attributes)
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
30
|
-
|
31
|
-
|
29
|
+
|
30
|
+
class DSL
|
31
|
+
|
32
|
+
attr_accessor :attributes
|
33
|
+
|
34
|
+
def self.run(block)
|
35
|
+
dsl = self.new
|
36
|
+
dsl.instance_eval(&block)
|
37
|
+
return dsl.attributes
|
38
|
+
end
|
39
|
+
|
40
|
+
def initialize()
|
41
|
+
@attributes = Hash.new
|
42
|
+
clean_up_object_methods()
|
43
|
+
end
|
44
|
+
|
45
|
+
def method_missing(name, *args, &block)
|
46
|
+
@attributes[name] = block.call
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def clean_up_object_methods
|
52
|
+
self.instance_eval('undef :clone')
|
53
|
+
self.instance_eval('undef :display')
|
54
|
+
self.instance_eval('undef :dup')
|
55
|
+
self.instance_eval('undef :extend')
|
56
|
+
self.instance_eval('undef :freeze')
|
57
|
+
self.instance_eval('undef :frozen?')
|
58
|
+
self.instance_eval('undef :inspect')
|
59
|
+
self.instance_eval('undef :taint')
|
60
|
+
self.instance_eval('undef :tap')
|
61
|
+
end
|
32
62
|
end
|
33
63
|
|
34
64
|
end
|
data/spinning_wheel.gemspec
CHANGED
@@ -23,11 +23,11 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
spec.add_runtime_dependency 'activesupport', '
|
26
|
+
spec.add_runtime_dependency 'activesupport', '>= 5.2.4.3'
|
27
27
|
|
28
|
-
spec.add_development_dependency "bundler", "~> 1
|
29
|
-
spec.add_development_dependency "rake", "~>
|
30
|
-
spec.add_development_dependency "rspec", "~> 3.
|
31
|
-
spec.add_development_dependency 'pry', '~> 0.
|
32
|
-
spec.add_development_dependency 'tty-prompt', '~> 0.
|
28
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
29
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.1"
|
31
|
+
spec.add_development_dependency 'pry', '~> 0.13'
|
32
|
+
spec.add_development_dependency 'tty-prompt', '~> 0.22'
|
33
33
|
end
|
metadata
CHANGED
@@ -1,105 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spinning_wheel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Langenegger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
|
-
- - "~>"
|
17
|
-
- !ruby/object:Gem::Version
|
18
|
-
version: '5.0'
|
19
17
|
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 5.
|
22
|
-
name: activesupport
|
23
|
-
prerelease: false
|
19
|
+
version: 5.2.4.3
|
24
20
|
type: :runtime
|
21
|
+
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '5.0'
|
30
24
|
- - ">="
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: 5.
|
26
|
+
version: 5.2.4.3
|
33
27
|
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
34
29
|
requirement: !ruby/object:Gem::Requirement
|
35
30
|
requirements:
|
36
31
|
- - "~>"
|
37
32
|
- !ruby/object:Gem::Version
|
38
|
-
version: '1
|
39
|
-
name: bundler
|
40
|
-
prerelease: false
|
33
|
+
version: '2.1'
|
41
34
|
type: :development
|
35
|
+
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
38
|
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '1
|
40
|
+
version: '2.1'
|
47
41
|
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
44
|
requirements:
|
50
45
|
- - "~>"
|
51
46
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
53
|
-
name: rake
|
54
|
-
prerelease: false
|
47
|
+
version: '13.0'
|
55
48
|
type: :development
|
49
|
+
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
52
|
- - "~>"
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
54
|
+
version: '13.0'
|
61
55
|
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
62
57
|
requirement: !ruby/object:Gem::Requirement
|
63
58
|
requirements:
|
64
59
|
- - "~>"
|
65
60
|
- !ruby/object:Gem::Version
|
66
|
-
version: '3.
|
67
|
-
name: rspec
|
68
|
-
prerelease: false
|
61
|
+
version: '3.1'
|
69
62
|
type: :development
|
63
|
+
prerelease: false
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
66
|
- - "~>"
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
version: '3.
|
68
|
+
version: '3.1'
|
75
69
|
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
76
71
|
requirement: !ruby/object:Gem::Requirement
|
77
72
|
requirements:
|
78
73
|
- - "~>"
|
79
74
|
- !ruby/object:Gem::Version
|
80
|
-
version: 0.
|
81
|
-
name: pry
|
82
|
-
prerelease: false
|
75
|
+
version: '0.13'
|
83
76
|
type: :development
|
77
|
+
prerelease: false
|
84
78
|
version_requirements: !ruby/object:Gem::Requirement
|
85
79
|
requirements:
|
86
80
|
- - "~>"
|
87
81
|
- !ruby/object:Gem::Version
|
88
|
-
version: 0.
|
82
|
+
version: '0.13'
|
89
83
|
- !ruby/object:Gem::Dependency
|
84
|
+
name: tty-prompt
|
90
85
|
requirement: !ruby/object:Gem::Requirement
|
91
86
|
requirements:
|
92
87
|
- - "~>"
|
93
88
|
- !ruby/object:Gem::Version
|
94
|
-
version: '0.
|
95
|
-
name: tty-prompt
|
96
|
-
prerelease: false
|
89
|
+
version: '0.22'
|
97
90
|
type: :development
|
91
|
+
prerelease: false
|
98
92
|
version_requirements: !ruby/object:Gem::Requirement
|
99
93
|
requirements:
|
100
94
|
- - "~>"
|
101
95
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0.
|
96
|
+
version: '0.22'
|
103
97
|
description: Write a longer description or delete this line.
|
104
98
|
email:
|
105
99
|
- felix.langenegger@fadendaten.ch
|
@@ -109,6 +103,7 @@ extra_rdoc_files: []
|
|
109
103
|
files:
|
110
104
|
- ".gitignore"
|
111
105
|
- ".rspec"
|
106
|
+
- ".ruby-version"
|
112
107
|
- ".travis.yml"
|
113
108
|
- Gemfile
|
114
109
|
- Gemfile.lock
|
@@ -141,8 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
136
|
- !ruby/object:Gem::Version
|
142
137
|
version: '0'
|
143
138
|
requirements: []
|
144
|
-
|
145
|
-
rubygems_version: 2.7.6
|
139
|
+
rubygems_version: 3.2.15
|
146
140
|
signing_key:
|
147
141
|
specification_version: 4
|
148
142
|
summary: Write a short summary, because RubyGems requires one.
|