immature 0.0.1

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: b8287beef2168f5d20a232ca882fc9dd2e0bfb72
4
+ data.tar.gz: 05641304225c0feca111fdd4be72814d9af24de7
5
+ SHA512:
6
+ metadata.gz: 5b2ec4b8b195e9e27be1c5a0169cb48724561e36c96d874c96e8f1bc1c1279db081d26ecb9e0081436f5a479dc4b5c79f2e60582b6d480cad801731f77c50f5c
7
+ data.tar.gz: 9758293cca22a197621231816091428e5e81d4f1a7a48d87e4020824fd2580a7c3d1ab8fbf303e641d5c1f2bf57683b156ed3941d4de8af7ef1c84c00f1947cb
data/.gitignore ADDED
@@ -0,0 +1,17 @@
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
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/.yardopts ADDED
@@ -0,0 +1,5 @@
1
+ --markup markdown
2
+ -
3
+ CHANGES.md
4
+ LICENSE.txt
5
+ README.md
data/CHANGES.md ADDED
@@ -0,0 +1,6 @@
1
+ Immature Changes
2
+ ================
3
+
4
+ ## v0.0.1 - *2013-10-12*
5
+
6
+ - First version in your pants.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Justin Workman
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,48 @@
1
+ Immature Ruby Gem
2
+ =================
3
+
4
+ *Immature* is a Ruby module that adds silly, immature endings to sentences.
5
+
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ``` ruby
12
+ gem 'immature'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ ``` shell
18
+ $ bundle
19
+ ```
20
+
21
+ Or install it yourself as:
22
+
23
+ ``` shell
24
+ $ gem install immature
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ``` ruby
30
+ require 'immature'
31
+
32
+ Immature.make_fun_of("How do I use this gem?") #=> "How do I use this gem in bed?"
33
+ ```
34
+
35
+
36
+ ## Contributing
37
+
38
+ 1. Fork it
39
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
40
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
41
+ 4. Push to the branch (`git push origin my-new-feature`)
42
+ 5. Create new Pull Request
43
+
44
+ ## License
45
+
46
+ Copyright © 2013 [Justin Workman](mailto:xtagon@gmail.com)
47
+
48
+ MIT License (see LICENSE.txt)
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'yard'
4
+
5
+ RSpec::Core::RakeTask.new :spec
6
+ YARD::Rake::YardocTask.new :doc
7
+
8
+ task default: :spec
data/immature.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'immature/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'immature'
8
+ spec.version = Immature::VERSION
9
+ spec.author = ['Justin Workman']
10
+ spec.email = ['xtagon@gmail.com']
11
+ spec.summary = 'Add silly, immature endings to sentences.'
12
+ spec.description = 'A ruby module to add silly, immature endings to sentences.'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.post_install_message = 'Immature is now installed in your pants.'
21
+
22
+ spec.add_runtime_dependency 'treat', '~> 2.0.7'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.3'
25
+ spec.add_development_dependency 'rake'
26
+ spec.add_development_dependency 'rspec'
27
+ spec.add_development_dependency 'yard', '~> 0.8.7'
28
+ spec.add_development_dependency 'redcarpet'
29
+ end
@@ -0,0 +1,6 @@
1
+ module Immature
2
+ # An array of phrases to be used in {Immature.make_fun_of}.
3
+ #
4
+ # You may replace or add to this list at will. Be creative.
5
+ PHRASES = ['in your pants', 'in bed']
6
+ end
@@ -0,0 +1,4 @@
1
+ module Immature
2
+ # The currently loaded version of Immature.
3
+ VERSION = '0.0.1'
4
+ end
data/lib/immature.rb ADDED
@@ -0,0 +1,27 @@
1
+ require 'immature/version'
2
+ require 'immature/phrases'
3
+
4
+ require 'treat'
5
+
6
+ module Immature
7
+ class << self
8
+ # Make a given sentence more immature (in your pants).
9
+ #
10
+ # The phrase used will be chosen at random from {Immature::PHRASES}.
11
+ #
12
+ # @example
13
+ # Immature.make_fun_of("Show me an example.") #=> "Show me an example in your pants."
14
+ #
15
+ # @param sentence [#to_s] A normal sentence or paragraph
16
+ #
17
+ # @return A more immature version of your sentence.
18
+ def make_fun_of sentence
19
+ immature_phrase = Immature::PHRASES.sample
20
+ sentence = Treat::Entities::Sentence.new(sentence.to_s).tokenize
21
+ children = sentence.children
22
+ last_word_index = children.rindex { |entity| entity.type == :word }
23
+ children.insert(last_word_index + 1, Treat::Entities::Word.new(immature_phrase))
24
+ sentence.to_s
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe Immature::PHRASES do
4
+ it 'contains essential immaturities' do
5
+ subject.should include 'in bed'
6
+ subject.should include 'in your pants'
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Immature::VERSION do
4
+ it 'is a valid version string' do
5
+ subject.should =~ /\A\d+\.\d+\.\d+(-\w+)?\Z/
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe Immature do
4
+ describe '.make_fun_of' do
5
+ it 'adds immature phrases to a sentence' do
6
+ Immature::PHRASES.stub(:sample).and_return('in your pants')
7
+ Immature.make_fun_of('This is a test.').should == 'This is a test in your pants.'
8
+ Immature.make_fun_of('Is this working?!').should == 'Is this working in your pants?!'
9
+
10
+ Immature::PHRASES.stub(:sample).and_return('in bed')
11
+ Immature.make_fun_of('This is a test.').should == 'This is a test in bed.'
12
+ Immature.make_fun_of('Is this working?!').should == 'Is this working in bed?!'
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ require 'immature'
2
+
3
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
4
+ RSpec.configure do |config|
5
+ config.treat_symbols_as_metadata_keys_with_true_values = true
6
+ config.run_all_when_everything_filtered = true
7
+ config.filter_run :focus
8
+
9
+ # Run specs in random order to surface order dependencies. If you find an
10
+ # order dependency and want to debug it, you can fix the order by providing
11
+ # the seed, which is printed after each run.
12
+ # --seed 1234
13
+ config.order = 'random'
14
+ end
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: immature
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Justin Workman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: treat
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.7
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.7
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: yard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 0.8.7
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.8.7
83
+ - !ruby/object:Gem::Dependency
84
+ name: redcarpet
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: A ruby module to add silly, immature endings to sentences.
98
+ email:
99
+ - xtagon@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - .gitignore
105
+ - .rspec
106
+ - .yardopts
107
+ - CHANGES.md
108
+ - Gemfile
109
+ - LICENSE.txt
110
+ - README.md
111
+ - Rakefile
112
+ - immature.gemspec
113
+ - lib/immature.rb
114
+ - lib/immature/phrases.rb
115
+ - lib/immature/version.rb
116
+ - spec/immature/phrases_spec.rb
117
+ - spec/immature/version_spec.rb
118
+ - spec/immature_spec.rb
119
+ - spec/spec_helper.rb
120
+ homepage:
121
+ licenses:
122
+ - MIT
123
+ metadata: {}
124
+ post_install_message: Immature is now installed in your pants.
125
+ rdoc_options: []
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - '>='
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubyforge_project:
140
+ rubygems_version: 2.0.3
141
+ signing_key:
142
+ specification_version: 4
143
+ summary: Add silly, immature endings to sentences.
144
+ test_files:
145
+ - spec/immature/phrases_spec.rb
146
+ - spec/immature/version_spec.rb
147
+ - spec/immature_spec.rb
148
+ - spec/spec_helper.rb
149
+ has_rdoc: