Julien Michot
Ruby / Javascript Freelance
gem synvert
twitter : @jumichot
github : jumichot
synvert
First commit : January 2014
synvert =
syntax + convert
Syntax :
Static analysis
Security
https://github.com/presidentbeef/brakeman
Styleguide
https://github.com/bbatsov/rubocop
Test
https://github.com/relevance/rcov
https://github.com/colszowka/simplecov
https://github.com/makaroni4/sandi_meter
https://github.com/YorickPeterse/ruby-lint
https://github.com/whitesmith/rubycritic
https://github.com/railsbp/rails_best_practices
https://github.com/troessner/reek
https://github.com/metricfu/metric_fu
Quality
Saas
https://codeclimate.com
https://www.pullreview.com
https://houndci.com
Convert
FactoryGirl.create :category
post = create(:category)
Factory girl
RSpec
true.should == true
expect(true).to be_truthy
Rails
AST
http://synvert-tools.herokuapp.com/
https://github.com/xinminlabs/synvert-core/
https://github.com/xinminlabs/synvert-snippets/
- ruby
- rspec
- rails
- factory girl
- shoulda
- will_paginate
Available snippets
Demo Sharetribe
https://github.com/sharetribe/sharetribe
Custom snippet
Synvert::Rewriter.new 'ruby', 'new_safe_navigation_operator' do
if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new("2.2.0")
within_files '**/*.rb' do
within_node type: 'send', message: 'try!' do
replace_with "{{receiver}}.?{{arguments.first.to_source}}"
end
end
end
end
u && u.profile && u.profile.thumbnails
&& u.profiles.thumbnails.large
=> u.?profile.?thumbnails.?large
u.try!(:profile).try!(:thumbnails).try!(:large)
=> u.?profile.?thumbnails.?large
Perfs
https://speakerdeck.com/sferik/writing-fast-ruby
Gem synvert
By julien michot
Gem synvert
- 505