poefy 1.1.0 → 2.0.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 +5 -5
- data/.rspec +1 -1
- data/LICENSE +13 -13
- data/README.md +844 -844
- data/Rakefile +6 -6
- data/bin/poefy +347 -310
- data/bin/poefy_make +91 -91
- data/data/st_therese_of_lisieux.txt +3700 -3700
- data/data/whitman_leaves.txt +17815 -17815
- data/lib/poefy/core_extensions/array.rb +121 -121
- data/lib/poefy/database.rb +151 -151
- data/lib/poefy/db_type.rb +57 -57
- data/lib/poefy/generation.rb +16 -18
- data/lib/poefy/poem_base.rb +114 -112
- data/lib/poefy/poetic_forms.rb +529 -529
- data/lib/poefy/self.rb +39 -39
- data/lib/poefy/version.rb +26 -26
- data/lib/poefy.rb +46 -46
- data/poefy.gemspec +5 -3
- data/settings.yml +2 -2
- data/spec/poefy_unit_spec.rb +621 -621
- data/spec/spec_helper.rb +11 -11
- metadata +9 -12
data/lib/poefy/self.rb
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: UTF-8
|
3
|
-
|
4
|
-
################################################################################
|
5
|
-
# Class methods for Poefy module.
|
6
|
-
################################################################################
|
7
|
-
|
8
|
-
module Poefy
|
9
|
-
class << self
|
10
|
-
|
11
|
-
# Array of all databases (SQLite) or tables (Postgres)
|
12
|
-
# Does not include databases used for testing.
|
13
|
-
def corpora
|
14
|
-
Poefy::Database.list
|
15
|
-
end
|
16
|
-
alias_method :tables, :corpora
|
17
|
-
alias_method :databases, :corpora
|
18
|
-
|
19
|
-
# Same, but with the description of the corpus too.
|
20
|
-
def corpora_with_desc
|
21
|
-
Poefy::Database.list_with_desc
|
22
|
-
end
|
23
|
-
alias_method :tables_with_desc, :corpora_with_desc
|
24
|
-
alias_method :databases_with_desc, :corpora_with_desc
|
25
|
-
|
26
|
-
# Array of all names of poetic forms.
|
27
|
-
def poetic_forms
|
28
|
-
PoeticForms::POETIC_FORMS.keys.reject { |i| i == :default }
|
29
|
-
end
|
30
|
-
|
31
|
-
# Find the root of the directory tree.
|
32
|
-
def root
|
33
|
-
File.expand_path('../../../', __FILE__)
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
################################################################################
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Encoding: UTF-8
|
3
|
+
|
4
|
+
################################################################################
|
5
|
+
# Class methods for Poefy module.
|
6
|
+
################################################################################
|
7
|
+
|
8
|
+
module Poefy
|
9
|
+
class << self
|
10
|
+
|
11
|
+
# Array of all databases (SQLite) or tables (Postgres)
|
12
|
+
# Does not include databases used for testing.
|
13
|
+
def corpora
|
14
|
+
Poefy::Database.list
|
15
|
+
end
|
16
|
+
alias_method :tables, :corpora
|
17
|
+
alias_method :databases, :corpora
|
18
|
+
|
19
|
+
# Same, but with the description of the corpus too.
|
20
|
+
def corpora_with_desc
|
21
|
+
Poefy::Database.list_with_desc
|
22
|
+
end
|
23
|
+
alias_method :tables_with_desc, :corpora_with_desc
|
24
|
+
alias_method :databases_with_desc, :corpora_with_desc
|
25
|
+
|
26
|
+
# Array of all names of poetic forms.
|
27
|
+
def poetic_forms
|
28
|
+
PoeticForms::POETIC_FORMS.keys.reject { |i| i == :default }
|
29
|
+
end
|
30
|
+
|
31
|
+
# Find the root of the directory tree.
|
32
|
+
def root
|
33
|
+
File.expand_path('../../../', __FILE__)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
################################################################################
|
data/lib/poefy/version.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: UTF-8
|
3
|
-
|
4
|
-
################################################################################
|
5
|
-
# The current version number and date.
|
6
|
-
################################################################################
|
7
|
-
|
8
|
-
module Poefy
|
9
|
-
|
10
|
-
def self.version_number
|
11
|
-
major =
|
12
|
-
minor =
|
13
|
-
tiny = 0
|
14
|
-
pre = nil
|
15
|
-
|
16
|
-
string = [major, minor, tiny, pre].compact.join('.')
|
17
|
-
Gem::Version.new string
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.version_date
|
21
|
-
'
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
################################################################################
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Encoding: UTF-8
|
3
|
+
|
4
|
+
################################################################################
|
5
|
+
# The current version number and date.
|
6
|
+
################################################################################
|
7
|
+
|
8
|
+
module Poefy
|
9
|
+
|
10
|
+
def self.version_number
|
11
|
+
major = 2
|
12
|
+
minor = 0
|
13
|
+
tiny = 0
|
14
|
+
pre = nil
|
15
|
+
|
16
|
+
string = [major, minor, tiny, pre].compact.join('.')
|
17
|
+
Gem::Version.new string
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.version_date
|
21
|
+
'2025-06-28'
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
################################################################################
|
data/lib/poefy.rb
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: UTF-8
|
3
|
-
|
4
|
-
################################################################################
|
5
|
-
# Create a database from text lines.
|
6
|
-
# Read the database to generate poetry.
|
7
|
-
################################################################################
|
8
|
-
|
9
|
-
require 'conditional_sample'
|
10
|
-
require 'ruby_rhymes'
|
11
|
-
require 'wordfilter'
|
12
|
-
require 'humanize'
|
13
|
-
require 'timeout'
|
14
|
-
require 'yaml'
|
15
|
-
|
16
|
-
require_relative 'poefy/version.rb'
|
17
|
-
require_relative 'poefy/self.rb'
|
18
|
-
require_relative 'poefy/db_type.rb'
|
19
|
-
require_relative 'poefy/poem_base.rb'
|
20
|
-
require_relative 'poefy/generation.rb'
|
21
|
-
require_relative 'poefy/poetic_forms.rb'
|
22
|
-
require_relative 'poefy/poetic_form_from_text.rb'
|
23
|
-
require_relative 'poefy/string_manipulation.rb'
|
24
|
-
require_relative 'poefy/exceptions.rb'
|
25
|
-
require_relative 'poefy/database.rb'
|
26
|
-
require_relative 'poefy/conditional_sample.rb'
|
27
|
-
require_relative 'poefy/core_extensions/array.rb'
|
28
|
-
|
29
|
-
################################################################################
|
30
|
-
|
31
|
-
module Poefy
|
32
|
-
|
33
|
-
class Poem
|
34
|
-
|
35
|
-
include Poefy::PoemBase
|
36
|
-
include Poefy::Generation
|
37
|
-
include Poefy::PoeticForms
|
38
|
-
include Poefy::PoeticFormFromText
|
39
|
-
include Poefy::StringManipulation
|
40
|
-
include Poefy::ConditionalSample
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
################################################################################
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Encoding: UTF-8
|
3
|
+
|
4
|
+
################################################################################
|
5
|
+
# Create a database from text lines.
|
6
|
+
# Read the database to generate poetry.
|
7
|
+
################################################################################
|
8
|
+
|
9
|
+
require 'conditional_sample'
|
10
|
+
require 'ruby_rhymes'
|
11
|
+
require 'wordfilter'
|
12
|
+
require 'humanize'
|
13
|
+
require 'timeout'
|
14
|
+
require 'yaml'
|
15
|
+
|
16
|
+
require_relative 'poefy/version.rb'
|
17
|
+
require_relative 'poefy/self.rb'
|
18
|
+
require_relative 'poefy/db_type.rb'
|
19
|
+
require_relative 'poefy/poem_base.rb'
|
20
|
+
require_relative 'poefy/generation.rb'
|
21
|
+
require_relative 'poefy/poetic_forms.rb'
|
22
|
+
require_relative 'poefy/poetic_form_from_text.rb'
|
23
|
+
require_relative 'poefy/string_manipulation.rb'
|
24
|
+
require_relative 'poefy/exceptions.rb'
|
25
|
+
require_relative 'poefy/database.rb'
|
26
|
+
require_relative 'poefy/conditional_sample.rb'
|
27
|
+
require_relative 'poefy/core_extensions/array.rb'
|
28
|
+
|
29
|
+
################################################################################
|
30
|
+
|
31
|
+
module Poefy
|
32
|
+
|
33
|
+
class Poem
|
34
|
+
|
35
|
+
include Poefy::PoemBase
|
36
|
+
include Poefy::Generation
|
37
|
+
include Poefy::PoeticForms
|
38
|
+
include Poefy::PoeticFormFromText
|
39
|
+
include Poefy::StringManipulation
|
40
|
+
include Poefy::ConditionalSample
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
################################################################################
|
data/poefy.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.version = Poefy.version_number
|
17
17
|
s.date = Poefy.version_date
|
18
|
-
s.license = 'GPL-3.0'
|
18
|
+
s.license = 'GPL-3.0-or-later'
|
19
19
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
21
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -32,11 +32,13 @@ Gem::Specification.new do |s|
|
|
32
32
|
$ poefy_make
|
33
33
|
---}.split("\n").map{ |i| i.sub(' ','') }.join("\n")
|
34
34
|
|
35
|
+
s.required_ruby_version = '>= 3.2.0'
|
36
|
+
|
35
37
|
s.add_development_dependency('bundler', '~> 1.13')
|
36
38
|
s.add_development_dependency('rake', '~> 10.0')
|
37
39
|
s.add_development_dependency('rspec', '~> 3.0')
|
38
|
-
s.add_development_dependency('poefy-sqlite3', '~> 0.
|
39
|
-
s.add_development_dependency('poefy-pg', '~> 0.
|
40
|
+
s.add_development_dependency('poefy-sqlite3', '~> 2.0.0')
|
41
|
+
s.add_development_dependency('poefy-pg', '~> 2.0.0')
|
40
42
|
|
41
43
|
s.add_runtime_dependency('conditional_sample', '~> 1.0', '>= 1.0.0')
|
42
44
|
s.add_runtime_dependency('ruby_rhymes', '~> 0.1', '>= 0.1.2')
|
data/settings.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
---
|
2
|
-
database: pg
|
1
|
+
---
|
2
|
+
database: pg
|