brazil 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +76 -0
- data/Rakefile +1 -0
- data/brazil.gemspec +19 -0
- data/brazil.png +0 -0
- data/lib/brazil.rb +56 -0
- data/lib/brazil/version.rb +3 -0
- metadata +52 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 787daedcc48fa22aa0f20b6d15ee963b12a41340
|
4
|
+
data.tar.gz: 57aa6b196f414eb3771c6766ecff4205cee59448
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f2762ac743514a0e5fbcdbf47a9c301a250f306858f0b4bbb26dd9f9cbfb73de7de8493e89dd8014bcd4acbb8c7d71409ab5dd6873c78a9459e6fd976328e208
|
7
|
+
data.tar.gz: 0f6eb669e1ee687aa08cb3f64264dc5ea2e726312fda48a52784ad17f0324cbeed19656f39e7100221782532fe0a7747bfa467ab27a4a7143bcf18378702a25c
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Tim Case
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# Canada
|
2
|
+
|
3
|
+
![Brazilian flag](https://raw.github.com/vanruby/canada/master/brazil.png)
|
4
|
+
|
5
|
+
It's not at all known that there are different programming conventions
|
6
|
+
for Brazil. This gem attempts to make life easier for Brazilian
|
7
|
+
Rubyists by integrating conventions that Brazilians might want to use.
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
>> require 'brazil'
|
11
|
+
=> true
|
12
|
+
>> [].empty_neh?
|
13
|
+
=> true
|
14
|
+
>> [1,2,3].empty_neh?
|
15
|
+
=> false
|
16
|
+
>> [].respond_to_neh?(:empty_neh?)
|
17
|
+
=> true
|
18
|
+
>> sobre Object.new
|
19
|
+
=> "#<Object:0x007f802b8b92c0>"
|
20
|
+
>> diga 'em vez de puts"
|
21
|
+
=> 'em vez de puts"
|
22
|
+
>> porra!
|
23
|
+
=> 'caralho!'
|
24
|
+
>> caralho!
|
25
|
+
=> 'puta que pariu!'
|
26
|
+
>> fudeu!
|
27
|
+
=> 'com certeza'
|
28
|
+
|
29
|
+
>> raise "something went wrong..."
|
30
|
+
RuntimeError: Porra Viado! Tu me fudeu cara! something went wrong...
|
31
|
+
from (irb):6
|
32
|
+
from /Users/godfrey/.rvm/rubies/ruby-2.0.0-p195/bin/irb:16:in `<main>'
|
33
|
+
```
|
34
|
+
|
35
|
+
Legal, neh?
|
36
|
+
|
37
|
+
## Production Ready™, neh?
|
38
|
+
|
39
|
+
I guess.
|
40
|
+
|
41
|
+
## What about performance?
|
42
|
+
|
43
|
+
We hand-tuned the gem's performance to keep it in line with everything
|
44
|
+
else in Brazil, so each command takes two days to execute and then times
|
45
|
+
out with no explanation.
|
46
|
+
|
47
|
+
## Installation
|
48
|
+
|
49
|
+
Add this line to your application's Gemfile:
|
50
|
+
|
51
|
+
gem 'brazil'
|
52
|
+
|
53
|
+
And then execute:
|
54
|
+
|
55
|
+
$ bundle
|
56
|
+
|
57
|
+
Or install it yourself as:
|
58
|
+
|
59
|
+
$ gem install brazil
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
1. Fork it
|
64
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
65
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
66
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
67
|
+
5. Create new Pull Request
|
68
|
+
|
69
|
+
## Product of China
|
70
|
+
|
71
|
+
Like everything else we had this built in a Chinese sweatshop using
|
72
|
+
Brazilian natural resources and then imported back to
|
73
|
+
to Brazil, however it was sweetened with 100% Brazilian pinga.
|
74
|
+
|
75
|
+
##Acknowledgement
|
76
|
+
This was based on the [Canada gem](https://github.com/vanruby/canada)
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/brazil.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'brazil/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "brazil"
|
8
|
+
gem.version = Brazil::VERSION
|
9
|
+
gem.authors = ["Tim Case"]
|
10
|
+
gem.email = ["tim@2drops.net"]
|
11
|
+
gem.description = %q{Adds support for Brazilian programming conventions to the Ruby language}
|
12
|
+
gem.summary = %q{Adds support for Brazilian programming conventions to the Ruby language}
|
13
|
+
gem.homepage = "http://github.com/timcase/brazil"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
data/brazil.png
ADDED
Binary file
|
data/lib/brazil.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require "brazil/version"
|
2
|
+
|
3
|
+
module Brazil
|
4
|
+
module ObjectExtensions
|
5
|
+
NEH_METHOD_REGEXP = /\A(?<method_name>.+)_neh\?\z/
|
6
|
+
|
7
|
+
def respond_to_missing?(meth, include_all = false)
|
8
|
+
if (m = NEH_METHOD_REGEXP.match(meth))
|
9
|
+
super || self.respond_to?("#{m[:method_name]}?", include_all)
|
10
|
+
else
|
11
|
+
super
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def method_missing(meth, *args, &block)
|
16
|
+
if (m = NEH_METHOD_REGEXP.match(meth))
|
17
|
+
self.public_send("#{m[:method_name]}?", *args, &block)
|
18
|
+
else
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
::Object.send(:include, ObjectExtensions)
|
25
|
+
|
26
|
+
module ExceptionExtensions
|
27
|
+
def to_s
|
28
|
+
"Porra Viado! Tu me fudeu cara! #{super}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
::Exception.send(:prepend, ExceptionExtensions)
|
33
|
+
|
34
|
+
module ::Kernel
|
35
|
+
def sobre(obj)
|
36
|
+
obj.inspect
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def porra!
|
41
|
+
'caralho!'
|
42
|
+
end
|
43
|
+
|
44
|
+
def caralho!
|
45
|
+
'puta que pariu!'
|
46
|
+
end
|
47
|
+
|
48
|
+
def fudeu!
|
49
|
+
'com certeza!'
|
50
|
+
end
|
51
|
+
|
52
|
+
def br?
|
53
|
+
"HUEHUEHUE"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
metadata
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: brazil
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tim Case
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Adds support for Brazilian programming conventions to the Ruby language
|
14
|
+
email:
|
15
|
+
- tim@2drops.net
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- .gitignore
|
21
|
+
- Gemfile
|
22
|
+
- LICENSE.txt
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- brazil.gemspec
|
26
|
+
- brazil.png
|
27
|
+
- lib/brazil.rb
|
28
|
+
- lib/brazil/version.rb
|
29
|
+
homepage: http://github.com/timcase/brazil
|
30
|
+
licenses: []
|
31
|
+
metadata: {}
|
32
|
+
post_install_message:
|
33
|
+
rdoc_options: []
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
requirements: []
|
47
|
+
rubyforge_project:
|
48
|
+
rubygems_version: 2.0.3
|
49
|
+
signing_key:
|
50
|
+
specification_version: 4
|
51
|
+
summary: Adds support for Brazilian programming conventions to the Ruby language
|
52
|
+
test_files: []
|