I wrote these two methods using Ruby 2.3.1, the tests require the minitest gem to be installed on your system.
You can run the tests using the command
ruby flatten_recursion_test.rb ruby flatten_regex_test.rb
Here is a summary of the two methods:
$ brew tap MikeRogers0/homebrew-sass | |
==> Tapping mikerogers0/sass | |
Cloning into '/usr/local/Homebrew/Library/Taps/mikerogers0/homebrew-sass'... | |
remote: Counting objects: 4, done. | |
remote: Compressing objects: 100% (4/4), done. | |
remote: Total 4 (delta 0), reused 2 (delta 0), pack-reused 0 | |
Unpacking objects: 100% (4/4), done. | |
Tapped 1 formula (28 files, 22.5KB) | |
Mike at Michaels-MacBook-Pro in ~ |
$ brew install sass/sass/sass | |
Updating Homebrew... | |
==> Auto-updated Homebrew! | |
Updated 1 tap (sass/sass). | |
No changes to formulae. | |
==> Installing sass from sass/sass | |
==> Downloading https://github.com/sass/dart-sass/archive/1.4.0.tar.gz | |
Already downloaded: /Users/Mike/Library/Caches/Homebrew/sass-1.4.0.tar.gz | |
==> /usr/local/opt/dart/bin/pub get |
$ brew install sass/sass/sass | |
Updating Homebrew... | |
==> Migrating tap caskroom/cask to homebrew/cask... | |
Moving /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask... | |
Changing remote from https://github.com/caskroom/homebrew-cask to https://github.com/Homebrew/homebrew-cask... | |
==> Auto-updated Homebrew! | |
Updated 4 taps (heroku/brew, homebrew/core, homebrew/php, homebrew/cask). | |
==> New Formulae | |
bitwarden-cli clozure-cl density howard-hinnant-date kubecfg mk-configure soundpipe vsts-cli | |
brew-php-switcher confluent-oss fortio kakoune libheif pygitup taskell |
brew install puma/puma/puma-dev && | |
sudo puma-dev -setup && | |
puma-dev -install && | |
security add-trusted-cert -k login.keychain-db ~/Library/Application\ Support/io.puma.dev/cert.pem |
curl get.pow.cx/uninstall.sh | sh && | |
brew install puma/puma/puma-dev && | |
sudo puma-dev -setup && | |
puma-dev -install && | |
security add-trusted-cert -k login.keychain-db ~/Library/Application\ Support/io.puma.dev/cert.pem && | |
mv ~/.pow/* ~/.puma-dev |
I wrote these two methods using Ruby 2.3.1, the tests require the minitest gem to be installed on your system.
You can run the tests using the command
ruby flatten_recursion_test.rb ruby flatten_regex_test.rb
Here is a summary of the two methods:
<%= yeild :some_content %> |
Mikes-Mac-Pro:ExampleApp MikeRogers$ fr rspec | |
.................................................................................................... | |
---- MEMORY THRESHOLD ---- | |
THRESHOLD: 1 MB | |
-- SUMMARY -- | |
Worst Requests: | |
1. Mar 27 14:14:13, 18432 KB, home#index | |
2. Mar 27 14:14:12, 16384 KB, contact_us#create | |
3. Mar 27 14:14:08, 6072 KB, contact_us#create |
ruby '2.2.1' | |
source 'https://rails-assets.org' do | |
gem 'rails-assets-bootstrap' | |
end | |
source 'https://rubygems.org' do | |
gem 'rails', '4.2' | |
# Database / Memcache / Solr |
class Seeds | |
def self.add model, attrs | |
object = model.find_or_initialize_by(attrs) | |
if object.new_record? && object.save | |
puts "#{object}" | |
end | |
end | |
end |