ffakertime 0.0.1

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: b3f63ec0c74365778ea079c9c4e7a8813fd2c0d8
4
+ data.tar.gz: 554c4095a98bb288142c43025aad881da1e5b316
5
+ SHA512:
6
+ metadata.gz: 45b11b50081b6f6a7f396d171fc6cea54a7981ba993b56057cf41d6a1ccb5d58f1fb035e2e8111d8b63d3b2c9b55b5326d7897a8345a25f51d138a249b72f7bb
7
+ data.tar.gz: a5c313ee0ba0e1fdb59cd93a7c40ccc1bd57d082c06f7b65c3ced02f2b7c87e7f267328a1d7490b9a433ccd1f0e1513e25b13edd5546294738fcde81b6c63ae2
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/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ffakeron.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Dirk Kelly
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,56 @@
1
+ # Fakeron
2
+
3
+ Adds the module Faker::SwansonIpsum, Faker::SwansonQuote giving you endless hours of fun with Ron Swanson idioms.
4
+
5
+ ## Why?
6
+
7
+ I don't think you should have to run off a branch to get this comedy gold, and I don't think it should really be additional code in the master branch.
8
+
9
+ Also I wanted to publish another gem so it doesn't look like I do nothing with my life other than watch NBC sitcoms... As true as that conception may be.
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ gem 'ffakeron'
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install ffakeron
24
+
25
+ ## Usage
26
+
27
+ ### Faker::SwansonIpsum
28
+
29
+ As you would any other Ipsum generator you're able to get a few basic strings from Faker::SwansonIpsum, notably.
30
+
31
+ Faker::SwansonIpsum.word # random Swanson style word
32
+ Faker::SwansonIpsum.words(count) # array of random words
33
+
34
+ Faker::SwansonIpsum.sentence # random collection of words as a sentence
35
+ Faker::SwansonIpsum.sentences(count) # array of random sentences
36
+
37
+ Faker::SwansonIpsum.paragraph # random sentences, strung together
38
+ Faker::SwansonIpsum.paragraphs(count) # array of random paragraphs
39
+
40
+ ### Faker::SwansonQuote
41
+
42
+ Instead of a pattern of gibberish Ipsum, you can generate quotes from Swanson
43
+
44
+ Faker::SwansonQuote.sentence # A single quote
45
+ Faker::SwansonQuote.sentences(count) # array of quotes
46
+
47
+ Faker::SwansonQuote.paragraph # A few quotes strung together
48
+ Faker::SwansonQuote.paragraphs(count) # array of paragraphs of quotes
49
+
50
+ ## Contributing
51
+
52
+ 1. Fork it
53
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
54
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
55
+ 4. Push to the branch (`git push origin my-new-feature`)
56
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rake/testtask'
4
+ Rake::TestTask.new do |t|
5
+ t.libs << "test/" << "lib/"
6
+ t.ruby_opts << "-rhelper"
7
+ t.test_files = FileList['test/test*.rb']
8
+ t.verbose = true
9
+ end
10
+
11
+ task :default => :test
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ffakertime/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "ffakertime"
8
+ gem.version = Fakertime::VERSION
9
+ gem.authors = ["Dirk Kelly"]
10
+ gem.email = ["git+dk@dirkkelly.com"]
11
+ gem.description = %q{Adventure Time addition to Ffaker}
12
+ gem.summary = %q{Generates dummy data based off Adventure Time stuff}
13
+ gem.homepage = "http://ipsumtime.com"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_dependency 'ffaker'
21
+ gem.add_development_dependency 'rake'
22
+ gem.add_development_dependency 'test-unit'
23
+ end
@@ -0,0 +1,20 @@
1
+ module Faker
2
+ module IpsumTime
3
+ extend ModuleUtils
4
+ extend Lorem
5
+ extend self
6
+
7
+ def word
8
+ ADVENTURE_WORDS.rand
9
+ end
10
+
11
+ def words(num = 3)
12
+ ADVENTURE_WORDS.random_pick(num)
13
+ end
14
+
15
+ ADVENTURE_WORDS = k [
16
+ "Algebraic", "Math", "Alphanumerical", "Glob",
17
+ "Finn", "Jake", "BMO", "Peebee", "Marcelene", "Simon"
18
+ ]
19
+ end
20
+ end
@@ -0,0 +1,39 @@
1
+ module Faker
2
+ module QuoteTime
3
+ extend ModuleUtils
4
+ extend self
5
+
6
+ def sentence
7
+ ADVENTURE_QUOTES.rand
8
+ end
9
+
10
+ def sentences(num = 3)
11
+ sentences_with_duplicates = (1..num+10).map { sentence }
12
+ sentences_with_duplicates.uniq[1..num]
13
+ end
14
+
15
+ def paragraph(sentence_count = 3)
16
+ sentences_with_duplicates = (1..sentence_count+10).map { sentence }
17
+ sentences_with_duplicates.uniq[1..sentence_count+rand(4)].join(' ')
18
+ end
19
+
20
+ def paragraphs(num = 3)
21
+ paragraphs_with_duplicates = (1..num+10).map { paragraph }
22
+ paragraphs_with_duplicates.uniq[1..num]
23
+ end
24
+
25
+ ADVENTURE_QUOTES = k [
26
+ "That guy must do mad squats.",
27
+ "Ticket to the gun show.",
28
+ "Making bacon pancakes.",
29
+ "Daddy why did you eat my fries.",
30
+ "Sometimes you need to go where everybody knows your name.",
31
+ "I need to save you, but who's going to save me.",
32
+ "This magic keeps me alive, but it's driving me crazy.",
33
+ "You are-are-are-are my best friends in the world.",
34
+ "In my world pillows are used for bedding.",
35
+ "You slayed the dragon with your sharp pillow."
36
+ ]
37
+ end
38
+ end
39
+
@@ -0,0 +1,3 @@
1
+ module Fakertime
2
+ VERSION = "0.0.1"
3
+ end
data/lib/ffakertime.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'ffaker'
2
+ require 'ffakertime/version'
3
+
4
+ module Fakertime
5
+
6
+ end
7
+
8
+ module Faker
9
+ autoload :IpsumTime, 'ffaker/ipsum_time'
10
+ autoload :QuoteTime, 'ffaker/quote_time'
11
+ end
data/test/helper.rb ADDED
@@ -0,0 +1,12 @@
1
+ require 'test/unit'
2
+
3
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ require 'ffaker'
6
+ require 'ffakertime'
7
+
8
+ class Test::Unit::TestCase
9
+ def self.it(description, &block)
10
+ define_method("test_#{ description }", &block)
11
+ end
12
+ end
@@ -0,0 +1,27 @@
1
+ require 'helper'
2
+
3
+ class TestIpsumTime < Test::Unit::TestCase
4
+ def test_paragraph
5
+ assert_match /1\+|[ a-z]+/i, Faker::IpsumTime.paragraph
6
+ end
7
+
8
+ def test_sentence
9
+ assert_match /1\+|[ a-z]+\./i, Faker::IpsumTime.sentence
10
+ end
11
+
12
+ def test_paragraphs
13
+ assert_match /1\+|[ a-z]+/i, Faker::IpsumTime.paragraphs.join(" ")
14
+ end
15
+
16
+ def test_sentences
17
+ assert_match /1\+|[ a-z]+/i, Faker::IpsumTime.sentences.join(" ")
18
+ end
19
+
20
+ def test_words
21
+ assert_match /1\+|[ a-z]+/i, Faker::IpsumTime.words.join(" ")
22
+ end
23
+
24
+ def test_word
25
+ assert_match /1\+|[a-z]+/i, Faker::IpsumTime.word
26
+ end
27
+ end
@@ -0,0 +1,25 @@
1
+ require 'helper'
2
+
3
+ class TestQuoteTime < Test::Unit::TestCase
4
+ def test_sentence
5
+ assert_match /1\+|[a-z]+\./i, Faker::QuoteTime.sentence
6
+ end
7
+
8
+ def test_sentences
9
+ assert_match /1\+|[a-z]+/i, Faker::QuoteTime.sentences.join(" ")
10
+ assert_equal 3, Faker::QuoteTime.sentences.uniq.length
11
+ assert_equal 2, Faker::QuoteTime.sentences(2).uniq.length
12
+ end
13
+
14
+ def test_paragraph
15
+ assert_match /1\+|[a-z]+/i, Faker::QuoteTime.paragraph
16
+ assert_operator 3, :<=, Faker::QuoteTime.paragraph.split(". ").uniq.length
17
+ assert_operator 2, :<=, Faker::QuoteTime.paragraph(2).split(". ").uniq.length
18
+ end
19
+
20
+ def test_paragraphs
21
+ assert_match /1\+|[a-z]+/i, Faker::QuoteTime.paragraphs.join(" ")
22
+ assert_equal 3, Faker::QuoteTime.paragraphs.uniq.length
23
+ assert_equal 2, Faker::QuoteTime.paragraphs(2).uniq.length
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ffakertime
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dirk Kelly
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-04-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ffaker
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: test-unit
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
+ description: Adventure Time addition to Ffaker
56
+ email:
57
+ - git+dk@dirkkelly.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - ffakertime.gemspec
68
+ - lib/ffaker/ipsum_time.rb
69
+ - lib/ffaker/quote_time.rb
70
+ - lib/ffakertime.rb
71
+ - lib/ffakertime/version.rb
72
+ - test/helper.rb
73
+ - test/test_ipsum_time.rb
74
+ - test/test_quote_time.rb
75
+ homepage: http://ipsumtime.com
76
+ licenses: []
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.0.0
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Generates dummy data based off Adventure Time stuff
98
+ test_files:
99
+ - test/helper.rb
100
+ - test/test_ipsum_time.rb
101
+ - test/test_quote_time.rb