metaipsum 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.
- data/.gitignore +17 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +30 -0
- data/Rakefile +8 -0
- data/bin/metaipsum +5 -0
- data/lib/metaipsum/version.rb +3 -0
- data/lib/metaipsum.rb +67 -0
- data/metaipsum.gemspec +20 -0
- data/spec/metaipsum_spec.rb +25 -0
- data/spec/short_test.txt +1 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/test.txt +1 -0
- metadata +96 -0
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2012 TODO: Write your name
|
|
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,30 @@
|
|
|
1
|
+
# metaipsum
|
|
2
|
+
[](http://travis-ci.org/imkmf/metaipsum)
|
|
3
|
+
|
|
4
|
+
**metaipsum** is a tool for creating *Lorem ipsum* generators. Get it? It's kind of meta, right?
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Add this line to your application's Gemfile:
|
|
9
|
+
|
|
10
|
+
gem 'metaipsum'
|
|
11
|
+
|
|
12
|
+
And then execute:
|
|
13
|
+
|
|
14
|
+
$ bundle
|
|
15
|
+
|
|
16
|
+
Or install it yourself as:
|
|
17
|
+
|
|
18
|
+
$ gem install metaipsum
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Will be added on first functioning release.
|
|
23
|
+
|
|
24
|
+
## Contributing
|
|
25
|
+
|
|
26
|
+
1. Fork it
|
|
27
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
28
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
|
29
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
30
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/metaipsum
ADDED
data/lib/metaipsum.rb
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
require "metaipsum/version"
|
|
2
|
+
|
|
3
|
+
module Metaipsum
|
|
4
|
+
|
|
5
|
+
def self.version
|
|
6
|
+
|
|
7
|
+
"Metaipsum version #{Metaipsum::VERSION}"
|
|
8
|
+
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.count
|
|
12
|
+
|
|
13
|
+
count = Random.rand(20..30)
|
|
14
|
+
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.load
|
|
18
|
+
# Test for smaller files
|
|
19
|
+
base = ARGV[0]
|
|
20
|
+
|
|
21
|
+
gen = File.open("#{base}").read
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.generator
|
|
26
|
+
|
|
27
|
+
base = ARGV[0]
|
|
28
|
+
|
|
29
|
+
gen = File.open("#{base}").read
|
|
30
|
+
|
|
31
|
+
if gen.split.size > 10
|
|
32
|
+
|
|
33
|
+
array = gen.split(/ /)
|
|
34
|
+
|
|
35
|
+
count = Metaipsum.count
|
|
36
|
+
|
|
37
|
+
ipsum = "Metaipsum ruby etc "
|
|
38
|
+
|
|
39
|
+
count.times do
|
|
40
|
+
ipsum << array.sample + " "
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
print <<-eos
|
|
44
|
+
You passed in:
|
|
45
|
+
#{ gen }
|
|
46
|
+
|
|
47
|
+
Here is your ipsum text:
|
|
48
|
+
#{ ipsum }
|
|
49
|
+
|
|
50
|
+
eos
|
|
51
|
+
|
|
52
|
+
else
|
|
53
|
+
|
|
54
|
+
return nil
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
rescue Errno::ENOENT => e
|
|
59
|
+
|
|
60
|
+
print <<-eos
|
|
61
|
+
You just broke everything. Just kidding - maybe you forgot to specify a file?"
|
|
62
|
+
USAGE: metaipsum <filename>
|
|
63
|
+
eos
|
|
64
|
+
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
end
|
data/metaipsum.gemspec
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
require File.expand_path('../lib/metaipsum/version', __FILE__)
|
|
3
|
+
|
|
4
|
+
Gem::Specification.new do |gem|
|
|
5
|
+
gem.authors = ["Kristian Freeman"]
|
|
6
|
+
gem.email = ["kristian@redsashimi.com"]
|
|
7
|
+
gem.description = "Lorem ipsum generator, generator"
|
|
8
|
+
gem.summary = "Now you can be hip and pseudo-Latin too!"
|
|
9
|
+
gem.homepage = "http://github.com/imkmf/metaipsum"
|
|
10
|
+
|
|
11
|
+
gem.files = `git ls-files`.split($\)
|
|
12
|
+
gem.default_executable = %q{metaipsum}
|
|
13
|
+
gem.executables = ["metaipsum"]
|
|
14
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
15
|
+
gem.add_development_dependency "rspec", ">= 2.0.0"
|
|
16
|
+
gem.add_development_dependency "rake"
|
|
17
|
+
gem.name = "metaipsum"
|
|
18
|
+
gem.require_paths = ["lib"]
|
|
19
|
+
gem.version = Metaipsum::VERSION
|
|
20
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Metaipsum do
|
|
4
|
+
|
|
5
|
+
placeText = 'This is a test of the energy response system. All systems down! Crap!'
|
|
6
|
+
|
|
7
|
+
it 'should return correct version string' do
|
|
8
|
+
Metaipsum.version.should == "Metaipsum version #{Metaipsum::VERSION}"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'should load a file' do
|
|
12
|
+
ARGV[0] = 'spec/test.txt'
|
|
13
|
+
Metaipsum.load.should == placeText
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'should warn about small sources' do
|
|
17
|
+
ARGV[0] = 'spec/short_test.txt' # Under 10 words
|
|
18
|
+
Metaipsum.generator.should == nil
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'should pick a random number between 20 and 30 for count' do
|
|
22
|
+
(20..30).should cover(Metaipsum.count)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
data/spec/short_test.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
short!
|
data/spec/spec_helper.rb
ADDED
data/spec/test.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This is a test of the energy response system. All systems down! Crap!
|
metadata
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: metaipsum
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Kristian Freeman
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2012-05-29 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: rspec
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ! '>='
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 2.0.0
|
|
22
|
+
type: :development
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ! '>='
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 2.0.0
|
|
30
|
+
- !ruby/object:Gem::Dependency
|
|
31
|
+
name: rake
|
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
|
33
|
+
none: false
|
|
34
|
+
requirements:
|
|
35
|
+
- - ! '>='
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
type: :development
|
|
39
|
+
prerelease: false
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ! '>='
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
46
|
+
description: Lorem ipsum generator, generator
|
|
47
|
+
email:
|
|
48
|
+
- kristian@redsashimi.com
|
|
49
|
+
executables:
|
|
50
|
+
- metaipsum
|
|
51
|
+
extensions: []
|
|
52
|
+
extra_rdoc_files: []
|
|
53
|
+
files:
|
|
54
|
+
- .gitignore
|
|
55
|
+
- .travis.yml
|
|
56
|
+
- Gemfile
|
|
57
|
+
- LICENSE
|
|
58
|
+
- README.md
|
|
59
|
+
- Rakefile
|
|
60
|
+
- bin/metaipsum
|
|
61
|
+
- lib/metaipsum.rb
|
|
62
|
+
- lib/metaipsum/version.rb
|
|
63
|
+
- metaipsum.gemspec
|
|
64
|
+
- spec/metaipsum_spec.rb
|
|
65
|
+
- spec/short_test.txt
|
|
66
|
+
- spec/spec_helper.rb
|
|
67
|
+
- spec/test.txt
|
|
68
|
+
homepage: http://github.com/imkmf/metaipsum
|
|
69
|
+
licenses: []
|
|
70
|
+
post_install_message:
|
|
71
|
+
rdoc_options: []
|
|
72
|
+
require_paths:
|
|
73
|
+
- lib
|
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
|
+
none: false
|
|
76
|
+
requirements:
|
|
77
|
+
- - ! '>='
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: '0'
|
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
|
+
none: false
|
|
82
|
+
requirements:
|
|
83
|
+
- - ! '>='
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: '0'
|
|
86
|
+
requirements: []
|
|
87
|
+
rubyforge_project:
|
|
88
|
+
rubygems_version: 1.8.23
|
|
89
|
+
signing_key:
|
|
90
|
+
specification_version: 3
|
|
91
|
+
summary: Now you can be hip and pseudo-Latin too!
|
|
92
|
+
test_files:
|
|
93
|
+
- spec/metaipsum_spec.rb
|
|
94
|
+
- spec/short_test.txt
|
|
95
|
+
- spec/spec_helper.rb
|
|
96
|
+
- spec/test.txt
|