This file contains 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
<body> | |
<div id="container" class="container"> | |
walla walla glub glub | |
</div> | |
</body> | |
This file contains 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
@pikesley: @pezholio I'm aware this may not arise in the time remaining on the internship period, but if you do decide to write a gem for something-something-ODI could you alert us? | |
Sam [3:25 PM] | |
I can show you build-a-gem-101 in like an hour | |
Sam [3:25 PM] | |
Up to and including putting it through travis and publishing to rubygems | |
stephenfortune [3:25 PM] | |
I'd love to see the travis part, but I'm interested in being a fly on the wall to the rationale of creation which was discussed earlier |
This file contains 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
To clarify if non-blocking fashion means making the CSV parsing CPU bound rather than IO Bound, and to check what refactoring is desired (I had previously moved the parse_csv methods to a separate file, not sure if this is required or not, and if it is required it will require rewriting a lot of tests) | |
stephenfortune [2:13 PM] | |
I think that the existing code already has the CSV parsing as CPU bound but it would be helpful to clarify | |
James Smith [2:14 PM] | |
in my mind it’s more that no matter how the parsing is bound (CPU or IO), you can’t tell what it’s doing halfway through - and that’s what we need to be able to do. | |
James Smith [2:14 PM] | |
if that makes sense. And if it is in fact correct. Might not be |
This file contains 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
context "error matching tests" do | |
it "checks for blank rows" do | |
# stream = StringIO.new('"","",') # this returns blank_rows | |
# stream = StringIO.new('"","",\r\n"","",\r\n') # this returns :whitespace | |
# stream = StringIO.new('"a",“b“,"c"""') # should return stray quotes but doesn't - there isn't a stray quote test in current code base | |
# stream = StringIO.new("\"a,\"b\",\"c\"\n") # returns unclosed quotes | |
validator = Csvlint::Validator.new(stream,"header" => false) # dialect options to avoid one liners being read as header | |
expect(validator.valid?).to eql(false) |
This file contains 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
if type == :stray_quote && !wrapper.line.match(csv.row_sep) | |
# above evaluates to true && false | |
# however it is false only by placing bang against wrapper.line.match(csv.row_sep) which evals to either | |
# nil or MatchData - seems a strange way to order flow | |
# basically it want's whatever is matched against the row_sep (generated from the CSV.new of data inputted) to not match | |
# because if it matches then bang generates a false and only a stray_quote is logged | |
build_errors(:line_breaks, :structure) | |
# the tests that exist pass \r rather than \r\n when testing for line breaks |
This file contains 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
# ref - http://blog.honeybadger.io/using-lazy-enumerators-to-work-with-large-files-in-ruby/ | |
# The Lazy Enumerator class contains a number of built in collection and mapping methods | |
# e.g. ```map, flat_map, select, reject, grep, zip, take, take_while, drop, drop_while, cycle``` | |
# the basic way that lazy evaluation works with the above methods is like so | |
enum.lazy.select {|variable| (conditional_eval_of_variable) } # returns an array where the eval returns true | |
# in pseudo code fashion I would imagine it would proceed like this | |
CSVlintValidator.select { |validation| output(@ErrorCollector) if !validation.valid? } # returns object or array for the rows which raise messages | |
# validation.valid? could be rewritten in Csvlint::ErrorCollector to be errors.empty? && warnings.empty? | |
# ~ && info_messages.empty? or the output could only happen when an error arises, informing the user that there is already | |
# one error detected and do they wish to continue evaluating in 'lazy' fashion |
This file contains 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
git clone https://github.com/theodi/chef-csvlint.git | |
cd chef-csvlint/ | |
rbenv local 2.1.6 | |
gem install bundler -v 1.10.5 | |
bundle exec kitchen converge | |
to sanity check your local env | |
which ruby # should return /Users/$USERNAME/.rbenv/shims/ruby | |
which gem # should return /Users/$USERNAME/.rbenv/shims/gem | |
ruby -v # returns ruby version |
This file contains 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
var exportdata = function() { | |
var window = BrowserWindow.getFocusedWindow(); | |
datapackage = new BrowserWindow({width: 450, height: 600, 'always-on-top': true}); | |
datapackage.loadUrl('file://' + __dirname + '/../comma-chameleon/views/datapackage.html'); | |
datapackage.on('closed', function() { | |
datapackage = null; | |
}); |
This file contains 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
var hot = new Handsontable(container, { | |
colHeaders: true, | |
- rowHeaders: true, | |
+ rowHeaders: function(index) { | |
+ if (index === 0){ | |
+ return "Header"; | |
+ } else { | |
+ return index; | |
+ } | |
+ }, |
This file contains 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
// line 54-86, feature-prebaked | |
// inclusion of printErrs is because type returns as undefined | |
function displayValidationMessages(validation) { | |
console.log(JSON.stringify(validation,null, 2)); | |
var $messagePanel = $('#message-panel'); | |
$messagePanel.html("<h4>Validation results <img src='" + validation.badges.png +"' /></h4>"); | |
var resultsTemplate = _.template('<p><%= validation.errors.length %> errors, <%= validation.warnings.length %> warnings and <%= validation.info.length %> info messages:</p>') | |
$messagePanel.append(resultsTemplate({'validation': validation})); | |
//TODO the errorText function below is truncated and isn't doing what it should be doing | |
var printErrs = validation.errors[0]; |
OlderNewer