This file contains hidden or 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
| mkdir ruby_app_from_scratch && cd ruby_app_from_scratch |
This file contains hidden or 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
| gem install bundler -v 2.2.17 && bundler init |
This file contains hidden or 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
| # frozen_string_literal: true | |
| source "https://rubygems.org" | |
| git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } | |
| gem 'faraday', '1.4.1' |
This file contains hidden or 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
| bundle install |
This file contains hidden or 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
| # irb | |
| require 'faraday' | |
| url = 'https://api.github.com/repos/MaksimenkoPG/ruby_app_boilerplate' | |
| response = Faraday.get(url) | |
| puts response.status | |
| puts response.body |
This file contains hidden or 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
| # 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' |
This file contains hidden or 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
| Dir.glob('lib/tasks/**/*.rake').each { |file_path| load file_path } |
This file contains hidden or 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
| mkdir -p lib/tasks |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| rake -T | |
| => rake print_repository_info # Print repo info, usage: rake print_repository_info repository_url=repository_url |
OlderNewer