guillaume 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: e6a5298af00338822dae0cdb50b064b657c1eef4
4
+ data.tar.gz: e3f29364c026d37449a65863ac2c417b8b29e120
5
+ SHA512:
6
+ metadata.gz: 691281cfe1cc370b8b6b6c0527cd059eaba9a8cdc14161d6aeef0b20da4d9598fd9f0c3b37ddab5a475e58c5b6fcef2a4df20c8250d9b1f44d38b0885647cf27
7
+ data.tar.gz: 5f328a7ac6368bd20117fa095656ff2ef0d05ec2b8ed92a5fc07c8fa2b9a186bd620374a49c91049e5988688a8a1557ee506ac248f13f2812f1470c761a5f752
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ .ruby-version
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+
20
+ tags
21
+ *.swp
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "rspec", "~> 3.0"
6
+ gem "sequel", "~> 4.11"
7
+ gem "sqlite3", "~> 1.3"
8
+ gem "pg", "~> 0.17"
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Jamey J. DeOrio
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.markdown ADDED
@@ -0,0 +1,46 @@
1
+ # Guillaume
2
+
3
+ Guillaume is a generative poetry creation tool.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem "guillaume"
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install guillaume
18
+
19
+ ## Usage
20
+
21
+ ### Command line
22
+
23
+ Usage: guillaume /path/to/text_source.txt
24
+ -v, --verbose Verbose output while writing
25
+ -m, --max-stanzas STANZAS Maximum number of stanzas to write
26
+
27
+ ### Gem
28
+
29
+ require "guillaume"
30
+ source_text_file = Guillaume::SourceText.new("/path/to/text_source.txt")
31
+ poem = Guillaume::Poem.new(source_text_file, max_stanzas: 5)
32
+ puts poem.formatted
33
+
34
+ ## TODO
35
+
36
+ - establish data storage
37
+ - write separate parsing methods for poetry (linebreak-aware) and literature (linebreak-agnostic)
38
+ - write functionality for staying/straying from topics
39
+
40
+ ## Contributing
41
+
42
+ 1. Fork it
43
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
44
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
45
+ 4. Push to the branch (`git push origin my-new-feature`)
46
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
data/bin/guillaume ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "optparse"
4
+ require "guillaume"
5
+
6
+ options = {}
7
+ option_parser = OptionParser.new do |opts|
8
+ opts.banner = "Usage: guillaume /path/to/text_source.txt"
9
+
10
+ opts.on("-v", "--verbose", "Verbose output while writing") do
11
+ $LOGGER.level = Logger::INFO
12
+ end
13
+
14
+ options[:max_stanzas] = 10
15
+ opts.on("-m", "--max-stanzas STANZAS", Integer, "Maximum number of stanzas to write") do |m|
16
+ options[:max_stanzas] = m
17
+ end
18
+ end
19
+
20
+ option_parser.parse!
21
+
22
+ source_text_file = ARGV.pop
23
+
24
+ if !source_text_file && options.empty?
25
+ puts option_parser.help
26
+ exit
27
+ end
28
+
29
+ # required
30
+ unless source_text_file
31
+ raise ArgumentError, "Please point to a source text file"
32
+ end
33
+
34
+ # validations
35
+
36
+ poem = Guillaume::Poem.new(Guillaume::SourceText.new(source_text_file), max_stanzas: options[:max_stanzas])
37
+ puts ""
38
+ puts poem.formatted
@@ -0,0 +1 @@
1
+ connection_string: "sqlite://development.db"