{"id":18056525,"url":"https://github.com/burtlo/ruby-automation","last_synced_at":"2025-04-11T02:11:13.256Z","repository":{"id":12569560,"uuid":"15240056","full_name":"burtlo/ruby-automation","owner":"burtlo","description":"A five-day program to teach Ruby with the focus on building tools and automation.","archived":false,"fork":false,"pushed_at":"2013-12-19T23:15:26.000Z","size":376,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T23:35:28.685Z","etag":null,"topics":["automation","rspec","ruby","testing"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/burtlo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-16T23:25:28.000Z","updated_at":"2022-10-08T22:18:59.000Z","dependencies_parsed_at":"2022-07-15T11:30:35.028Z","dependency_job_id":null,"html_url":"https://github.com/burtlo/ruby-automation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burtlo%2Fruby-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burtlo%2Fruby-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burtlo%2Fruby-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burtlo%2Fruby-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/burtlo","download_url":"https://codeload.github.com/burtlo/ruby-automation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328160,"owners_count":21085261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","rspec","ruby","testing"],"created_at":"2024-10-31T01:15:16.417Z","updated_at":"2025-04-11T02:11:13.232Z","avatar_url":"https://github.com/burtlo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## Day 1 - Ruby as a Tool\n\nBefore we launch into using Ruby lets first use Ruby to automate some simple\ntasks and scripts. We will forgo the classic introduction to Ruby syntax at\nthe start and understand how we can use various tools within the ruby\neco-system to make testing easier.\n\n\u003e While we are not focusing on the Ruby language, we will be working on\n\u003e exercises that will bring us in contact with the Ruby language in\n\u003e convert and overt ways. We will definitely stop and discuss core essential\n\u003e Ruby syntax as we use it to solve real problems.\n\nLets start with a number of fundamental tools of a Ruby toolchain. We will\nuse these tools in various exercises to see how Ruby can help us immediately\nsolve problems and reduce complexity of our tools and processes.\n\n* Rake\n* Guard\n* Bundler\n* Gem\n\nWe want to interact with our scripts through: command-line input; command-line parameters; environment variables; and files.\n\n* ENV\n* ARGV\n* Kernel.gets\n* Ruby Core: File\n* Ruby Core: Dir\n\nLet's finish our first day of tools creation with some gems that will make our\nlife easier when making command-line tools by generating a better looking\ninterface and generating better fake data.\n\n* Highline\n* Formatador\n\n### Resources\n\n* http://jasonseifer.com/2010/04/06/rake-tutorial\n* https://github.com/guard/guard\n* https://github.com/guard/guard-shell\n* https://github.com/guard/guard-livereload\n* https://github.com/geemus/formatador\n* http://www.awesomecommandlineapps.com/gems.html\n* https://github.com/JEG2/highline\n* http://rubydoc.info/stdlib/core/Kernel:gets\n* http://rubular.com/\n* http://rubydoc.info/stdlib/fileutils/frames\n* http://bundler.io/\nhttp://stackoverflow.com/questions/825748/how-do-i-pass-command-line-arguments-to-a-rake-task\nhttp://patorjk.com/software/taag/#p=display\u0026f=Graffiti\u0026t=Type%20Something%20\n\n## Day 2 - Files and Services\n\nWe want to build on the tools that we created yesterday, extending them to\ntalk to various file formats and start to use different sources and services for them.\n\n* Parsing YAML files\n* Parsing JSON\n* Parsing CSV files\n* Parsing XML with Nokogiri\n\nUsing Sinatra we can create simple interfaces that allow us to mock up existing\nservices. So we will solve the same problem we just solved but solve it again\nthrough API endpoints\n\n* Sinatra\n* Faraday\n* HTTParty\n\nThe data that we have received can get really messy. We want to explore various\nways that we can structure that data to make it easier for us to manage.\n\n* Struct\n* OpenStruct\n* Custom Classes\n\nWith the remaining time in the day we will create our own command-line client\ntool (when Rake just won't do). That allows us to specify our own custom\ncommands and arguments.\n\n* Thor\n\n### Resources\n\n* http://www.awesomecommandlineapps.com/gems.html\n* http://www.yaml.org/YAML_for_ruby.html\n* http://pro.jsonlint.com/\n* http://rubydoc.info/stdlib/csv/frames\n* http://nokogiri.org/\n* http://www.sinatrarb.com/\n* https://github.com/lostisland/faraday\n* https://github.com/jnunemaker/httparty\n* http://rubydoc.info/stdlib/core/Struct\n* http://rubydoc.info/stdlib/ostruct/frames\n* https://github.com/dam5s/happymapper\n* https://github.com/erikhuda/thor\n\n## Day 3 - Databases and Data Structures\n\nNow that we're starting feeling comfortable with Ruby and various tools, let's\nstart to focus on testing with RSpec. We will also expand our tools to talk to\nmultiple databases.\n\n* Patterns for effective tests\n* How tests go wrong\n\n* Talking to a database with ActiveRecord\n* Talking to a multiple databases\n* Modeling tables that don't fit the ActiveRecord paradigm (table names, different primary keys, composite primary keys)\n* Gaining access to the raw connection and writing SQL\n* Knowing the limitations of ActiveRecord (namely speed)\n\n### Ideas\n\n* Convert an existing warm up tests to RSpec\n* Cleaning up Rspec tests with explicit/implicit subject\n* Create test suite for our API functionality that we create yesterday.\n* Breaking apart code over mocking and stubbing\n\n### Resources\n\n* http://guides.rubyonrails.org/active_record_basics.html\n* http://guides.rubyonrails.org/migrations.html\n* http://guides.rubyonrails.org/active_record_validations.html\n* http://guides.rubyonrails.org/active_record_callbacks.html\n* http://guides.rubyonrails.org/association_basics.html\n* http://guides.rubyonrails.org/active_record_querying.html\n* https://github.com/composite-primary-keys/composite_primary_keys\n* https://www.relishapp.com/rspec/\n\n## Day 4 - Testing the Web with RSpec + Capybara\n\nTesting local code is relatively easy, let’s move on to the web. We’ll use the Capybara library to connect RSpec to a virtual web browser.\n\n* Basics of Capybara syntax\n* Thinking about the flow of operations\n* Using the default Rack::Test adapter\n* Replacing Rack::Test with Selenium\n* Replacing Rack::Test with Poltergeist\n* Using VCR to mock remote services\n* Parsing HTML with Nokogiri\n\n### Setup\n\n* Configuring Capybara with Rails and outside of Rails\n* how to find elements on the page\n* troubleshooting techniques\n* save_and_open_page\n* Using js: true to launch with Selenium\n\n## Day 5 - Automation Tools \u0026 Practices\n\n## Missing\n\n* Cucumber\n* Capistrano\n* SSH\n* FTP\n* Threading, Forking and Processes\n* backticks, %x{}, system, and popen\n* YAML anchors \u0026 erb\n* pry\n* bundle open\n* Faker\n* Parsing XML with Happymapper\n* Hashie\n* Ruby - Optional Parameters, Named Parameters, Splats, Monkey Patching\n* Ruby - Block Initializers, instance_eval, instance_exec\n* Domain Specific Languages\n\n### Windows Resources\n\n* https://github.com/adoxa/ansicon","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburtlo%2Fruby-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburtlo%2Fruby-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburtlo%2Fruby-automation/lists"}