smartdown 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,24 +26,15 @@ module Smartdown
26
26
 
27
27
  private
28
28
  def next_node_from_next_node_rules
29
- next_node_rules && first_matching_rule(next_node_rules.rules).outcome
29
+ node.next_node_rules && first_matching_rule(node.next_node_rules.rules).outcome
30
30
  end
31
31
 
32
32
  def next_node_from_start_button
33
- start_button && start_button.start_node
33
+ node.start_button && node.start_button.start_node
34
34
  end
35
35
 
36
36
  def input_variable_names_from_question
37
- questions = node.elements.select { |e| e.class.to_s.include?("Smartdown::Model::Element::Question") }
38
- questions.map(&:name)
39
- end
40
-
41
- def next_node_rules
42
- node.elements.find { |e| e.is_a?(Smartdown::Model::NextNodeRules) }
43
- end
44
-
45
- def start_button
46
- node.elements.find { |e| e.is_a?(Smartdown::Model::Element::StartButton) }
37
+ node.questions.map(&:name)
47
38
  end
48
39
 
49
40
  def first_matching_rule(rules)
@@ -24,22 +24,22 @@ module Smartdown
24
24
  {}.merge(@initial_state)
25
25
  end
26
26
 
27
- def process(responses, test_start_state = nil)
27
+ def process(raw_responses, test_start_state = nil)
28
28
  state = test_start_state || build_start_state
29
- unprocessed_responses = responses
29
+ unprocessed_responses = raw_responses
30
30
  while !unprocessed_responses.empty? do
31
- nb_questions = 0
32
31
  current_node = flow.node(state.get(:current_node))
33
- nb_questions += current_node.elements.select{|element|
34
- element.class.to_s.include?("Smartdown::Model::Element::Question")
35
- }.count
36
- #There is at least one relevant input per transition for now:
37
- #Transition from start to first question relies on an input, regardless of its value
38
- nb_relevant_inputs = [nb_questions, 1].max
39
- input_array = unprocessed_responses.take(nb_relevant_inputs)
40
- unprocessed_responses = unprocessed_responses.drop(nb_relevant_inputs)
41
-
42
- transition = Transition.new(state, current_node, input_array)
32
+
33
+ if current_node.is_start_page_node?
34
+ # If it's a start page node, we've got to do something different because of the preceeding 'y' answer
35
+ transition = Transition.new(state, current_node, unprocessed_responses.shift(1))
36
+ else
37
+ answers = current_node.questions.map do |question|
38
+ question.answer_type.new(question, unprocessed_responses.shift)
39
+ end
40
+
41
+ transition = Transition.new(state, current_node, answers)
42
+ end
43
43
  state = transition.next_state
44
44
  end
45
45
  state
@@ -0,0 +1,42 @@
1
+ module Smartdown
2
+ module Model
3
+ module Answer
4
+ class Base
5
+ extend Forwardable
6
+ include Comparable
7
+
8
+ def_delegators :value, :to_s, :to_i, :to_f, :+, :-, :*, :/
9
+
10
+ def value_type
11
+ ::String
12
+ end
13
+
14
+ def <=>(other)
15
+ value <=> parse_comparison_object(other)
16
+ end
17
+
18
+ attr_reader :question, :value
19
+
20
+ def initialize(question, value)
21
+ @question = question
22
+ @value = parse_value(value)
23
+ end
24
+
25
+ private
26
+ def parse_comparison_object(comparison_object)
27
+ if comparison_object.is_a? Base
28
+ comparison_object.value
29
+ elsif comparison_object.is_a? value_type
30
+ comparison_object
31
+ else
32
+ parse_value(comparison_object)
33
+ end
34
+ end
35
+
36
+ def parse_value(value)
37
+ value
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,22 @@
1
+ require_relative "base"
2
+
3
+ module Smartdown
4
+ module Model
5
+ module Answer
6
+ class Date < Base
7
+ def value_type
8
+ ::Date
9
+ end
10
+
11
+ def to_s
12
+ value.strftime("%Y-%-m-%-d")
13
+ end
14
+
15
+ private
16
+ def parse_value(value)
17
+ ::Date.parse(value)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,13 @@
1
+ require_relative "base"
2
+
3
+ module Smartdown
4
+ module Model
5
+ module Answer
6
+ class MultipleChoice < Base
7
+ def value_type
8
+ ::String
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,37 @@
1
+ require_relative "base"
2
+
3
+ module Smartdown
4
+ module Model
5
+ module Answer
6
+ class Salary < Base
7
+ attr_reader :period, :amount_per_period
8
+
9
+ def value_type
10
+ ::Float
11
+ end
12
+
13
+ def to_s
14
+ "#{'%.2f' % amount_per_period} per #{period}"
15
+ end
16
+
17
+ private
18
+ def parse_value(value)
19
+ @amount_per_period, @period = value.split(/-|\W*per\W*/)
20
+ @amount_per_period = @amount_per_period.to_f
21
+ yearly_total
22
+ end
23
+
24
+ def yearly_total
25
+ case period
26
+ when "week"
27
+ amount_per_period * 52
28
+ when "month"
29
+ amount_per_period * 12
30
+ when "year"
31
+ amount_per_period
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -1,8 +1,14 @@
1
+ require 'smartdown/model/answer/date'
2
+
1
3
  module Smartdown
2
4
  module Model
3
5
  module Element
4
6
  module Question
5
- Date = Struct.new(:name)
7
+ class Date < Struct.new(:name)
8
+ def answer_type
9
+ Smartdown::Model::Answer::Date
10
+ end
11
+ end
6
12
  end
7
13
  end
8
14
  end
@@ -1,8 +1,14 @@
1
+ require 'smartdown/model/answer/multiple_choice'
2
+
1
3
  module Smartdown
2
4
  module Model
3
5
  module Element
4
6
  module Question
5
- MultipleChoice = Struct.new(:name, :choices)
7
+ class MultipleChoice < Struct.new(:name, :choices)
8
+ def answer_type
9
+ Smartdown::Model::Answer::MultipleChoice
10
+ end
11
+ end
6
12
  end
7
13
  end
8
14
  end
@@ -1,8 +1,14 @@
1
+ require 'smartdown/model/answer/salary'
2
+
1
3
  module Smartdown
2
4
  module Model
3
5
  module Element
4
6
  module Question
5
- Salary = Struct.new(:name)
7
+ class Salary < Struct.new(:name)
8
+ def answer_type
9
+ Smartdown::Model::Answer::Salary
10
+ end
11
+ end
6
12
  end
7
13
  end
8
14
  end
@@ -7,18 +7,30 @@ module Smartdown
7
7
  super(name, elements, front_matter || Smartdown::Model::FrontMatter.new)
8
8
  end
9
9
 
10
+ def title
11
+ h1s.first ? h1s.first.content : ""
12
+ end
13
+
14
+ def body
15
+ markdown_blocks[1..-1].map { |block| as_markdown(block) }.compact.join("\n")
16
+ end
17
+
10
18
  def questions
11
- elements.select do |element|
19
+ @questions ||= elements.select do |element|
12
20
  element.class.to_s.include?("Smartdown::Model::Element::Question")
13
21
  end
14
22
  end
15
23
 
16
- def title
17
- h1s.first ? h1s.first.content : ""
24
+ def next_node_rules
25
+ @next_node_rules ||= elements.find { |e| e.is_a?(Smartdown::Model::NextNodeRules) }
18
26
  end
19
27
 
20
- def body
21
- markdown_blocks[1..-1].map { |block| as_markdown(block) }.compact.join("\n")
28
+ def start_button
29
+ @start_button ||= elements.find { |e| e.is_a?(Smartdown::Model::Element::StartButton) }
30
+ end
31
+
32
+ def is_start_page_node?
33
+ @is_start_page_node ||= !!start_button
22
34
  end
23
35
 
24
36
  private
@@ -8,11 +8,7 @@ module Smartdown
8
8
  class Greater < Base
9
9
  def evaluate(state)
10
10
  variable = state.get(varname)
11
- if /(\d{4})-(\d{1,2})-(\d{1,2})/.match(value)
12
- Date.parse(variable) > Date.parse(value)
13
- else
14
- variable > value
15
- end
11
+ variable > value
16
12
  end
17
13
 
18
14
  def humanize
@@ -8,11 +8,7 @@ module Smartdown
8
8
  class GreaterOrEqual < Base
9
9
  def evaluate(state)
10
10
  variable = state.get(varname)
11
- if /(\d{4})-(\d{1,2})-(\d{1,2})/.match(value)
12
- Date.parse(variable) >= Date.parse(value)
13
- else
14
- variable >= value
15
- end
11
+ variable >= value
16
12
  end
17
13
 
18
14
  def humanize
@@ -8,11 +8,7 @@ module Smartdown
8
8
  class Less < Base
9
9
  def evaluate(state)
10
10
  variable = state.get(varname)
11
- if /(\d{4})-(\d{1,2})-(\d{1,2})/.match(value)
12
- Date.parse(variable) < Date.parse(value)
13
- else
14
- variable < value
15
- end
11
+ variable < value
16
12
  end
17
13
 
18
14
  def humanize
@@ -8,11 +8,7 @@ module Smartdown
8
8
  class LessOrEqual < Base
9
9
  def evaluate(state)
10
10
  variable = state.get(varname)
11
- if /(\d{4})-(\d{1,2})-(\d{1,2})/.match(value)
12
- Date.parse(variable) <= Date.parse(value)
13
- else
14
- variable <= value
15
- end
11
+ variable <= value
16
12
  end
17
13
 
18
14
  def humanize
@@ -9,6 +9,10 @@ module Smartdown
9
9
  def ==(o)
10
10
  o.class == self.class
11
11
  end
12
+
13
+ def humanize
14
+ "otherwise"
15
+ end
12
16
  end
13
17
  end
14
18
  end
@@ -3,7 +3,7 @@ module Smartdown
3
3
  module Predicate
4
4
  SetMembership = Struct.new(:varname, :values) do
5
5
  def evaluate(state)
6
- values.include?(state.get(varname))
6
+ values.any? {|value| state.get(varname) == value }
7
7
  end
8
8
 
9
9
  def humanize
@@ -1,3 +1,3 @@
1
1
  module Smartdown
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -0,0 +1,23 @@
1
+ require 'smartdown/model/answer/base'
2
+
3
+ describe Smartdown::Model::Answer::Base do
4
+ let(:question) { :a_question }
5
+ let(:value) { 'a value' }
6
+
7
+ subject(:instance) {Smartdown::Model::Answer::Base.new(question, value)}
8
+
9
+ specify { expect(instance.question).to eql question }
10
+
11
+ describe "value parsing" do
12
+ it "should assign the return value of parse_value (to be implemented by sub-classes) to value" do
13
+ expect_any_instance_of(Smartdown::Model::Answer::Base).to receive(:parse_value).with(value).and_return("parsed value")
14
+ expect(instance.value).to eql "parsed value"
15
+ end
16
+ end
17
+
18
+ describe "simple type behaviour" do
19
+ [:==, :<, :>, :<=, :>=, :to_s, :to_i, :to_f, :+, :-, :*, :/].each do |method|
20
+ it { should respond_to(method) }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,77 @@
1
+ require 'smartdown/model/answer/date'
2
+ require 'smartdown/model/element/question/date'
3
+
4
+ describe Smartdown::Model::Answer::Date do
5
+ let(:date_string) { "2014-9-4" }
6
+ let(:question) { Smartdown::Model::Element::Question::Date.new("a_date") }
7
+ subject(:instance) { described_class.new(question, date_string) }
8
+
9
+ specify { expect(instance.value).to eql Date.new(2014, 9, 4) }
10
+ specify { expect(instance.to_s).to eql "2014-9-4" }
11
+
12
+
13
+ describe "comparisons" do
14
+ let(:date_string) { "2000-1-10" }
15
+
16
+ context "comparing against ::Dates" do
17
+
18
+ specify { expect(instance == Date.new(2000, 1, 10)).to eql true }
19
+
20
+ specify { expect(instance < Date.new(2000, 1, 11)).to eql true }
21
+ specify { expect(instance < Date.new(2000, 1, 10)).to eql false }
22
+ specify { expect(instance < Date.new(2000, 1, 9)).to eql false }
23
+
24
+ specify { expect(instance > Date.new(2000, 1, 11)).to eql false }
25
+ specify { expect(instance > Date.new(2000, 1, 10)).to eql false }
26
+ specify { expect(instance > Date.new(2000, 1, 9)).to eql true }
27
+
28
+ specify { expect(instance <= Date.new(2000, 1, 11)).to eql true }
29
+ specify { expect(instance <= Date.new(2000, 1, 10)).to eql true }
30
+ specify { expect(instance <= Date.new(2000, 1, 9)).to eql false }
31
+
32
+ specify { expect(instance >= Date.new(2000, 1, 11)).to eql false }
33
+ specify { expect(instance >= Date.new(2000, 1, 10)).to eql true }
34
+ specify { expect(instance >= Date.new(2000, 1, 9)).to eql true }
35
+ end
36
+
37
+ context "comparing against strings" do
38
+ specify { expect(instance == "2000-1-10").to eql true }
39
+
40
+ specify { expect(instance < "2000-1-11").to eql true }
41
+ specify { expect(instance < "2000-1-10").to eql false }
42
+ specify { expect(instance < "2000-1-9").to eql false }
43
+
44
+ specify { expect(instance > "2000-1-11").to eql false }
45
+ specify { expect(instance > "2000-1-10").to eql false }
46
+ specify { expect(instance > "2000-1-9").to eql true }
47
+
48
+ specify { expect(instance <= "2000-1-11").to eql true }
49
+ specify { expect(instance <= "2000-1-10").to eql true }
50
+ specify { expect(instance <= "2000-1-9").to eql false }
51
+
52
+ specify { expect(instance >= "2000-1-11").to eql false }
53
+ specify { expect(instance >= "2000-1-10").to eql true }
54
+ specify { expect(instance >= "2000-1-9").to eql true }
55
+ end
56
+
57
+ context "comparing against Answer::Dates" do
58
+ specify { expect(instance == described_class.new(nil, "2000-1-10")).to eql true }
59
+
60
+ specify { expect(instance < described_class.new(nil, "2000-1-11")).to eql true }
61
+ specify { expect(instance < described_class.new(nil, "2000-1-10")).to eql false }
62
+ specify { expect(instance < described_class.new(nil, "2000-1-9")).to eql false }
63
+
64
+ specify { expect(instance > described_class.new(nil, "2000-1-11")).to eql false }
65
+ specify { expect(instance > described_class.new(nil, "2000-1-10")).to eql false }
66
+ specify { expect(instance > described_class.new(nil, "2000-1-9")).to eql true }
67
+
68
+ specify { expect(instance <= described_class.new(nil, "2000-1-11")).to eql true }
69
+ specify { expect(instance <= described_class.new(nil, "2000-1-10")).to eql true }
70
+ specify { expect(instance <= described_class.new(nil, "2000-1-9")).to eql false }
71
+
72
+ specify { expect(instance >= described_class.new(nil, "2000-1-11")).to eql false }
73
+ specify { expect(instance >= described_class.new(nil, "2000-1-10")).to eql true }
74
+ specify { expect(instance >= described_class.new(nil, "2000-1-9")).to eql true }
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,98 @@
1
+ require 'smartdown/model/answer/date'
2
+ require 'smartdown/model/element/question/date'
3
+
4
+ describe Smartdown::Model::Answer::Salary do
5
+ let(:salary_string) { "500-week" }
6
+ let(:question) { Smartdown::Model::Element::Question::Date.new("a_date") }
7
+ subject(:instance) { described_class.new(question, salary_string) }
8
+
9
+ specify { expect(instance.period).to eql('week') }
10
+ specify { expect(instance.amount_per_period).to eql(500.00) }
11
+
12
+ it "as a string, it should declare itself in the initial format provided" do
13
+ expect(instance.to_s).to eql("500.00 per week")
14
+ end
15
+
16
+ context "declared by week" do
17
+ let(:salary_string) { "500-week" }
18
+ specify { expect(instance.value).to eql 500.0 * 52 }
19
+ end
20
+
21
+ context "declared by month" do
22
+ let(:salary_string) { "2000-month" }
23
+ specify { expect(instance.value).to eql 2000.0 * 12 }
24
+ end
25
+
26
+ context "declared by year" do
27
+ let(:salary_string) { "20000-year" }
28
+ specify { expect(instance.value).to eql 20000.0 }
29
+ end
30
+
31
+
32
+ describe "comparisons" do
33
+ let(:salary_string) { "1200-week" } # equivalent to 62,400 yearly or 5200 monthly
34
+
35
+ context "comparing against ::Floats" do
36
+ specify { expect(instance == 62400.0).to eql true }
37
+
38
+ specify { expect(instance < 62400.1).to eql true }
39
+ specify { expect(instance < 62400.0).to eql false }
40
+ specify { expect(instance < 62399.9).to eql false }
41
+
42
+ specify { expect(instance > 62400.1).to eql false }
43
+ specify { expect(instance > 62400.0).to eql false }
44
+ specify { expect(instance > 62399.9).to eql true }
45
+
46
+ specify { expect(instance <= 62400.1).to eql true }
47
+ specify { expect(instance <= 62400.0).to eql true }
48
+ specify { expect(instance <= 62399.9).to eql false }
49
+
50
+ specify { expect(instance >= 62400.1).to eql false }
51
+ specify { expect(instance >= 62400.0).to eql true }
52
+ specify { expect(instance >= 62399.9).to eql true }
53
+ end
54
+
55
+ context "comparing against strings" do
56
+ specify { expect(instance == "1200-week").to eql true }
57
+ specify { expect(instance == "5200-month").to eql true }
58
+ specify { expect(instance == "62400-year").to eql true }
59
+ specify { expect(instance == "10-month").to eql false }
60
+
61
+ specify { expect(instance < "62400.1-year").to eql true }
62
+ specify { expect(instance < "5200.0-month").to eql false }
63
+ specify { expect(instance < "1199.9-week").to eql false }
64
+
65
+ specify { expect(instance > "1200.1-week").to eql false }
66
+ specify { expect(instance > "62400-year").to eql false }
67
+ specify { expect(instance > "5199.9-month").to eql true }
68
+
69
+ specify { expect(instance <= "62400.1-year").to eql true }
70
+ specify { expect(instance <= "5200.0-month").to eql true }
71
+ specify { expect(instance <= "1199.9-week").to eql false }
72
+
73
+ specify { expect(instance >= "1200.1-week").to eql false }
74
+ specify { expect(instance >= "62400-year").to eql true }
75
+ specify { expect(instance >= "5199.9-month").to eql true }
76
+ end
77
+
78
+ context "comparing against Answer::Salaries" do
79
+ specify { expect(instance == described_class.new(nil, "1200-week")).to eql true }
80
+
81
+ specify { expect(instance < described_class.new(nil, "1200.1-week")).to eql true }
82
+ specify { expect(instance < described_class.new(nil, "1200.0-week")).to eql false }
83
+ specify { expect(instance < described_class.new(nil, "1199.9-week")).to eql false }
84
+
85
+ specify { expect(instance > described_class.new(nil, "1200.1-week")).to eql false }
86
+ specify { expect(instance > described_class.new(nil, "1200.0-week")).to eql false }
87
+ specify { expect(instance > described_class.new(nil, "1199.9-week")).to eql true }
88
+
89
+ specify { expect(instance <= described_class.new(nil, "1200.1-week")).to eql true }
90
+ specify { expect(instance <= described_class.new(nil, "1200.0-week")).to eql true }
91
+ specify { expect(instance <= described_class.new(nil, "1199.9-week")).to eql false }
92
+
93
+ specify { expect(instance >= described_class.new(nil, "1200.1-week")).to eql false }
94
+ specify { expect(instance >= described_class.new(nil, "1200.0-week")).to eql true }
95
+ specify { expect(instance >= described_class.new(nil, "1199.9-week")).to eql true }
96
+ end
97
+ end
98
+ end
@@ -3,9 +3,9 @@ require 'smartdown/model/node'
3
3
  describe Smartdown::Model::Node do
4
4
  let(:name) { "my node" }
5
5
  let(:elements) { [] }
6
+ subject(:node) { described_class.new(name, elements) }
6
7
 
7
8
  describe "#new" do
8
- subject(:node) { described_class.new(name, elements) }
9
9
 
10
10
  it "accepts name and list of body blocks" do
11
11
  expect(node.name).to eq(name)
@@ -29,4 +29,48 @@ describe Smartdown::Model::Node do
29
29
  end
30
30
  end
31
31
  end
32
+
33
+ describe "#questions" do
34
+ context "with seval elements, some of which are questions" do
35
+ let(:elements) { [
36
+ Smartdown::Model::Element::MarkdownHeading.new("A Heading"),
37
+ Smartdown::Model::Element::Question::Date.new("a_date_question"),
38
+ Smartdown::Model::Element::Question::MultipleChoice.new("a_multiple_choice_question"),
39
+ Smartdown::Model::Element::MarkdownParagraph.new("Some text"),
40
+ ] }
41
+ specify { expect(node.questions).to eq elements[1..2] }
42
+ end
43
+ end
44
+
45
+ describe "#next_node_rules" do
46
+ context "with elements, one of which is a NextNodeRules questions" do
47
+ let(:elements) { [
48
+ Smartdown::Model::Element::MarkdownHeading.new("A Heading"),
49
+ Smartdown::Model::NextNodeRules.new(:rules)
50
+ ] }
51
+ specify { expect(node.next_node_rules).to eq elements[1] }
52
+ end
53
+ end
54
+
55
+ describe "#start_button" do
56
+ context "with elements, one of which is a StartButton questions" do
57
+ let(:elements) { [
58
+ Smartdown::Model::Element::StartButton.new(:a_start_node),
59
+ Smartdown::Model::NextNodeRules.new(:rules)
60
+ ] }
61
+ specify { expect(node.start_button).to eq elements[0] }
62
+ end
63
+ end
64
+
65
+ describe "#is_start_page_node?" do
66
+ context "with a StartButton element" do
67
+ let (:elements) { [Smartdown::Model::Element::StartButton.new(:some_start_node)] }
68
+ specify { expect(node.is_start_page_node?).to eql true }
69
+ end
70
+
71
+ context "without a StartButton element" do
72
+ let (:elements) { [] }
73
+ specify { expect(node.is_start_page_node?).to eql false }
74
+ end
75
+ end
32
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2014-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parslet
16
- requirement: &7733220 !ruby/object:Gem::Requirement
16
+ requirement: &6529700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.6.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *7733220
24
+ version_requirements: *6529700
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &7731020 !ruby/object:Gem::Requirement
27
+ requirement: &6526340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.0.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *7731020
35
+ version_requirements: *6526340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &7744660 !ruby/object:Gem::Requirement
38
+ requirement: &6541220 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *7744660
46
+ version_requirements: *6541220
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: gem_publisher
49
- requirement: &7742640 !ruby/object:Gem::Requirement
49
+ requirement: &6539420 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *7742640
57
+ version_requirements: *6539420
58
58
  description:
59
59
  email: david.heath@digital.cabinet-office.gov.uk
60
60
  executables:
@@ -117,6 +117,10 @@ files:
117
117
  - lib/smartdown/model/predicate/otherwise.rb
118
118
  - lib/smartdown/model/node.rb
119
119
  - lib/smartdown/model/front_matter.rb
120
+ - lib/smartdown/model/answer/date.rb
121
+ - lib/smartdown/model/answer/base.rb
122
+ - lib/smartdown/model/answer/salary.rb
123
+ - lib/smartdown/model/answer/multiple_choice.rb
120
124
  - lib/smartdown/model/element/conditional.rb
121
125
  - lib/smartdown/model/element/markdown_paragraph.rb
122
126
  - lib/smartdown/model/element/start_button.rb
@@ -182,6 +186,9 @@ files:
182
186
  - spec/engine_spec.rb
183
187
  - spec/model/node_spec.rb
184
188
  - spec/model/flow_spec.rb
189
+ - spec/model/answer/base_spec.rb
190
+ - spec/model/answer/salary_spec.rb
191
+ - spec/model/answer/date_spec.rb
185
192
  - spec/model/predicates/set_membership_spec.rb
186
193
  - spec/model/predicates/combined_spec.rb
187
194
  - spec/model/predicates/comparison_spec.rb
@@ -203,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
210
  version: '0'
204
211
  segments:
205
212
  - 0
206
- hash: 2695022002413728177
213
+ hash: -2794088758218871255
207
214
  required_rubygems_version: !ruby/object:Gem::Requirement
208
215
  none: false
209
216
  requirements:
@@ -212,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
219
  version: '0'
213
220
  segments:
214
221
  - 0
215
- hash: 2695022002413728177
222
+ hash: -2794088758218871255
216
223
  requirements: []
217
224
  rubyforge_project:
218
225
  rubygems_version: 1.8.11
@@ -271,6 +278,9 @@ test_files:
271
278
  - spec/engine_spec.rb
272
279
  - spec/model/node_spec.rb
273
280
  - spec/model/flow_spec.rb
281
+ - spec/model/answer/base_spec.rb
282
+ - spec/model/answer/salary_spec.rb
283
+ - spec/model/answer/date_spec.rb
274
284
  - spec/model/predicates/set_membership_spec.rb
275
285
  - spec/model/predicates/combined_spec.rb
276
286
  - spec/model/predicates/comparison_spec.rb