jologs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ === 0.0.1 2010-03-02
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
@@ -0,0 +1,16 @@
1
+ History.txt
2
+ jologs.gemspec
3
+ lib/jologs/jologize.rb
4
+ lib/jologs.rb
5
+ lib/jologs.yml
6
+ Manifest
7
+ Rakefile
8
+ README.txt
9
+ script/console
10
+ script/destroy
11
+ script/generate
12
+ spec/jologize_spec.rb
13
+ spec/jologs_spec.rb
14
+ spec/spec.opts
15
+ spec/spec_helper.rb
16
+ tasks/rspec.rake
@@ -0,0 +1,39 @@
1
+ = jologs
2
+
3
+ * http://github.com/jasontorres/jologs
4
+
5
+ == DESCRIPTION:
6
+
7
+ Jologize any string
8
+
9
+ $ irb
10
+ >> "Hello".to_jologs
11
+
12
+ == INSTALL:
13
+
14
+ sudo gem install jologs
15
+
16
+ == LICENSE:
17
+
18
+ (The MIT License)
19
+
20
+ Copyright (c) 2010 Jason Torres
21
+
22
+ Permission is hereby granted, free of charge, to any person obtaining
23
+ a copy of this software and associated documentation files (the
24
+ 'Software'), to deal in the Software without restriction, including
25
+ without limitation the rights to use, copy, modify, merge, publish,
26
+ distribute, sublicense, and/or sell copies of the Software, and to
27
+ permit persons to whom the Software is furnished to do so, subject to
28
+ the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be
31
+ included in all copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
34
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
35
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
36
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
37
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
38
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
39
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,13 @@
1
+ require 'rubygems'
2
+ require 'echoe'
3
+ require 'fileutils'
4
+ require './lib/jologs'
5
+
6
+ Echoe.new 'jologs', '0.1.0' do |p|
7
+ p.author = 'Jason Torres'
8
+ p.email = 'jason.e.torres@gmail.com'
9
+ p.url = 'http://github.com/jasontorres/jologs'
10
+ p.description = "Your Jolog Translator"
11
+ end
12
+
13
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
@@ -0,0 +1,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{jologs}
5
+ s.version = "0.1.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Jason Torres"]
9
+ s.date = %q{2010-03-02}
10
+ s.description = %q{Your Jolog Translator}
11
+ s.email = %q{jason.e.torres@gmail.com}
12
+ s.extra_rdoc_files = ["lib/jologs/jologize.rb", "lib/jologs.rb", "lib/jologs.yml", "README.txt", "tasks/rspec.rake"]
13
+ s.files = ["History.txt", "jologs.gemspec", "lib/jologs/jologize.rb", "lib/jologs.rb", "lib/jologs.yml", "Manifest", "Rakefile", "README.txt", "script/console", "script/destroy", "script/generate", "spec/jologize_spec.rb", "spec/jologs_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rspec.rake"]
14
+ s.homepage = %q{http://github.com/jasontorres/jologs}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Jologs", "--main", "README.txt"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{jologs}
18
+ s.rubygems_version = %q{1.3.6}
19
+ s.summary = %q{Your Jolog Translator}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
+ else
27
+ end
28
+ else
29
+ end
30
+ end
@@ -0,0 +1,20 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ require 'yaml'
5
+ require 'jologs/jologize'
6
+
7
+ module Jologs
8
+ VERSION = '0.0.1'
9
+ end
10
+
11
+ Jologs::Jologize.load_dictionary!(File.join(File.dirname(__FILE__), 'jologs.yml'))
12
+
13
+ class String
14
+
15
+ def to_jologs
16
+ Jologs::Jologize.translate(self)
17
+ end
18
+
19
+ end
20
+
@@ -0,0 +1,180 @@
1
+ ---
2
+ "zzwzaazz" : "waa"
3
+ "zzgzaizz" : "gai"
4
+ "saa" : "zzszaazz"
5
+ "bai" : "zzbzaizz"
6
+ "ol" : "all"
7
+ "gudam" : "good morning"
8
+ "eow p0wh!" : "hello"
9
+ "lai" : "zzlzaizz"
10
+ "zznzaazz" : "naa"
11
+ "zzkzaazz" : "kaa"
12
+ " zoutz " : " out "
13
+ "4u" : "for you"
14
+ "jologs" : "jologs"
15
+ "p0wh" : "p0h"
16
+ "s" : "sa"
17
+ "yn" : "yon"
18
+ "testi" : "testimonial"
19
+ "db" : "hindi ba"
20
+ "zzbzaizz" : "bai"
21
+ "zzhzaazz" : "haa"
22
+ "hai" : "zzhzaizz"
23
+ "outz " : "out "
24
+ "zzlzaazz" : "laa"
25
+ "laa" : "zzlzaazz"
26
+ "h" : "ha"
27
+ "cze" : "kasi"
28
+ "zzzairzzz" : " air"
29
+ " d " : " the "
30
+ "la " : "zzlzazz"
31
+ "zzmzaazz" : "maa"
32
+ "cnu" : "sino"
33
+ "wat" : "what"
34
+ "jeje" : "jehe"
35
+ "nu" : "ano"
36
+ "haa" : "zzhzaazz"
37
+ "zzszazz" : "sa "
38
+ "zzpzazz" : "pa "
39
+ "zzgzaazz" : "gaa"
40
+ "hpi" : "happy"
41
+ "ok" : "okay"
42
+ "xeio" : "sayo"
43
+ "au " : "ayo "
44
+ "kai" : "zzkzaizz"
45
+ "ha " : "zzhzazz"
46
+ "zzwzazz" : "wa "
47
+ "xia" : "siya"
48
+ "y" : "bakit"
49
+ "w" : "wa"
50
+ "yf" : "ife"
51
+ "wen" : "when"
52
+ "zzkzazz" : "ka "
53
+ "zznzazz" : "na "
54
+ "zzbzaazz" : "baa"
55
+ " x" : " sc"
56
+ "gudpm" : "good evening"
57
+ "pa " : "zzpzazz"
58
+ "l" : "la"
59
+ "zzhzazz" : "ha "
60
+ "z " : "s "
61
+ "nd" : " and "
62
+ " q" : " ko"
63
+ "kaa" : "zzkzaazz"
64
+ "zzlzazz" : "la "
65
+ "friendship" : "friend"
66
+ "gwapo" : "guissmo"
67
+ "nai" : "zznzaizz"
68
+ "xa" : "tia"
69
+ "beybi" : "baby"
70
+ "ka " : "zzkzazz"
71
+ "n" : "na"
72
+ "zzmzazz" : "ma "
73
+ "pogi" : "jared"
74
+ "zzgzazz" : "ga "
75
+ "ng" : "nang"
76
+ "nyt" : "night"
77
+ "gurl" : "rl"
78
+ "hu u?" : "who u n0h?"
79
+ "naa" : "zznzaazz"
80
+ "wa " : "zzwzazz"
81
+ "ga " : "zzgzazz"
82
+ " are " : " zarez "
83
+ "8" : "hate"
84
+ "awtz" : "zoutz"
85
+ "klan" : "kailan"
86
+ "cnucnu" : "sino\-sino"
87
+ "frndstr" : "friendster"
88
+ "gai" : "zzgzaizz"
89
+ "p" : "pa"
90
+ "u" : " mo "
91
+ "sa " : "zzszazz"
92
+ "zzbzazz" : "ba "
93
+ "kyu" : "kayo"
94
+ "yn" : "yan"
95
+ " ate " : " z8z "
96
+ "x" : "sy"
97
+ "nb u" : "ka na ba"
98
+ "pari" : "jof"
99
+ "r" : "air"
100
+ "u" : "you"
101
+ "lng u" : "ka lang"
102
+ "lolz" : "lol"
103
+ "gaa" : "zzgzaazz"
104
+ "aq" : "ako"
105
+ "8" : "z8z"
106
+ "xur" : "sure"
107
+ "rly" : "really"
108
+ "nb" : "na ba"
109
+ "g" : "ga"
110
+ " m " : " am "
111
+ "2" : "tu"
112
+ "nnd2" : "nandito"
113
+ "e2 " : "eto "
114
+ "ung" : "yung"
115
+ "ba " : "zzbzazz"
116
+ "cnucnu" : "sinu\-sino"
117
+ "d2" : "dito"
118
+ "wai" : "zzwzaizz"
119
+ "mai" : "zzmzaizz"
120
+ "gudpm" : "good afternoon"
121
+ "x" : "siy"
122
+ "pnta" : "punta"
123
+ "jaja" : "jaha"
124
+ "jaja" : "haha"
125
+ "hu" : "who"
126
+ "na " : "zznzazz"
127
+ "luv" : "love"
128
+ "2u" : "to you"
129
+ " s " : " is "
130
+ "k" : "ka"
131
+ "bebs" : "babes"
132
+ "p0h " : "po "
133
+ "maa" : "zzmzaazz"
134
+ "d " : "di "
135
+ "zzpzaizz" : "pai"
136
+ "zzpzaizz" : "sai"
137
+ "zzwzaizz" : "wai"
138
+ "kowt" : "quote"
139
+ "u" : "mong"
140
+ "pnu" : "paano"
141
+ "waa" : "zzwzaazz"
142
+ "pai" : "zzpzaizz"
143
+ "wer" : "where"
144
+ "db" : "di ba"
145
+ "gs2" : "gusto"
146
+ "m" : "ma"
147
+ "n0h " : "no "
148
+ "yn" : "hw"
149
+ "nu" : "nu ang"
150
+ "sau" : "syo"
151
+ "d2 n p0h me" : "dito na ako"
152
+ "cge" : "sige"
153
+ "zzkzaizz" : "kai"
154
+ "zznzaizz" : "nai"
155
+ "sn" : "saan"
156
+ "ndi" : "hindi"
157
+ " air" : "zzzairzzz"
158
+ "b" : "ba"
159
+ "n u" : "ka na"
160
+ "zzhzaizz" : "hai"
161
+ " r " : " are "
162
+ "uu " : "oo "
163
+ "e2ng " : "etong "
164
+ " u " : " ka "
165
+ "paa" : "zzpzaazz"
166
+ "zzlzaizz" : "lai"
167
+ "z8z" : "ate"
168
+ "baa" : "zzbzaazz"
169
+ "sai" : "zzszaizz"
170
+ "ma " : "zzmzazz"
171
+ "eyr" : "are "
172
+ "yk" : "ike"
173
+ "txt" : "text"
174
+ "ngaun" : "ngayon"
175
+ "zzpzaazz" : "saa"
176
+ "zzpzaazz" : "paa"
177
+ "jeje" : "hehe"
178
+ "u" : "ikaw"
179
+ "eto" : "heto"
180
+ "zzmzaizz" : "mai"
@@ -0,0 +1,37 @@
1
+ module Jologs
2
+
3
+ class Jologize
4
+
5
+ class << self
6
+ @@dictionary = nil
7
+ def translate(str)
8
+ jologize(str)
9
+ end
10
+
11
+ def jologize(str)
12
+ result = str
13
+ dictionary.each do |jolog_word, normal_word|
14
+ begin
15
+ # result = result.gsub(normal_word, jolog_word)
16
+ result = result.gsub(Regexp.new("#{normal_word}", [Regexp::IGNORECASE, Regexp::MULTILINE]), jolog_word)
17
+ rescue Exception => e
18
+ puts "Halted on #{normal_word} #{jolog_word} : #{e.message}"
19
+ end
20
+ end
21
+ result
22
+ end
23
+
24
+ def dictionary
25
+ @@dictionary
26
+ end
27
+
28
+ def load_dictionary!(file)
29
+ @@dictionary = YAML.load_file(file)
30
+ end
31
+
32
+
33
+ end
34
+
35
+ end
36
+
37
+ end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # File: script/console
3
+ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
+
5
+ libs = " -r irb/completion"
6
+ # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
+ # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
+ libs << " -r #{File.dirname(__FILE__) + '/../lib/jologs.rb'}"
9
+ puts "Loading jologs gem"
10
+ exec "#{irb} #{libs} --simple-prompt"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/destroy'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Destroy.new.run(ARGV)
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/generate'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Generate.new.run(ARGV)
@@ -0,0 +1,28 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe "Jologs::Jologize" do
4
+
5
+ it "should test my regexp skillz" do
6
+ "sige".gsub(/sige/, "cge").should == "cge"
7
+ end
8
+
9
+ it "should have to_jologs method on the String class" do
10
+ "hello".respond_to?(:to_jologs).should == true
11
+ end
12
+
13
+ it "should have a valid JOLOGS library" do
14
+ Jologs::Jologize.dictionary.should_not be_empty
15
+ Jologs::Jologize.dictionary.should be_a_kind_of(Hash)
16
+ end
17
+
18
+ it "should not have an empty Jologs library" do
19
+ Jologs::Jologize.dictionary.should_not be_empty
20
+ end
21
+
22
+ it "should have this obvious key" do
23
+ Jologs::Jologize.dictionary.should have_key('jologs')
24
+ end
25
+
26
+
27
+ end
28
+
@@ -0,0 +1,35 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe "Jologs" do
4
+
5
+ it "should have to_jologs method on the String class" do
6
+ "hello".respond_to?(:to_jologs).should == true
7
+ end
8
+
9
+ it "should translate hello to eow" do
10
+ "hello".to_jologs.should == "eow p0wh!"
11
+ end
12
+
13
+ it "should translate babes to bebs" do
14
+ "babes".to_jologs.should == "bebs"
15
+ end
16
+
17
+ it "should translate hindi to ndi" do
18
+ "hindi".to_jologs.should == "ndi"
19
+ end
20
+
21
+ it "should translate sige to cge" do
22
+ "sige".to_jologs.should == "cge"
23
+ end
24
+
25
+
26
+ it "should translate this word to jolog 2 w/ dashes" do
27
+ "sino-sino".gsub(/sino\-sino/, "cnucnu").should == "cnucnu"
28
+ end
29
+
30
+ it "should translate Hello Musta na" do
31
+ "Hello musta na ikaw".to_jologs.should == "eow p0wh! musta n u"
32
+ end
33
+
34
+ end
35
+
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,10 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
5
+ gem 'rspec'
6
+ require 'spec'
7
+ end
8
+
9
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
10
+ require 'jologs'
@@ -0,0 +1,21 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
5
+ require 'spec'
6
+ end
7
+ begin
8
+ require 'spec/rake/spectask'
9
+ rescue LoadError
10
+ puts <<-EOS
11
+ To use rspec for testing you must install rspec gem:
12
+ gem install rspec
13
+ EOS
14
+ exit(0)
15
+ end
16
+
17
+ desc "Run the specs under spec/models"
18
+ Spec::Rake::SpecTask.new do |t|
19
+ t.spec_opts = ['--options', "spec/spec.opts"]
20
+ t.spec_files = FileList['spec/**/*_spec.rb']
21
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jologs
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Jason Torres
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-03-02 00:00:00 +08:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Your Jolog Translator
22
+ email: jason.e.torres@gmail.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - lib/jologs/jologize.rb
29
+ - lib/jologs.rb
30
+ - lib/jologs.yml
31
+ - README.txt
32
+ - tasks/rspec.rake
33
+ files:
34
+ - History.txt
35
+ - jologs.gemspec
36
+ - lib/jologs/jologize.rb
37
+ - lib/jologs.rb
38
+ - lib/jologs.yml
39
+ - Manifest
40
+ - Rakefile
41
+ - README.txt
42
+ - script/console
43
+ - script/destroy
44
+ - script/generate
45
+ - spec/jologize_spec.rb
46
+ - spec/jologs_spec.rb
47
+ - spec/spec.opts
48
+ - spec/spec_helper.rb
49
+ - tasks/rspec.rake
50
+ has_rdoc: true
51
+ homepage: http://github.com/jasontorres/jologs
52
+ licenses: []
53
+
54
+ post_install_message:
55
+ rdoc_options:
56
+ - --line-numbers
57
+ - --inline-source
58
+ - --title
59
+ - Jologs
60
+ - --main
61
+ - README.txt
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 0
70
+ version: "0"
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ segments:
76
+ - 1
77
+ - 2
78
+ version: "1.2"
79
+ requirements: []
80
+
81
+ rubyforge_project: jologs
82
+ rubygems_version: 1.3.6
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Your Jolog Translator
86
+ test_files: []
87
+