Skip to content

Instantly share code, notes, and snippets.

View MaksimenkoPG's full-sized avatar

Maksimenko Pavel MaksimenkoPG

  • [d.i.p]team
  • Luxembourg
View GitHub Profile
@MaksimenkoPG
MaksimenkoPG / create_app_dir.sh
Last active May 16, 2021 18:44
ruby_app_from_scratch.001
mkdir ruby_app_from_scratch && cd ruby_app_from_scratch
@MaksimenkoPG
MaksimenkoPG / install_bundler.sh
Last active May 16, 2021 18:44
ruby_app_from_scratch.002
gem install bundler -v 2.2.17 && bundler init
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
gem 'faraday', '1.4.1'
bundle install
# irb
require 'faraday'
url = 'https://api.github.com/repos/MaksimenkoPG/ruby_app_boilerplate'
response = Faraday.get(url)
puts response.status
puts response.body
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
gem 'faraday', '1.4.1'
gem 'rake', '13.0.3'
Dir.glob('lib/tasks/**/*.rake').each { |file_path| load file_path }
mkdir -p lib/tasks
# lib/tasks/print_repository_info.rake
require 'faraday'
desc 'Print repo info, usage: rake print_repository_info repository_url=repository_url'
task :print_repository_info do
default_url = 'https://api.github.com/repos/MaksimenkoPG/ruby_app_boilerplate'
url = ENV['repository_url'] || default_url
response = Faraday.get(url)
puts response.status
rake -T
=> rake print_repository_info # Print repo info, usage: rake print_repository_info repository_url=repository_url