immature 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/immature.gemspec +18 -18
- data/lib/immature.rb +20 -20
- data/lib/immature/phrases.rb +4 -4
- data/lib/immature/version.rb +2 -2
- data/spec/immature/phrases_spec.rb +4 -4
- data/spec/immature/version_spec.rb +3 -3
- data/spec/immature_spec.rb +13 -11
- data/spec/spec_helper.rb +7 -8
- metadata +28 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4c64f9a3db241d0aa38bc3b0e39ec8766c1d22a
|
4
|
+
data.tar.gz: 8ea1267a1f5039fc5e3eaae82d930c44524c356c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad2763aca28a26622b7ec12ce88fa7fb34f64f4507f0911a97813188a2e36267aff207364dc458ac57c4ef331b1916a2903a7defd857d51041a8a0eb3d7c28cd
|
7
|
+
data.tar.gz: a251f707f422664e64f668aa87f6c2eb1138f38162441082c295df52c98ba0393772c779ffd4062f348776c430e85d0c5ea09755a899c63430809962c944ba3d
|
data/CHANGES.md
CHANGED
data/immature.gemspec
CHANGED
@@ -4,26 +4,26 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'immature/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
19
|
|
20
|
-
|
20
|
+
spec.post_install_message = 'Immature is now installed in your pants.'
|
21
21
|
|
22
|
-
|
22
|
+
spec.add_runtime_dependency 'treat', '~> 2.1'
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
26
|
+
spec.add_development_dependency 'rspec', '~> 3.7'
|
27
|
+
spec.add_development_dependency 'yard', '~> 0.9.12'
|
28
|
+
spec.add_development_dependency 'redcarpet'
|
29
29
|
end
|
data/lib/immature.rb
CHANGED
@@ -4,24 +4,24 @@ require 'immature/phrases'
|
|
4
4
|
require 'treat'
|
5
5
|
|
6
6
|
module Immature
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
27
|
end
|
data/lib/immature/phrases.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Immature
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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
6
|
end
|
data/lib/immature/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Immature::PHRASES do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
it 'contains essential immaturities' do
|
5
|
+
expect(subject).to include('in bed')
|
6
|
+
expect(subject).to include('in your pants')
|
7
|
+
end
|
8
8
|
end
|
data/spec/immature_spec.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Immature do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
describe '.make_fun_of' do
|
5
|
+
it 'adds immature phrases to a sentence' do
|
6
|
+
allow(Immature::PHRASES).to receive(:sample).and_return('in your pants')
|
7
|
+
|
8
|
+
expect(Immature.make_fun_of('This is a test.')).to eq('This is a test in your pants.')
|
9
|
+
expect(Immature.make_fun_of('Is this working?!')).to eq('Is this working in your pants?!')
|
10
|
+
|
11
|
+
allow(Immature::PHRASES).to receive(:sample).and_return('in bed')
|
12
|
+
|
13
|
+
expect(Immature.make_fun_of('This is a test.')).to eq('This is a test in bed.')
|
14
|
+
expect(Immature.make_fun_of('Is this working?!')).to eq('Is this working in bed?!')
|
15
|
+
end
|
16
|
+
end
|
15
17
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,13 +2,12 @@ require 'immature'
|
|
2
2
|
|
3
3
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
4
4
|
RSpec.configure do |config|
|
5
|
-
|
6
|
-
|
7
|
-
config.filter_run :focus
|
5
|
+
config.run_all_when_everything_filtered = true
|
6
|
+
config.filter_run :focus
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
# Run specs in random order to surface order dependencies. If you find an
|
9
|
+
# order dependency and want to debug it, you can fix the order by providing
|
10
|
+
# the seed, which is printed after each run.
|
11
|
+
# --seed 1234
|
12
|
+
config.order = 'random'
|
14
13
|
end
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immature
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Workman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treat
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: '2.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '12.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '12.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.7'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.7'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yard
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.9.12
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.9.12
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: redcarpet
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: A ruby module to add silly, immature endings to sentences.
|
@@ -101,9 +101,9 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
- .gitignore
|
105
|
-
- .rspec
|
106
|
-
- .yardopts
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".yardopts"
|
107
107
|
- CHANGES.md
|
108
108
|
- Gemfile
|
109
109
|
- LICENSE.txt
|
@@ -127,17 +127,17 @@ require_paths:
|
|
127
127
|
- lib
|
128
128
|
required_ruby_version: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
|
-
- -
|
135
|
+
- - ">="
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.6.14
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Add silly, immature endings to sentences.
|
@@ -146,4 +146,3 @@ test_files:
|
|
146
146
|
- spec/immature/version_spec.rb
|
147
147
|
- spec/immature_spec.rb
|
148
148
|
- spec/spec_helper.rb
|
149
|
-
has_rdoc:
|