lulz 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4ce70490061de862f211eceb6c0f5d19f721292a
4
+ data.tar.gz: 775044b8d4aa1f4d4ac0789489eaabcdf6561d03
5
+ SHA512:
6
+ metadata.gz: ef71d58281ec2677879ad41d58622dacd48e821fc8ecb75b0cc20ed15507501908e4f673e586deb11b0252051deea0999d9fcb63bd9b6323eae30022ab911201
7
+ data.tar.gz: eb23ac56f8f70234435a9236e0a23d156a3e7cf3983dea1029d3f8400271197e88af5041ca4924ae216b1c4597780bf1a7c4d39bff4f94bcd6cb0295cf5ed04c
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in lulz.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Hassanin Ahmed
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,29 @@
1
+ # Lulz
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'lulz'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install lulz
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( https://github.com/[my-github-username]/lulz/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/lulz ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'lulz'
4
+
5
+ ARGV.lulz.each(&method(:puts))
data/lib/lulz/all.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'lulz'
2
+ require 'lulz/core_ext'
@@ -0,0 +1,8 @@
1
+ require 'lulz'
2
+
3
+ class Array
4
+ def lulz
5
+ lulz = Lulz.new
6
+ map { |str| lulz.process(str.to_s) }
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ require 'lulz'
2
+
3
+ class String
4
+ def lulz
5
+ Lulz.new.process(self)
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ require 'lulz'
2
+ require 'lulz/core_ext/array'
3
+ require 'lulz/core_ext/string'
@@ -0,0 +1,3 @@
1
+ class Lulz
2
+ VERSION = "0.0.2"
3
+ end
data/lib/lulz.rb ADDED
@@ -0,0 +1,25 @@
1
+ require "lulz/version"
2
+ require "lulz/all"
3
+ require 'engtagger'
4
+
5
+ class Lulz
6
+ ADJECTIVES = %W[so such very many much].freeze
7
+ def process(str)
8
+ str = str.downcase
9
+ tagger = EngTagger.new
10
+ tagged_str = tagger.add_tags(str)
11
+ phrases = tagger.get_nouns(tagged_str).keys
12
+
13
+ phrases = phrases.each_with_index.map do |noun, i|
14
+ "#{adjective(i)} #{noun}."
15
+ end
16
+ phrases << "wow."
17
+ phrases.join(' ')
18
+ end
19
+
20
+ private
21
+
22
+ def adjective(i)
23
+ ADJECTIVES[i % ADJECTIVES.size]
24
+ end
25
+ end
data/lulz.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'lulz/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "lulz"
8
+ spec.version = Lulz::VERSION
9
+ spec.authors = ["Hassanin Ahmed", "Hafiz Khairudin"]
10
+ spec.email = ["sas1ni69@gmail.com", "ibnukamy@gmail.com"]
11
+ spec.summary = %q{English to Doge gem}
12
+ spec.description = %q{Changes english words to Doge language. For the lulz.}
13
+ spec.homepage = "http://hassanin-ahmed.com"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'engtagger'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "rspec"
26
+ end
27
+
data/spec/lulz_spec.rb ADDED
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lulz do
4
+ subject { Lulz.new }
5
+
6
+ describe '#process' do
7
+ let(:input) { 'This is the best test ever' }
8
+ let(:output) { subject.process(input) }
9
+
10
+ it 'converts to lowercase' do
11
+ expect(output.downcase).to eq output
12
+ end
13
+ end
14
+ end
15
+
@@ -0,0 +1 @@
1
+ require 'lulz/all'
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lulz
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Hassanin Ahmed
8
+ - Hafiz Khairudin
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-10-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: engtagger
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.6'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.6'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ description: Changes english words to Doge language. For the lulz.
71
+ email:
72
+ - sas1ni69@gmail.com
73
+ - ibnukamy@gmail.com
74
+ executables:
75
+ - lulz
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".gitignore"
80
+ - Gemfile
81
+ - LICENSE.txt
82
+ - README.md
83
+ - Rakefile
84
+ - bin/lulz
85
+ - lib/lulz.rb
86
+ - lib/lulz/all.rb
87
+ - lib/lulz/core_ext.rb
88
+ - lib/lulz/core_ext/array.rb
89
+ - lib/lulz/core_ext/string.rb
90
+ - lib/lulz/version.rb
91
+ - lulz.gemspec
92
+ - spec/lulz_spec.rb
93
+ - spec/spec_helper.rb
94
+ homepage: http://hassanin-ahmed.com
95
+ licenses:
96
+ - MIT
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.2.2
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: English to Doge gem
118
+ test_files:
119
+ - spec/lulz_spec.rb
120
+ - spec/spec_helper.rb