mumukit-randomizer 0.1.0 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0fd1aa38765b85dbc2615df2164a5541f512c813
4
- data.tar.gz: b3da26c578ae66ff2e677baa48f6f74dd99c211c
2
+ SHA256:
3
+ metadata.gz: ee83d6d1af0083b2f474908e9b242b984492f531c3fc2b36a38633fb6fb042cd
4
+ data.tar.gz: 2c8e67e56237aef5a0d7ea9111bcecc4c9ab3c09d7eb36c55b06efab4f09cf8d
5
5
  SHA512:
6
- metadata.gz: 5e35d10845d56a4bb60a841f716dbcbf9f59ac718ac04f77ed31ca3a1164993bc93297cae07f4e908072b9a538b6276ffe983bc53fb29eb8e7371cb5ec0be0fe
7
- data.tar.gz: b34175f2a5317f9d05792e834581b8f774d6e743f57235e3cb97c22822e4d95fc3ef19a2aae900afe0ee313ce36f1c3ff8bdda6337064bdd836f6770bd146446
6
+ metadata.gz: d95e2e5dfd21c146481714ddea4feac7f8dc1bc9c003c32e9bc90e460d28cf01039fa4fde96414f2cbcf66d362051a5a954c1f871a19235f797acd71c4a1497c
7
+ data.tar.gz: b66fc9ace487ded967261b19f1fce93f8f0e6fb68293e487b4919725cd901eff0d991f3b729d36556a6e81e55f90f81baabdeadc9a922eb7a4eb88804f376e8b
@@ -7,7 +7,7 @@ module Mumukit::Randomizer::Randomization
7
7
 
8
8
  def self.parse(randomization)
9
9
  case randomization[:type].to_sym
10
- when :oneOf then Mumukit::Randomizer::Randomization::OneOf.new randomization[:value]
10
+ when :one_of then Mumukit::Randomizer::Randomization::OneOf.new randomization[:value]
11
11
  when :range then Mumukit::Randomizer::Randomization::Range.new(*randomization[:value])
12
12
  else raise 'Unsupported randomization kind'
13
13
  end
@@ -23,4 +23,3 @@ require_relative 'randomizations/base'
23
23
  require_relative 'randomizations/one_of'
24
24
  require_relative 'randomizations/range'
25
25
  require_relative 'randomizer/version'
26
- require_relative 'randomizer/with_randomizations'
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  class Randomizer
3
- VERSION = '0.1.0'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-randomizer
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
  - Julián Berbel Alt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-07-10 00:00:00.000000000 Z
12
+ date: 2018-07-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -81,7 +81,6 @@ files:
81
81
  - lib/mumukit/randomizations/range.rb
82
82
  - lib/mumukit/randomizer.rb
83
83
  - lib/mumukit/randomizer/version.rb
84
- - lib/mumukit/randomizer/with_randomizations.rb
85
84
  homepage: http://github.com/mumuki/mumukit-randomizer
86
85
  licenses:
87
86
  - MIT
@@ -102,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
101
  version: '0'
103
102
  requirements: []
104
103
  rubyforge_project:
105
- rubygems_version: 2.5.1
104
+ rubygems_version: 2.7.7
106
105
  signing_key:
107
106
  specification_version: 4
108
107
  summary: Library for randomizing parts of mumuki exercises
@@ -1,34 +0,0 @@
1
- module WithRandomizations
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- serialize :randomizations, Hash
6
- end
7
-
8
- def seed
9
- @seed || 0
10
- end
11
-
12
- def seed_with!(seed)
13
- @seed = seed
14
- end
15
-
16
- def randomizer
17
- @randomizer ||= Mumukit::Randomizer.parse(randomizations)
18
- end
19
-
20
- module ClassMethods
21
- def randomize(*selectors)
22
- selectors.each { |selector| randomize_field selector }
23
- end
24
-
25
- private
26
-
27
- def randomize_field(selector)
28
- define_method(selector) do |*args|
29
- return unless super(*args)
30
- randomizer.randomize!(super(*args), seed)
31
- end
32
- end
33
- end
34
- end