├── .travis.yml ├── Gemfile ├── .gitignore ├── test ├── test_helper.rb └── trumpy_test.rb ├── bin ├── setup └── console ├── Rakefile ├── lib └── trumpify.rb ├── trumpify.gemspec ├── LICENSE.txt ├── README.md └── CODE_OF_CONDUCT.md /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.2.4 4 | before_install: gem install bundler -v 1.11.2 5 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in trumpify.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /Gemfile.lock 4 | /_yardoc/ 5 | /coverage/ 6 | /doc/ 7 | /pkg/ 8 | /spec/reports/ 9 | /tmp/ 10 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) 2 | require 'trumpify' 3 | 4 | require 'minitest/autorun' 5 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here 9 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | require "rake/testtask" 3 | 4 | Rake::TestTask.new(:test) do |t| 5 | t.libs << "test" 6 | t.libs << "lib" 7 | t.test_files = FileList['test/**/*_test.rb'] 8 | end 9 | 10 | task :default => :spec 11 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "bundler/setup" 4 | require "trumpify" 5 | 6 | # You can add fixtures and/or initialization code here to make experimenting 7 | # with your gem easier. You can also use a different console, if you like. 8 | 9 | # (If you use this, don't forget to add pry to your Gemfile!) 10 | # require "pry" 11 | # Pry.start 12 | 13 | require "irb" 14 | IRB.start 15 | -------------------------------------------------------------------------------- /lib/trumpify.rb: -------------------------------------------------------------------------------- 1 | module Trumpify 2 | module ObjectMixin 3 | def liberals 4 | !true 5 | end 6 | 7 | def president? 8 | true 9 | end 10 | 11 | def method_missing(methId, *args, &block) 12 | method_name = methId.id2name 13 | 14 | # Bail out if called by someone who doesn't support freedom 15 | super unless m = method_name.match(/make_(.*)_great_again/) 16 | send(m.captures[0], *args, &block) 17 | end 18 | 19 | alias_method :old_puts, :puts 20 | 21 | def puts(str) 22 | str.gsub! /Hillary Clinton/, 'Crooked Hillary' 23 | str.gsub! /Bernie Sanders/, 'Crazy Bernie' 24 | str.gsub! /Ted Cruz/, "Lyin' Ted" 25 | str.gsub! /Marco Rubio/, 'Little Marco' 26 | old_puts str 27 | end 28 | end 29 | end 30 | 31 | class Object < BasicObject 32 | include Trumpify::ObjectMixin 33 | end 34 | 35 | -------------------------------------------------------------------------------- /trumpify.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | 5 | Gem::Specification.new do |spec| 6 | spec.name = 'trumpify' 7 | spec.version = '0.1.0' 8 | spec.authors = ['RickR'] 9 | spec.email = ['rick@rudelinux.org'] 10 | 11 | spec.summary = %q{Make ruby great again} 12 | spec.description = %q{Adds make_$METHOD_great_again} 13 | spec.homepage = 'http://rickre.in' 14 | spec.license = 'MIT' 15 | 16 | spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } 17 | spec.bindir = 'exe' 18 | spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } 19 | spec.require_paths = ['lib'] 20 | 21 | spec.add_development_dependency 'bundler', '~> 1.11' 22 | spec.add_development_dependency 'rake', '~> 10.0' 23 | spec.add_development_dependency 'minitest', '~> 5.0' 24 | end 25 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 RickR 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Trumpify 2 | ![Trumpify](http://www.reactiongifs.com/r/trmp.gif) 3 | 4 | 5 | Lately I've seen a lot of blog posts about how people leaving ruby, how slow rails is, 6 | how only stupid people like objects etc. Matz, DHH, Aaron? These are the same old developers 7 | that so out of touch with the common man it's not even funny. 8 | 9 | 10 | Enough is enough. It's time to make ruby great again. 11 | 12 | ## Installation 13 | 14 | Add this line to your application's Gemfile: 15 | 16 | ```ruby 17 | gem 'trumpify' 18 | ``` 19 | 20 | And then execute: 21 | 22 | $ bundle 23 | 24 | Or install it yourself as: 25 | 26 | $ gem install trumpify 27 | 28 | ## Usage 29 | 30 | Step 1: Add `require 'trumpify'` to your project. 31 | Step 2: Replace all your methods with `make_$METHOD_NAME_great_again`. 32 | 33 | ## Example 34 | 35 | ```ruby 36 | 5.make_times_great_again { print "I know code. I have the best codes!" } 37 | ``` 38 | 39 | ![Trumpify](http://www.reactiongifs.com/r/trmp1.gif) 40 | 41 | ## Contributing 42 | 43 | Bug reports and pull requests are welcome on GitHub at https://github.com/rickr/trumpify. 44 | This project is intended to be a safe, welcoming space for collaboration, and contributors 45 | are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. 46 | 47 | 48 | ## License 49 | 50 | The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). 51 | 52 | -------------------------------------------------------------------------------- /test/trumpy_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TrumpifyTest < Minitest::Test 4 | def test_the_truth 5 | assert liberals == false 6 | assert president? 7 | end 8 | 9 | def test_it_works_with_chains 10 | assert_equal %w(damn liberals), 'damn liberals'.make_split_great_again 11 | end 12 | 13 | def test_it_works_with_arguments 14 | assert_equal %w(h a i r p i e c e), 'hairpiece'.make_split_great_again('') 15 | end 16 | 17 | def test_it_works_with_blocks 18 | authentic_mexican_dishes = ['taco bowl'] 19 | 20 | result = authentic_mexican_dishes.make_collect_great_again do |food| 21 | food.upcase 22 | end 23 | 24 | assert_equal ['TACO BOWL'], result 25 | end 26 | 27 | def test_it_works_on_class_methods 28 | o = Object.make_new_great_again 29 | assert_kind_of Object, o 30 | end 31 | 32 | def test_it_corrects_hillary_clinton_supporters 33 | assert_output(/Crooked Hillary for President!/) { puts 'Hillary Clinton for President!' } 34 | end 35 | 36 | def test_it_corrects_bernie_sanders_supporters 37 | assert_output(/Crazy Bernie for President!/) { puts 'Bernie Sanders for President!' } 38 | end 39 | 40 | def test_it_corrects_ted_cruz_supporters 41 | assert_output(/Lyin' Ted for President!/) { puts 'Ted Cruz for President!' } 42 | end 43 | 44 | def test_it_corrects_marco_rubio_supporters 45 | assert_output(/Little Marco for President!/) { puts 'Marco Rubio for President!' } 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, and in the interest of 4 | fostering an open and welcoming community, we pledge to respect all people who 5 | contribute through reporting issues, posting feature requests, updating 6 | documentation, submitting pull requests or patches, and other activities. 7 | 8 | We are committed to making participation in this project a harassment-free 9 | experience for everyone, regardless of level of experience, gender, gender 10 | identity and expression, sexual orientation, disability, personal appearance, 11 | body size, race, ethnicity, age, religion, or nationality. 12 | 13 | Examples of unacceptable behavior by participants include: 14 | 15 | * The use of sexualized language or imagery 16 | * Personal attacks 17 | * Trolling or insulting/derogatory comments 18 | * Public or private harassment 19 | * Publishing other's private information, such as physical or electronic 20 | addresses, without explicit permission 21 | * Other unethical or unprofessional conduct 22 | 23 | Project maintainers have the right and responsibility to remove, edit, or 24 | reject comments, commits, code, wiki edits, issues, and other contributions 25 | that are not aligned to this Code of Conduct, or to ban temporarily or 26 | permanently any contributor for other behaviors that they deem inappropriate, 27 | threatening, offensive, or harmful. 28 | 29 | By adopting this Code of Conduct, project maintainers commit themselves to 30 | fairly and consistently applying these principles to every aspect of managing 31 | this project. Project maintainers who do not follow or enforce the Code of 32 | Conduct may be permanently removed from the project team. 33 | 34 | This code of conduct applies both within project spaces and in public spaces 35 | when an individual is representing the project or its community. 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 38 | reported by contacting a project maintainer at rrein@akamai.com. All 39 | complaints will be reviewed and investigated and will result in a response that 40 | is deemed necessary and appropriate to the circumstances. Maintainers are 41 | obligated to maintain confidentiality with regard to the reporter of an 42 | incident. 43 | 44 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 45 | version 1.3.0, available at 46 | [http://contributor-covenant.org/version/1/3/0/][version] 47 | 48 | [homepage]: http://contributor-covenant.org 49 | [version]: http://contributor-covenant.org/version/1/3/0/ --------------------------------------------------------------------------------