rbenv install 'versão do ruby'
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
# Lint class | |
class Lint | |
def even_numbers | |
numbers_list = [30, 434, 10, 4, 6, 9, 98, 7, 14, 21] | |
numbers_list.each do |number| | |
puts 'Even number', number if number.even? | |
end | |
end | |
end |
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
15:19 $ rubocop lint.rb -f offenses -f clang | |
-- | |
0 Total |
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
lint.rb:1:1: W: Script file lint.rb doesn't have execute permission. | |
#!/usr/bin/env ruby | |
^^^^^^^^^^^^^^^^^^^ | |
lint.rb:2:1: C: Missing top-level class documentation comment. | |
class Lint | |
^^^^^ | |
lint.rb:3:1: C: Use 2 (not 0) spaces for indentation. | |
def get_even_numbers | |
lint.rb:3:5: C: Do not prefix reader method names with get_. |
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
Documentation: | |
Enabled: false | |
AllCops: | |
Include: | |
- '**/Rakefile' | |
Exclude: | |
- 'step_definitions/**' | |
- 'screenshots/**/*' | |
- '*.feature' |
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
#!/bin/bash | |
# change the folder to /tools | |
cd $(dirname $(which emulator)) && ./emulator -avd Droid22 > /dev/null & | |
cd |
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
require 'oily_png' | |
require 'open-uri' | |
include ChunkyPNG::Color | |
def starts_with(item, prefix) | |
prefix = prefix.to_s | |
item[0, prefix.length] == prefix | |
end | |
# compares two images on disk, returns the % difference |
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
brew install pkg-config | |
brew uninstall imagemagick | |
brew install imagemagick@6 | |
brew link imagemagick@6 --force |
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
def expirate_code | |
sms_code = [] | |
page = Nokogiri::HTML(open(CHANNEL_MANAGER, | |
http_basic_authentication: | |
[CREDENTIALS[:channel_manager][:login], | |
CREDENTIALS[:channel_manager][:password]])) | |
page.search('pre').each do |sms| | |
sms_code << sms.to_s.tr('<pre>', '') |