warren_ipsum 0.1.0

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: 02ab0fe9c77ef8cefe1e26cbebcf06af6998fb2f
4
+ data.tar.gz: a8b555c96bdd7b6c930cf1b3938e8614d0bfda00
5
+ SHA512:
6
+ metadata.gz: 451e8afa23e97d8f4238560bdba74f1b486674f71525d5bba686d29245b76fcf881080af1c795b7e7748e077bf938526cfbae01d0bcf744e37f7394f110f7b8a
7
+ data.tar.gz: 59019251c321cb46a471b53bdc8b6519267bbc5b68ed8350ab11e3f1898c5211cfa5187209c0631da5fce09c73a0fc5d6234c67c3fc062efb9222264a52925ad
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.0.0-p247
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,26 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ warren_ipsum (0.1.0)
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
+ rspec (~> 2.14.0)
26
+ warren_ipsum!
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/data/warren.txt ADDED
@@ -0,0 +1,92 @@
1
+ these damn designers and their designer-words
2
+ I got married and now I have all these unresolved dependencies
3
+ well it's not my problem if they end up with crappy artifacts because they didn't use .png
4
+ errrm you might need to rake db:migrate
5
+ say no to overwriting
6
+ don't you have an Avdi tweet to re-post or something?
7
+ ZOMG LUNCHTIEM
8
+ .Net? Ewww
9
+ I have no need for VPS hosting any more
10
+ I cry every time I think how much I paid for my first 1GB HDD
11
+ your attendance at daily stand ups is required - bring pastries
12
+ obvious joke is obvious
13
+ Yawn
14
+ Can't figure out if it's ignorance or arrogance that leads people to half implement an existing design pattern and call it something else
15
+ well I'm glad we had this talk
16
+ set your velocity to 30
17
+ glad to hear that .NET programmers are still the same
18
+ I think we've seen enough - rewrite
19
+ Ahhhh I love it when someone rolls their own complete MVC framework
20
+ shakes fist at Timecop and Cucumber
21
+ nice try paper boy
22
+ cake tastes better
23
+ nooooo not the stupid video popover
24
+ next HOVERBOARDS
25
+ actual LOL
26
+ ffs
27
+ looks like that stuff could be extracted into a more general method to sanitize the page
28
+ evil? it's positively Lovecraft-ian
29
+ code review coming soon to a GitHub account near you
30
+ there'll be cross dressing and probably full frontal nudity
31
+ just running the full cucumber
32
+ all singing all dancing code
33
+ annoyingly we spell aluminium correctly as per the IUPAC standards yet the Americans won't get over it
34
+ I stood behind Aaron awkwardly for a whole 2 minutes
35
+ estimation session is down for Thursday - 9pts to go by Friday
36
+ brb coffee
37
+ back in my day when we lost Lego instructions we just cried inconsolably for a bit then built something else
38
+ what can I say? I'm apparently quotable
39
+ it's gonna be webscale baby
40
+ no problems Shouty McShoutsalot
41
+ my office made it as high as 34 degrees celsius on a summer afternoon once
42
+ it's security theatre 100%
43
+ I got told off for not taking off my shoes in one airport then got told off for taking them off in the next one
44
+ insufficient cake?
45
+ 404 cake not found
46
+ as soon as mediation is classed as billable I'm there
47
+ derp derp
48
+ kool
49
+ I'm gonna be ironic and join up using my Facebook account
50
+ can't recall the last time I thought "wow I bet the rest of the world would love to see me searching for this"
51
+ every time I mentioned Spree I might as well have said I have an STD
52
+ pffft stealth
53
+ oh thank god I thought this was gonna be some kind of toilet tweet
54
+ and they say nerds smell
55
+ Wifi in there wasn't working sat morning so I whipped my dongle out
56
+ MANHOLE
57
+ after that you should be drinking scotch at 10am like a bawse
58
+ fuuuuuu
59
+ could you do something dirty to inject some JS which disables Cufon so that it doesn't molest the DOM
60
+ you're heading into unintended side-effects territory
61
+ display:none and this would be far less of an issue
62
+ what a fucking HACK
63
+ unberiebable
64
+ I just wish I could ignore emails - it must be nice to be completely self-absorbed like that
65
+ gemfury
66
+ fuck paying for that we should roll our own
67
+ I know what you used the company credit card on last summer
68
+ did I mention before that Nirvana's Bleach is massively underrated?
69
+ I'm equal parts concerned and jealous
70
+ cake is delicious
71
+ circling vultures
72
+ if you're not in D&D you're nowhere
73
+ what's the design equivalent of a brogrammer?
74
+ crack a branch
75
+ awww nu
76
+ dust off your OCaml - maybe you can get picked up by a HFT desk
77
+ it's mandatory to go in daylight hours for maximum photographer happiness
78
+ I'm moving to Utah so I can marry git bisect as well
79
+ these young bucks have never seen a nuclear fucking winter
80
+ why does he carry on like he's the only one that EVER gets hassled by recruiters?
81
+ let me draw you a Venn Diagram
82
+ you should send that to ol' Grimjaw
83
+ I know you guys will find it tough without me but I know you have it in you to soldier on in my absence
84
+ hey I enjoy going to the 1% floor just so I can be all like "yeah look at me I'm wearing SHORTS"
85
+ I'm playing text editor Pokemon
86
+ for $32m I'd write machine code with a crayon
87
+ most women should try throwing with the other hand
88
+ my flat white was a fucking latte in a cup
89
+ this is like employment archaeology
90
+ embrace the cheese
91
+ maybe if the original hadn't been written in Delphi it would have been you know portable within the $32m budget
92
+ it's automated distributed and reasonably sophistsicate
@@ -0,0 +1,24 @@
1
+ module WarrenIpsum
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
+ lines.join(', ') + '.'
16
+ end
17
+
18
+ private
19
+
20
+ def load_data_source
21
+ File.expand_path("../../bin", "/tmp/x")
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ module WarrenIpsum
2
+ class Data
3
+ DATA_FILE = File.join(File.dirname(__FILE__), '../../data/warren.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 WarrenIpsum
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,8 @@
1
+ require_relative 'warren_ipsum/base'
2
+ require_relative 'warren_ipsum/data'
3
+
4
+ module WarrenIpsum
5
+ def self.generate(options = {})
6
+ Base.new(options).generate
7
+ end
8
+ end
@@ -0,0 +1,2 @@
1
+ require 'bundler/setup'
2
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'warren_ipsum')
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe WarrenIpsum::Base do
4
+ let(:line) { 'actual LOL' }
5
+ let(:data) { WarrenIpsum::Data }
6
+
7
+ describe '#generate' do
8
+ subject(:warren_ipsum) { WarrenIpsum::Base.new }
9
+
10
+ before do
11
+ allow(data).to receive(:new).and_return(double(:random_line => line))
12
+ end
13
+
14
+ it 'generates a line from data with a period at the end' do
15
+ expect(warren_ipsum.generate).to eql('actual LOL.')
16
+ end
17
+
18
+ context 'when multiple lines are requested' do
19
+ subject(:warren_ipsum) { WarrenIpsum::Base.new(:lines => 3) }
20
+
21
+ it 'generates multiple lines, separated by comma' do
22
+ expect(warren_ipsum.generate).to eql('actual LOL, actual LOL, actual LOL.')
23
+ end
24
+ end
25
+ end
26
+ 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 WarrenIpsum::Data do
10
+ describe '#random_line' do
11
+ let(:data_file) { File.readlines(File.join(File.dirname(__FILE__), '../../data/warren.txt')).map(&:strip) }
12
+
13
+ subject(:data) { WarrenIpsum::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,25 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ require 'warren_ipsum/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'warren_ipsum'
7
+ s.version = WarrenIpsum::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ['Sebastian von Conrad', 'Tom Bryan']
10
+ s.email = ['sebastian@vonconrad.com', 'hello@tombryan.co']
11
+ s.homepage = 'http://github.com/vonconrad/warren_ipsum'
12
+ s.summary = %q{Warren is a sensible Rails developer with good hair}
13
+ s.description = %q{One time at RailsCamp Warren stayed up until like 10pm going crazy sick on some code 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
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: warren_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
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-10-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
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: rspec
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 2.14.0
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: 2.14.0
42
+ description: One time at RailsCamp Warren stayed up until like 10pm going crazy sick
43
+ on some code it was so fun OMG you should've been there just wild man
44
+ email:
45
+ - sebastian@vonconrad.com
46
+ - hello@tombryan.co
47
+ executables: []
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - .gitignore
52
+ - .ruby-version
53
+ - Gemfile
54
+ - Gemfile.lock
55
+ - Rakefile
56
+ - data/warren.txt
57
+ - lib/warren_ipsum.rb
58
+ - lib/warren_ipsum/base.rb
59
+ - lib/warren_ipsum/data.rb
60
+ - lib/warren_ipsum/version.rb
61
+ - spec/spec_helper.rb
62
+ - spec/warren_ipsum/base_spec.rb
63
+ - spec/warren_ipsum/data_spec.rb
64
+ - warren_ipsum.gemspec
65
+ homepage: http://github.com/vonconrad/warren_ipsum
66
+ licenses:
67
+ - MIT
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '2.0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 2.0.3
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: Warren is a sensible Rails developer with good hair
89
+ test_files:
90
+ - spec/spec_helper.rb
91
+ - spec/warren_ipsum/base_spec.rb
92
+ - spec/warren_ipsum/data_spec.rb