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/console | |
PrintRepositoryInfo.perform(url: 'https://api.github.com/repos/rails/rails') |
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
chmod +x bin/console |
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
#!/usr/bin/env ruby | |
require 'irb' | |
require_relative File.join(File.dirname(File.expand_path(__dir__)), 'config/application') | |
def reload! | |
puts Application.load_libs | |
end | |
IRB.start |
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
mkdir bin |
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
rake print_repository_info repository_url=https://api.github.com/repos/rails/rails |
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
# lib/tasks/print_repository_info.rake | |
desc 'Print repo info, usage: rake print_repository_info repository_url=repository_url' | |
task print_repository_info: :environment do | |
PrintRepositoryInfo.perform url: ENV['repository_url'] | |
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
# Rakefile | |
task :environment do | |
require_relative 'config/application' | |
end | |
Dir.glob('lib/tasks/**/*.rake').each { |file_path| load file_path } |
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
desc 'Foo' | |
task foo: :environment do | |
... | |
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
# irb | |
require_relative 'config/application' | |
PrintRepositoryInfo.perform(url: 'https://api.github.com/repos/rails/rails') |
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
# config/boot.rb | |
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | |
require 'bundler/setup' # Set up gems listed in the Gemfile. |
NewerOlder