riley_ipsum 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8df971856dcf8c452c46471ed4edf6a6b5f20b26
4
+ data.tar.gz: 1f180ae3546ad8b171a90d63e6dc4fe05761a9f6
5
+ SHA512:
6
+ metadata.gz: 636aed35809873501c3c5c6f3e199415f5a9b0f3705cab1d12203731e3744710e8fe1f6f4205025498c2de679ee77706edad9b38bbe8586196dca4af9c00a3eb
7
+ data.tar.gz: 7a439eff659b870be799d81b08d9546265ea5b7f7add4dcaab5ade2ee8a622775e232ba9de030c239a285c57462c9e79acc7bfcd4e9008bd95010949ba84445c
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ pkg/*
2
+ *.gem
3
+ *.log
4
+ .bundle
5
+ .DS_Store
6
+ *.swp
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ * Modified RileyIpsum::Base to not add punctuation to already-punctuated lines.
2
+
3
+ *blimpage*
4
+
5
+ * Forked to RileyIpsum.
6
+
7
+ *blimpage*
8
+
9
+ * Added a warren_ipsum executable.
10
+
11
+ *seangeo*
12
+
13
+ * Added a change log, because it's important.
14
+
15
+ *seangeo*
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,29 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ riley_ipsum (0.1.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.2.4)
10
+ rake (10.1.0)
11
+ rspec (2.14.1)
12
+ rspec-core (~> 2.14.0)
13
+ rspec-expectations (~> 2.14.0)
14
+ rspec-mocks (~> 2.14.0)
15
+ rspec-core (2.14.5)
16
+ rspec-expectations (2.14.3)
17
+ diff-lcs (>= 1.1.3, < 2.0)
18
+ rspec-mocks (2.14.3)
19
+
20
+ PLATFORMS
21
+ ruby
22
+
23
+ DEPENDENCIES
24
+ rake
25
+ riley_ipsum!
26
+ rspec (~> 2.14.0)
27
+
28
+ BUNDLED WITH
29
+ 1.11.2
data/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2016 Sebastian von Conrad <sebastian@vonconrad.com>, Tom Bryan <hello@tombryan.co>,
5
+ Pat McKenna <pat@mckenna.rocks>
6
+
7
+ Everyone is permitted to copy and distribute verbatim or modified
8
+ copies of this license document, and changing it is allowed as long
9
+ as the name is changed.
10
+
11
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
12
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
13
+
14
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Riley Ipsum, the gem
2
+
3
+ This gem is based on [Warren Ipsum](https://github.com/vonconrad/warren_ipsum), by the inimitable [Sebastian von Conrad](http://www.vonconrad.com/). It's significantly more [Riley](http://rilstix.com/)-flavoured than its predecessor.
4
+
5
+ ## Installation
6
+
7
+ In your Gemfile:
8
+
9
+ ```ruby
10
+ gem 'riley_ipsum'
11
+ ```
12
+
13
+ Or in your terminal:
14
+
15
+ ```shell
16
+ gem install riley_ipsum
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ require 'riley_ipsum'
23
+
24
+ # Will generate one line.
25
+ RileyIpsum.generate
26
+ # => "Instead of trivia questions under beer lids, why not thousands of tiny spiders?"
27
+
28
+ # Will combine three lines, separated by commas.
29
+ RileyIpsum.generate(lines: 3)
30
+ # => "thanks buddy guy pal, i'm white trash btw, they're desperately trying to ape the big beat sound that chemical brothers/groove armada nailed."
31
+ ```
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/bin/riley_ipsum ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'riley_ipsum'
4
+
5
+ puts RileyIpsum.generate(:lines => (0..10).to_a.sample)
data/data/riley.txt ADDED
@@ -0,0 +1,109 @@
1
+ _does the hand thing_​
2
+ every moment i live is agony
3
+ i'm eating this chicken called steggles at the moment
4
+ mmm, dumps
5
+ yeah i was a pretty wild teen
6
+ that’s the sound the siren makes as it picks me up. nawaamnawaamnawaamnawaamnawaamnawaamnawaam
7
+ what's with these homies / dissing my beams
8
+ can i no no not
9
+ that’s alotta edits!!! you want fries with that???
10
+ cool yeah this is the worst
11
+ they're desperately trying to ape the big beat sound that chemical brothers/groove armada nailed
12
+ never have to look at a horse again
13
+ (brown, delicious)
14
+ RYLIE MINOGUE
15
+ also, adam wants me to get my head around indigestion
16
+ jess makes some top gnotch gnocchi
17
+ Did you say VOTE COALMINES ARE DUMPISH???
18
+ ​_jazz music_​
19
+ i'm in a spin, then flying through the air, then i'm landing on the ground
20
+ THE NEEDFUL
21
+ kerry packer up bois
22
+ that's swishtastic
23
+ never forgetti
24
+ Cannot use a payment_method_nonce more than once. ya nonce.
25
+ get some jerky ya jerk
26
+ just found seeds in my filling cabinet. _eats_
27
+ uncle toby's OTs
28
+ your face tho
29
+ i'm gonna miss all these distractions
30
+ seems legeirt
31
+ i'm going to go for a walk and then eat my food that has been sitting in the fridge for days
32
+ mensroom
33
+ buzz'm. buzz'm frog.
34
+ i also started on photoshopping you into an x-wing for some reason. you could use that.
35
+ quality bants
36
+ SMELLO
37
+ pearl wam
38
+ A++++ WHERE DO I SIGN UP
39
+ spoiler: i 4got about mix
40
+ ugh, you actually know things about that guy? gross
41
+ just stamp the ticket
42
+ welp that’s completely the worst
43
+ How Much Charts I Ate Last Night
44
+ i’m not gonna lie, i’m gonna wear thongs
45
+ that reminds me alex, you remind people too much to remember things
46
+ "Give me the goon de sack"
47
+ bestwebsite.exe
48
+ assman. assman frog.
49
+ it's the design team m8. shit is gonna be specific af. "1 pixel to the right pls".
50
+ added quack.wav back as the error sound. feels good man.
51
+ he speaks my language (dingus)
52
+ ugh, it's nothing but instagrams
53
+ i didn't so much DJ house parties as play this track on repeat for 3 hours. people hated it. got thrown out of caboolture. that's my story.
54
+ Special Instructions: Please can I get a phone call from Mike Whitney
55
+ THAT'S ALOTTA NOOTS!!!! YOU WANT A WEIRD SCANDINAVIAN CLAYMATION SHOW WITH THAT????
56
+ we have a winrar
57
+ i can't ken done it
58
+ i'm white trash btw
59
+ thanks buddy guy pal
60
+ i like that i know that it's a reference to twin peaks, having never seen twin peaks
61
+ it's actually a pretty funny anime. wait, guys, stop walking away from me
62
+ feels like nope
63
+ marketing. marketing. marketing.
64
+ i completely understand why this is a thing
65
+ can you optimize those cupcakes pls
66
+ i'm an innie
67
+ come to the pong table in the next 6 hours if you want an ass kicking
68
+ dunno about you guys but i’m just gonna listen to this on repeat for the next 6 hours
69
+ 🙃 i went crazy soz
70
+ Genre: D&B (Dog and Bass)
71
+ so many layers. mostly VHS noise.
72
+ that's more of a dollarydon't
73
+ Instead of trivia questions under beer lids, why not thousands of tiny spiders?
74
+ straight out of my ear, that smell
75
+ _wacky 90's bassline_​
76
+ slippage
77
+ gotta see a man about a bog
78
+ pong at me, bro
79
+ you're in the gassy knoll
80
+ our economy = donezo
81
+ _takes out of context_​
82
+ there was a what in the where now?
83
+ i really dig your grandma
84
+ give 'im the james sherry treatment
85
+ so what does this mean. we don’t report our exploding buses anymore at all?
86
+ i'm fired, aren't i
87
+ (smellmonella)
88
+ ☎️ hello tim?
89
+ Sherv just approved of my memes
90
+ THAT'S MY SNOT!
91
+ whatever floats your stoat
92
+ if only i could be bothered
93
+ bibio is kinda like if BoC just went full guitar mode. bibiYOLO
94
+ u gotta b hip w/ da kidz
95
+ we're all gonna die etc
96
+ these noots don’t noot themselves
97
+ that was good sports
98
+ nah m8. banh mi is an all seasons foodstuff.
99
+ got tim
100
+ so much dog based content today. i can't hold all these dog memes.
101
+ woolworths risotto 4 lyf
102
+ i just want the perfect latte when getting my beard trimmed whilst i'm on my fixie
103
+ needs more akmal
104
+ don't mean to blow my own trumpet guys, but i scored the winner. then proceeded to spend the next two seasons scoring approx 0 goals.
105
+ BoC_obscure_track_reference_here,exe
106
+ ozbargain is great
107
+ spent most of my high school years banging the terminator theme on desks. got straight Fs.
108
+ whatever you do, don’t look at tommy dassalo’s face
109
+ don't forget: your here for bees
@@ -0,0 +1,38 @@
1
+ module RileyIpsum
2
+ class Base
3
+ DEFAULT_NUMBER_OF_LINES = 1
4
+
5
+ def initialize(options = {})
6
+ @lines = options.fetch(:lines, DEFAULT_NUMBER_OF_LINES)
7
+ @data = Data.new
8
+ end
9
+
10
+ def generate
11
+ lines = @lines.times.map do
12
+ @data.random_line
13
+ end
14
+
15
+ punctuated_lines(lines).join(' ')
16
+ end
17
+
18
+ private
19
+
20
+ def punctuated_lines(lines)
21
+ last_line_index = lines.size - 1
22
+
23
+ lines.map.with_index do |line, index|
24
+ if line =~ /(\.|,|!|\?)$/
25
+ line
26
+ elsif index == last_line_index
27
+ line + '.'
28
+ else
29
+ line + ','
30
+ end
31
+ end
32
+ end
33
+
34
+ def load_data_source
35
+ File.expand_path("../../bin", "/tmp/x")
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,19 @@
1
+ module RileyIpsum
2
+ class Data
3
+ DATA_FILE = File.join(File.dirname(__FILE__), '../../data/riley.txt')
4
+
5
+ def random_line
6
+ source[random_index]
7
+ end
8
+
9
+ private
10
+
11
+ def random_index
12
+ Random.rand(source.length)
13
+ end
14
+
15
+ def source
16
+ @source ||= File.readlines(DATA_FILE).map(&:strip)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ module RileyIpsum
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,8 @@
1
+ require_relative 'riley_ipsum/base'
2
+ require_relative 'riley_ipsum/data'
3
+
4
+ module RileyIpsum
5
+ def self.generate(options = {})
6
+ Base.new(options).generate
7
+ end
8
+ end
@@ -0,0 +1,25 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ require 'riley_ipsum/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'riley_ipsum'
7
+ s.version = RileyIpsum::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ['Sebastian von Conrad', 'Tom Bryan', 'Pat McKenna']
10
+ s.email = ['sebastian@vonconrad.com', 'hello@tombryan.co', 'pat@mckenna.rocks']
11
+ s.homepage = 'http://github.com/blimpage/riley_ipsum'
12
+ s.summary = %q{Riley is an unknowable enigma with many plaid shirts}
13
+ s.description = %q{One time while playing pong Riley quoted like 7 obscure podcasts that nobody has ever heard of it was so fun OMG you should've been there just wild man}
14
+ s.license = 'MIT'
15
+
16
+ s.required_ruby_version = '~> 2.0'
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ['lib']
22
+
23
+ s.add_development_dependency 'rake'
24
+ s.add_development_dependency 'rspec', '~> 2.14.0'
25
+ end
@@ -0,0 +1,44 @@
1
+ require 'spec_helper'
2
+
3
+ describe RileyIpsum::Base do
4
+ let(:line) { 'got tim' }
5
+ let(:data) { RileyIpsum::Data }
6
+
7
+ describe '#generate' do
8
+ subject(:riley_ipsum) { RileyIpsum::Base.new }
9
+
10
+ before do
11
+ allow(data).to receive(:new).and_return(double(:random_line => line))
12
+ end
13
+
14
+ context 'when a single line is requested' do
15
+ it 'generates a line from data with a period at the end' do
16
+ expect(riley_ipsum.generate).to eq('got tim.')
17
+ end
18
+
19
+ context 'when a line already ends with punctuation' do
20
+ let(:line) { 'got tim!!!' }
21
+
22
+ it 'generates a line from data but does not add a period at the end' do
23
+ expect(riley_ipsum.generate).to eq('got tim!!!')
24
+ end
25
+ end
26
+ end
27
+
28
+ context 'when multiple lines are requested' do
29
+ subject(:riley_ipsum) { RileyIpsum::Base.new(:lines => 3) }
30
+
31
+ it 'generates multiple lines, separated by comma' do
32
+ expect(riley_ipsum.generate).to eq('got tim, got tim, got tim.')
33
+ end
34
+
35
+ context 'when a line already ends with punctuation' do
36
+ let(:line) { 'got tim?' }
37
+
38
+ it 'generates multiple lines, but does not add commas' do
39
+ expect(riley_ipsum.generate).to eq('got tim? got tim? got tim?')
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec::Matchers.define :be_included_in do |expected|
4
+ match do |actual|
5
+ expected.include?(actual)
6
+ end
7
+ end
8
+
9
+ describe RileyIpsum::Data do
10
+ describe '#random_line' do
11
+ let(:data_file) { File.readlines(File.join(File.dirname(__FILE__), '../../data/riley.txt')).map(&:strip) }
12
+
13
+ subject(:data) { RileyIpsum::Data.new }
14
+
15
+ it 'grabs a random line from the data file' do
16
+ expect(data.random_line).to be_included_in(data_file)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,2 @@
1
+ require 'bundler/setup'
2
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'riley_ipsum')
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: riley_ipsum
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sebastian von Conrad
8
+ - Tom Bryan
9
+ - Pat McKenna
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2016-03-10 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rspec
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: 2.14.0
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: 2.14.0
43
+ description: One time while playing pong Riley quoted like 7 obscure podcasts that
44
+ nobody has ever heard of it was so fun OMG you should've been there just wild man
45
+ email:
46
+ - sebastian@vonconrad.com
47
+ - hello@tombryan.co
48
+ - pat@mckenna.rocks
49
+ executables:
50
+ - riley_ipsum
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - ".gitignore"
55
+ - ".ruby-version"
56
+ - CHANGELOG.md
57
+ - Gemfile
58
+ - Gemfile.lock
59
+ - LICENSE
60
+ - README.md
61
+ - Rakefile
62
+ - bin/riley_ipsum
63
+ - data/riley.txt
64
+ - lib/riley_ipsum.rb
65
+ - lib/riley_ipsum/base.rb
66
+ - lib/riley_ipsum/data.rb
67
+ - lib/riley_ipsum/version.rb
68
+ - riley_ipsum.gemspec
69
+ - spec/riley_ipsum/base_spec.rb
70
+ - spec/riley_ipsum/data_spec.rb
71
+ - spec/spec_helper.rb
72
+ homepage: http://github.com/blimpage/riley_ipsum
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '2.0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.4.5
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Riley is an unknowable enigma with many plaid shirts
96
+ test_files:
97
+ - spec/riley_ipsum/base_spec.rb
98
+ - spec/riley_ipsum/data_spec.rb
99
+ - spec/spec_helper.rb