react: Move inputs (cells, operations) to input object#1130
Merged
petertseng merged 2 commits intoexercism:masterfrom Jan 16, 2018
petertseng:react
Merged
react: Move inputs (cells, operations) to input object#1130petertseng merged 2 commits intoexercism:masterfrom petertseng:react
petertseng merged 2 commits intoexercism:masterfrom
petertseng:react
Conversation
In the new schema in #1074, expected is REQUIRED. Since all expectations are encoded in the `operations` array, we just expect nothing. ```ruby operations = false ARGF.each_line { |l| operations ||= l.include?('"operations"') first_non_space = l.index(/\S/) if operations && l.strip == ?] l["\n"] = ",\n" puts l puts ' ' * first_non_space + '"expected": {}' operations = false else puts l end } ```
react 1.1.0 As proposed and accepted in #996 ```ruby indent = false operations = false ARGF.each_line { |l| if l.include?('version') ver = l.split(?")[3] ver_components = ver.split(?.).map(&:to_i) ver_components[1] += 1 ver_components[2] = 0 l[ver] = ver_components.join(?.) end first_non_space = l.index(/\S/) if l.include?('"cells"') puts ' ' * first_non_space + '"input": {' indent = true end operations ||= l.include?('"operations"') l.delete!(?,) if operations && l.strip == '],' puts "#{' ' if indent}#{l}" if operations && l.strip == ?] puts ' ' * first_non_space + '},' operations = false indent = false end } ```
petertseng
commented
Jan 16, 2018
| ], | ||
| "operations": [ | ||
| { | ||
| "type": "expect_cell_value", |
Member
Author
There was a problem hiding this comment.
In its current state, it is not possible to consistently place expect_cell_value in expected, so I do not.
| ], | ||
| "operations": [ | ||
| { | ||
| "type": "expect_cell_value", |
Member
Author
There was a problem hiding this comment.
Note that this expect_cell_value comes before a set_value, therefore it is not possible to consistently place expect_cell_value in expected. Ordering is important. To place expect_cell_value in expected, we would need to redefine how expect_cell_value works so that it may refer to a point in time before/after certain other operations.
rpottsoh
approved these changes
Jan 16, 2018
petertseng
added a commit
to petertseng/exercism-ceylon
that referenced
this pull request
Jan 16, 2018
input object hamming 2.1.0 exercism/problem-specifications#1129 largest-series-product 1.1.0 exercism/problem-specifications#1114 leap 1.2.0 exercism/problem-specifications#1112 react 1.1.0 exercism/problem-specifications#1130 rna-transcription 1.2.0 exercism/problem-specifications#1111 sieve 1.1.0 exercism/problem-specifications#1105
petertseng
added a commit
to exercism/ceylon
that referenced
this pull request
Jan 16, 2018
input object hamming 2.1.0 exercism/problem-specifications#1129 largest-series-product 1.1.0 exercism/problem-specifications#1114 leap 1.2.0 exercism/problem-specifications#1112 react 1.1.0 exercism/problem-specifications#1130 rna-transcription 1.2.0 exercism/problem-specifications#1111 sieve 1.1.0 exercism/problem-specifications#1105
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
react 1.1.0
As proposed and accepted in #996
also note the additional commit that adds
"expected": {}, since it's required but we expect nothing other than what was already expected inoperations.