RubyMine 2018.2: Отладка удаленно запущенных процессов, chruby, YAML, и другие улучшенияArtem Sarkisov

Привет!

Сегодня вышла новая версия IDE от JetBrains для Ruby и Rails-разработки – RubyMine 2018.2.

В новой версии полно нововведений: переработан вывод типов, что значительно улучшило автодополнения и навигацию по коду, добавлена возможность присоединения отладчика к удаленным процессам, улучшена поддержка YAML, добавлены chruby и asdf, и многое другое.

Узнать подробнее о свежих фичах, и скачать новую версию для бесплатного 30-дневного ознакомления можно на странице What's new.

Saint P Rubyconf 2018: 10 июня, Санкт-ПетербургArtem Sarkisov

Привет Ruby и Rails-разработчикам!

10 июня 2018 года состоится конференция для разработчиков на Ruby и Ruby on Rails — Saint P Rubyconf 2018. Слоган конференции — «Ruby: the best parts». Место проведения — Санкт-Петербург, Корпус ИТМО на ул. Ломоносова, 9. Вход свободный, места ограничены. Пожалуйста, зарегистрируйтесь.

Доклады и докладчики:

  • Bozhidar Batsov: RuboCop
  • Nick Sutterer (тема уточняется)
  • Sergey Dolganov: Make API Client Great Again (with Contracts)
  • Anton Davydov: Events. Events. Events!
  • Nikolay Sverchkov: A Healthy Monolith
  • Nikita Shilnikov: ROM.rb & dry-rb in practice
  • Alexey Rodionov: Testing based on Petri nets
  • Vladimir Dementyev: Creativity vs. Metaprogramming

Язык докладов — английский. Подробнее о докладах и спикерах на сайте.

Организатор: Saint P Ruby User Group

Upload Files Directly To S3 Using Paperclip And Dropzone.jsAmit Bairagi

It’s usually the small time-consuming tasks that frustrate us the most. Such as uploading a file to S3; the requirement is pretty simple but the method chosen to upload the file will decide the efficiency of the task. As uploading files is a feature that most applications require, RailsCarma has compiled a brief tutorial on one of the best methods of getting this task done efficiently: using Paperclip and Dropzone.js.

  • Paperclip is a popular choice for uploading images and files as it offers great features to handle the attachments; ‘paperclip’ gem is the go-to option. Paperclip allows you to upload multiple images and files, generate thumbnails and even automatically resize the images. It boasts of a large and active community making it the top choice of most developers.
  • Dropzone.js is an open source library with file drag & drop (with image preview) features.
  • Amazon S3 is a simple storage device for data storage. We can use it to retrieve images and all type of files.

Why Paperclip? Paperclip is a popular file uploading tool for the following reasons:

  • Supports File Caching:If a form fails to validate, we don’t want the user to pick his file again and re-upload it. Therefore, file caching is necessary from a UX standpoint. And it also conserves the bandwidth.

  • Processes Images Paperclip is able to resize and crop images to several different formats thus allowing the developer to choose the library.

  • Simplifies The Task! Paperclip gem does not pollute your code and is easy to test!

  • Allows File Processing Paperclip allows file processing for EXIF data extraction and thumbnail creation of uploaded PDFs, PSDs, DOCs, XLSXs.

  • Provides CDN & Storage-Service Support This is a big plus as we want to keep the bandwidth to our servers as low as possible and avoid possible data loss due to server failure

  • Offers On-The-Fly Processing Paperclip processes images and files on a per-request basis. This is an innovative feature that enables developers to create custom content that adapts best to different situations.

What Are The Dropzone Asynchronous Events?

  • addedfile: When a file is added to the list.

  • removedfile: Used whenever a file is removed from the list. You can listen to this and delete the file from your server if you want to.

  • thumbnail: When the thumbnail has been generated. It receives the data URL as second parameter.

  • error: An error occurred receives the error message as the second parameter. And if the error was due to xmlhttprequest, the xhr object is received as the third parameter.

  • processing: When a file is processed (since there is a queue, not all files are processed immediately). This event was previously called processingfile. drop: The user dropped something onto the drop zone.

How Can We Configure Paperclip In Our Application?

has_attached _file: asset :storage => :s3 :S3_host_name => ENV[“S3_HOST_NAME”] :S3_region => ENV[“S3_REGION”] :S3_protocol => ENV[“S3_PROTOCOL”] :path => “:account_id/:class/:source_id/:attachment/:file_name”,:s3_headers => {‘ContentDisposition’ => ‘attachment’, ‘content-type’ =>‘application/octet_stream’}, :bucket => ENV[“S3_BUCKET”], :s3_credentials => Proc.new{|a| a.instance.s3_credentials} Do_not_validate_attachment_file_type :asset def s3_credentials {:access_key_id => ENV[“S3_ACCESS_KEY_ID”], :secret_access_key => ENV[“S3_SECRET_ACCESS_KEY”]} end

For more tips on Ruby on Rails visit www.railscarma.com

RubyC-2018 full speakers list announcedAlex Soulim

RubyC is a European conference devoted to Ruby, Rails, and related technologies.

Traditionally, the organizer, Svitla Systems, gathers Ruby enthusiasts, visionaries, and inspiring thinkers from all over the world. RubyC is a place to meet like-minded tech professionals, exchange knowledge, discuss the latest news, and learn about innovations that can transform businesses. In addition, of course, this is the best place for beneficial networking and wonderful entertainment!

This year, RubyC will take place on 2-3 June, at Premier Hotel Rus of Kyiv, Ukraine.

Tickets are already in the sale. Two or more tickets purchase gives a 10% discount!

Two-day program includes 14 Speakers from US, Germany, UK, Serbia, Italy, Ukraine and Poland:

  • Charles Nutter: JRuby in 2018: Building, Deploying, and Scaling Your Apps
  • Andrzej Krzywda: From Post.create to PostPublished.new
  • Nick Sutterer: Enterprise Ruby - Let’s Talk Business!
  • Duana Stanley: The Art of Technical Decision Making
  • Paolo Perrotta: Machine Learning Explained to Humans
  • Tobias Pfeiffer: Where do Rubyists go?
  • Tim Rogers: Miles more maintainable: building APIs with the middleware pattern
  • Ivan Nemytchenko: Rails hurts, because you're using it wrong. Let's fix that.
  • Sergiy Kukunin: Clean architecture that harms your code
  • Artur Hebda: Code is not important... or is it?
  • Iryna Zayats: Adventures in the World of (Algorithmic) Complexity
  • Vladyslav Hesal: Authentication in Single Page Applications
  • Victor Shepelev: A tale of query languages. Is GraphQL The Chosen One?
  • Volodymyr Vorobiov: The Clean Architecture: How to Grow From Startup to Enterprise

RubyC is very grateful to Golden Sponsors: MLSDev, Toptal, Railsware and Ruby Sponsor RubyGarage.

Паттерны ООП в Ruby: часть 2Копылов Владислав

alt text Рад поделиться второй частью моих заметок об паттернах ООП. В данный материал попали такие паттерны как: Фасад, Состояние, Цепочка обязанностей, Посетитель, Сервис. Все примеры реализованы на языке Ruby. Приятного чтения.