FindMyMac, and its helper class, Scraper, reaches out to Apple's refurbished computer site to compile a searchable list of available computers. Scraper initiates the process by scraping the Apple site and returning a hash array of computers. FindMyMac then loads up the corresponding @iMac, @iMacPro, @MacBookAir, etc., objects, queries the user about which configuration the user would like to search, and returns a list of available computers matching that configuration. The user may then select from the list to see additional information, including a link directly back to the details page for the selected computer.
Add this line to your application's Gemfile:
gem 'findMyMac'
And then execute:
$ bundle
Or install it yourself as:
$ gem install findMyMac
There are two ways to use this gem:
-
Create a hash of available refurbished computers from the Mac site.
hash = Scraper::scrape_refurbished_mac
-
Instantiate a finder object:
finder = FindMyMac::Finder.new
-
Once finder has been instantiated, the entry point to running the search is:
finder.findMacs
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/marysue/findMyMac. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the (http://contributor-covenant.org) code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the FindMyMac project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.