rage-flip 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 39655dd6b0c5b57284a0a6390afa604ed1216db2
4
+ data.tar.gz: 04d027e37f33ff5fa4bc8743d50aefdc8cffe939
5
+ SHA512:
6
+ metadata.gz: ae305204d950d904c31f88ad11bf4feb233b174ab04cfe6e329c825dc484cd6941cb233d8a92a6798f3e84c4ff01020adb802b300e063216ed4ea759e0b3de7c
7
+ data.tar.gz: 7a3be2b468c2b56b507262fffb0342fd310704be0dcd7198681142a2aba96d8d14f8aa58d960bcc114c977b2a8f52922b7efd3087ae736cc6c4eb592ff80be42
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rage-flip.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Robert Audi
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.
@@ -0,0 +1,30 @@
1
+ Rage::Flip
2
+ ==========
3
+
4
+ Installation
5
+ ------------
6
+
7
+ ```sh
8
+ $ gem install rage-flip
9
+ ```
10
+
11
+ Usage
12
+ -----
13
+
14
+ TODO: Write usage instructions here
15
+
16
+ Development
17
+ -----------
18
+
19
+ ```sh
20
+ $ ./bin/setup
21
+ $ ./bin/console
22
+ $ bundle exec rage-flip
23
+ $ bundle exec rake install
24
+ $ bundle exec rake release
25
+ ```
26
+
27
+ License
28
+ -------
29
+
30
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rage/flip"
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
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rage/flip"
4
+ puts Rage::Flip::Machine.new(text: ARGV.join(" ")).ʕノ•ᴥ•ʔノ
@@ -0,0 +1,9 @@
1
+ require "rage/flip/core_ext/blank"
2
+ require "rage/flip/version"
3
+ require "rage/flip/flips"
4
+ require "rage/flip/machine"
5
+
6
+ module Rage
7
+ module Flip
8
+ end
9
+ end
@@ -0,0 +1,35 @@
1
+ module Rage
2
+ module Flip
3
+ module CoreExt
4
+ module Object
5
+ def blank?
6
+ respond_to?(:empty?) ? !!empty? : !self
7
+ end
8
+
9
+ def present?
10
+ !blank?
11
+ end
12
+
13
+ def presence
14
+ self if present?
15
+ end
16
+ end
17
+
18
+ module NilClass
19
+ def blank?
20
+ true
21
+ end
22
+ end
23
+
24
+ module String
25
+ def blank?
26
+ /\A[[:space:]]*\z/ === self
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+ ::Object.send :include, Rage::Flip::CoreExt::Object
34
+ ::NilClass.send :include, Rage::Flip::CoreExt::NilClass
35
+ ::String.send :include, Rage::Flip::CoreExt::String
@@ -0,0 +1,96 @@
1
+ module Rage
2
+ module Flip
3
+ ELBAT = "┻━┻"
4
+ TABLE = "┬─┬"
5
+
6
+ FLIPS = {
7
+ patience: "%s ノ( ゜-゜ノ)",
8
+ me: "%s ︵ /(.□. \)"
9
+ }
10
+
11
+ SPILF = {
12
+ flipping: "(╯°□°)╯︵ %s",
13
+ pudgy: "(ノ ゜Д゜)ノ ︵ %s",
14
+ battle: "(╯°□°)╯︵ %s ︵ ╯(°□° ╯)",
15
+ aggravated: "(ノಠ益ಠ)ノ彡%s",
16
+ emotional: "(╯'□')╯︵ %s",
17
+ freakout: "(ノಥДಥ)ノ︵%s・/",
18
+ jedi: "(._.) ~ ︵ %s",
19
+ bear: "ʕノ•ᴥ•ʔノ ︵ %s",
20
+ magical: "(/¯◡ ‿ ◡)/¯ ~ %s",
21
+ robot: "┗[© ♒ ©]┛ ︵ %s"
22
+ }
23
+
24
+ FLIPSPILF = {
25
+ dude: "(╯°Д°)╯︵ /(.□ . \)",
26
+ hercules: "(/ .□.)\ ︵╰(゜Д゜)╯︵ /(.□. \)"
27
+ }
28
+
29
+ FLIPPED_LETTERS = {
30
+ " " => " ",
31
+ "a" => "ɐ",
32
+ "b" => "q",
33
+ "c" => "ɔ",
34
+ "d" => "p",
35
+ "e" => "ǝ",
36
+ "f" => "ɟ",
37
+ "g" => "ƃ",
38
+ "h" => "ɥ",
39
+ "i" => "ı",
40
+ "j" => "ɾ",
41
+ "k" => "ʞ",
42
+ "l" => "l",
43
+ "m" => "ɯ",
44
+ "n" => "u",
45
+ "o" => "o",
46
+ "p" => "d",
47
+ "q" => "b",
48
+ "r" => "ɹ",
49
+ "s" => "s",
50
+ "t" => "ʇ",
51
+ "u" => "n",
52
+ "v" => "ʌ",
53
+ "w" => "ʍ",
54
+ "x" => "x",
55
+ "y" => "ʎ",
56
+ "z" => "z",
57
+ "A" => "∀",
58
+ "B" => "q",
59
+ "C" => "Ɔ",
60
+ "D" => "p",
61
+ "E" => "Ǝ",
62
+ "F" => "Ⅎ",
63
+ "G" => "פ",
64
+ "H" => "H",
65
+ "I" => "I",
66
+ "J" => "ſ",
67
+ "K" => "ʞ",
68
+ "L" => "˥",
69
+ "M" => "W",
70
+ "N" => "N",
71
+ "O" => "O",
72
+ "P" => "Ԁ",
73
+ "Q" => "Q",
74
+ "R" => "ɹ",
75
+ "S" => "S",
76
+ "T" => "┴",
77
+ "U" => "∩",
78
+ "V" => "Λ",
79
+ "W" => "M",
80
+ "X" => "X",
81
+ "Y" => "⅄",
82
+ "Z" => "Z",
83
+ "," => "'",
84
+ "!" => "¡",
85
+ "?" => "¿",
86
+ "(" => ")",
87
+ ")" => "(",
88
+ "[" => "]",
89
+ "]" => "[",
90
+ "." => "˙",
91
+ '"' => ",,",
92
+ "'" => ",",
93
+ "_" => "‾"
94
+ }
95
+ end
96
+ end
@@ -0,0 +1,45 @@
1
+ module Rage
2
+ module Flip
3
+ class Machine
4
+ attr_reader :ヽ༼ຈل͜ຈ༽ノ, :☆, :┬─┬, :┻━┻
5
+
6
+ def initialize(flipper: nil, text: nil)
7
+ self.ヽ༼ຈل͜ຈ༽ノ = flipper
8
+ self.┬─┬ = text
9
+ end
10
+
11
+ def ┬─┬=(val)
12
+ @┬─┬ = val.presence || TABLE
13
+ @┻━┻ = ⁀⊙﹏☉⁀(@┬─┬)
14
+ end
15
+
16
+ def ヽ༼ຈل͜ຈ༽ノ=(val)
17
+ @☆ = (val.presence || ༼ಠ益ಠ༽).to_s.to_sym
18
+ @ヽ༼ຈل͜ຈ༽ノ = SPILF[@☆].presence || FLIPS[@☆].presence || FLIPSPILF[@☆].presence
19
+ end
20
+
21
+ def ༼ಠ益ಠ༽
22
+ [SPILF, FLIPSPILF, FLIPS].map(&:keys).flatten.shuffle.sample
23
+ end
24
+
25
+ def ʕノ•ᴥ•ʔノ
26
+ return ヽ༼ຈل͜ຈ༽ノ if ⊙0⊙
27
+
28
+ ヽ༼ຈل͜ຈ༽ノ % send(%i(┻━┻ ┬─┬).sample)
29
+ rescue
30
+ "┗( ●-﹏ `。)づ"
31
+ end
32
+
33
+ def ⊙0⊙
34
+ FLIPSPILF.key? ☆
35
+ end
36
+
37
+ def ⁀⊙﹏☉⁀ text = TABLE
38
+ return ELBAT if text.blank? || text.eql?(TABLE)
39
+ text.split(//).reverse.map do |l|
40
+ FLIPPED_LETTERS[l].nil? ? l : FLIPPED_LETTERS[l]
41
+ end.join("")
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,5 @@
1
+ module Rage
2
+ module Flip
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "rage/flip/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rage-flip"
8
+ spec.version = Rage::Flip::VERSION
9
+ spec.authors = ["Robert Audi"]
10
+ spec.email = ["robert.audii@gmail.com"]
11
+
12
+ spec.summary = "༼•̃͡ ɷ•̃͡༽"
13
+ spec.description = "(ノಠ益ಠ)ノ彡┻━┻"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
+ # delete this section to allow pushing this gem to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
+ else
21
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.10"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rage-flip
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Robert Audi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-09-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: "(ノಠ益ಠ)ノ彡┻━┻"
42
+ email:
43
+ - robert.audii@gmail.com
44
+ executables:
45
+ - rage-flip
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - bin/console
55
+ - bin/setup
56
+ - exe/rage-flip
57
+ - lib/rage/flip.rb
58
+ - lib/rage/flip/core_ext/blank.rb
59
+ - lib/rage/flip/flips.rb
60
+ - lib/rage/flip/machine.rb
61
+ - lib/rage/flip/version.rb
62
+ - rage-flip.gemspec
63
+ homepage:
64
+ licenses:
65
+ - MIT
66
+ metadata:
67
+ allowed_push_host: https://rubygems.org
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.4.8
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: "༼•̃͡ ɷ•̃͡༽"
88
+ test_files: []