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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 898b043353fda422c4c8f069954e83a0def2a5436027ec8161f15efdcccb1b3c
4
- data.tar.gz: 2b9590e7f620ab5a6893faef4f6c9827b14aaa6d5b92bce7341c12e4c8293986
3
+ metadata.gz: a5e2d0afeca197bf2dfae6e09001f9d10832b186e449875034f4d0446d1aaf84
4
+ data.tar.gz: b5cdf34d24dcab7a7469c939255cd872351a79dc87a590c0e90511898c492426
5
5
  SHA512:
6
- metadata.gz: 4e16c81342527a7861c29ce98533f3de448a740ac1b05241a86ce55837cbcdb32cd24134af548343368bac989a35282a540aef5d4e70242abd8992a9574e51c2
7
- data.tar.gz: 5e6edcc4debb99f38ff9ee0cc1e2e7e3453f463320b6e66a92d55c8fe20e2317e2eddebcddb478477fc8eec373c392a090a1ca19daeb898659ae5a8ff61c005f
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.1.0)
5
- activesupport (~> 5.0, >= 5.0.0.0)
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 (5.2.3)
10
+ activesupport (6.1.4)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- coderay (1.1.2)
16
- concurrent-ruby (1.1.5)
17
- diff-lcs (1.3)
18
- equatable (0.5.0)
19
- i18n (1.6.0)
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.9.2)
22
- minitest (5.11.3)
23
- necromancer (0.4.0)
24
- pastel (0.7.2)
25
- equatable (~> 0.5.0)
26
- tty-color (~> 0.4.0)
27
- pry (0.12.2)
28
- coderay (~> 1.1.0)
29
- method_source (~> 0.9.0)
30
- rake (10.5.0)
31
- rspec (3.8.0)
32
- rspec-core (~> 3.8.0)
33
- rspec-expectations (~> 3.8.0)
34
- rspec-mocks (~> 3.8.0)
35
- rspec-core (3.8.0)
36
- rspec-support (~> 3.8.0)
37
- rspec-expectations (3.8.2)
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.8.0)
40
- rspec-mocks (3.8.0)
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.8.0)
43
- rspec-support (3.8.0)
44
- thread_safe (0.3.6)
45
- timers (4.3.0)
46
- tty-color (0.4.3)
47
- tty-cursor (0.6.1)
48
- tty-prompt (0.18.1)
49
- necromancer (~> 0.4.0)
50
- pastel (~> 0.7.0)
51
- timers (~> 4.0)
52
- tty-cursor (~> 0.6.0)
53
- tty-reader (~> 0.5.0)
54
- tty-reader (0.5.0)
55
- tty-cursor (~> 0.6.0)
56
- tty-screen (~> 0.6.4)
57
- wisper (~> 2.0.0)
58
- tty-screen (0.6.5)
59
- tzinfo (1.2.5)
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.16)
68
- pry (~> 0.12.0)
69
- rake (~> 10.0)
70
- rspec (~> 3.0)
69
+ bundler (~> 2.1)
70
+ pry (~> 0.13)
71
+ rake (~> 13.0)
72
+ rspec (~> 3.1)
71
73
  spinning_wheel!
72
- tty-prompt (~> 0.18)
74
+ tty-prompt (~> 0.22)
73
75
 
74
76
  BUNDLED WITH
75
- 1.16.3
77
+ 2.2.15
@@ -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
- instance_eval(&@block)
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 == @attributes.keys
24
- @klass.new(*@attributes.values)
22
+ if required_parametes == attributes.keys
23
+ @klass.new(*attributes.values)
25
24
  else
26
- @klass.new(**@attributes)
25
+ @klass.new(**attributes)
27
26
  end
28
27
  end
29
28
 
30
- def method_missing(name, *args, &block)
31
- @attributes[name] = block.call
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
@@ -1,3 +1,3 @@
1
1
  module SpinningWheel
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -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', '~> 5.0', '>= 5.0.0.0'
26
+ spec.add_runtime_dependency 'activesupport', '>= 5.2.4.3'
27
27
 
28
- spec.add_development_dependency "bundler", "~> 1.16"
29
- spec.add_development_dependency "rake", "~> 10.0"
30
- spec.add_development_dependency "rspec", "~> 3.0"
31
- spec.add_development_dependency 'pry', '~> 0.12.0'
32
- spec.add_development_dependency 'tty-prompt', '~> 0.18'
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: 0.1.0
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: 2019-05-21 00:00:00.000000000 Z
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.0.0.0
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.0.0.0
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.16'
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.16'
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: '10.0'
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: '10.0'
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.0'
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.0'
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.12.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.12.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.18'
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.18'
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
- rubyforge_project:
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.