unfictionWP 0.1.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 +7 -0
- data/.gitignore +8 -0
- data/Gemfile +6 -0
- data/README.md +35 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/unfictionWP/version.rb +3 -0
- data/lib/unfictionWP.rb +64 -0
- data/unfictionWP.gemspec +26 -0
- metadata +81 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c6f4268a5170c95baaeaf6a85edc6f8d6e1fd74dffff8eb7eadccab4178d5eac
|
|
4
|
+
data.tar.gz: d71a8cd99409ba76dc1d5d665de4741884ae5c9cbfa8311acbe0154eaeecb720
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 51a630a434d3e820cb23b480e2a7c3fee18a34dd822d2ff0deb43fb07d56aedd109b187520da8cad0433b5721fb8b253ce4f8d343958fd921e07cc8e420487eb
|
|
7
|
+
data.tar.gz: 0ee7946f7df6fb0a5aa847fa5260655a9e9b1ea43f340cc638ecd1a69ba865a6ef0885b61b0f97e961c8d09bf407f17d0e60eb8fc142d0e5db70097f41d9c943
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# UnfictionWP
|
|
2
|
+
|
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/unfictionWP`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
+
|
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your application's Gemfile:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
gem 'unfictionWP'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
$ bundle
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
|
|
21
|
+
$ gem install unfictionWP
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
TODO: Write usage instructions here
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
30
|
+
|
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
32
|
+
|
|
33
|
+
## Contributing
|
|
34
|
+
|
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/unfictionWP.
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "unfictionWP"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/unfictionWP.rb
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
require "unfictionWP/version"
|
|
2
|
+
|
|
3
|
+
module UnfictionWP
|
|
4
|
+
class Processor
|
|
5
|
+
def self.write
|
|
6
|
+
|
|
7
|
+
# Loop limit based on configured screen settings.
|
|
8
|
+
number = File.read("data/config/line_num.txt").strip.to_i
|
|
9
|
+
do_size = ["tiny", "small", "medium"]
|
|
10
|
+
size_chosen = do_size[number]
|
|
11
|
+
size_limit = size_chosen.size.to_i
|
|
12
|
+
|
|
13
|
+
# Character name chosen from number
|
|
14
|
+
name_number = File.read("data/identity/number.txt").strip.to_i
|
|
15
|
+
|
|
16
|
+
character_count = 2 # name_list[name_number].size.to_s
|
|
17
|
+
# name_limit = 0
|
|
18
|
+
|
|
19
|
+
# Base dialogue sequence on size limit.
|
|
20
|
+
size_limit.times do
|
|
21
|
+
|
|
22
|
+
# Username logistics
|
|
23
|
+
name_list = File.read("data/identity/name_list.txt").split(", ")
|
|
24
|
+
name = name_list[name_number].to_s
|
|
25
|
+
name_limit = name_list[name_number].size
|
|
26
|
+
|
|
27
|
+
if name_limit > character_count
|
|
28
|
+
name_limit = name_limit % 2
|
|
29
|
+
else
|
|
30
|
+
name_limit = name_limit + 1
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
old_dialogue = File.read("archive/dialogue.txt").strip.to_s
|
|
34
|
+
|
|
35
|
+
# Write date to file.
|
|
36
|
+
system("date > data/date/date.txt")
|
|
37
|
+
|
|
38
|
+
date = File.read("data/date/date.txt").strip
|
|
39
|
+
|
|
40
|
+
# Print character dialogue to screen.
|
|
41
|
+
print "[#{date} #{name.strip}] "; new_dialogue = gets.chomp
|
|
42
|
+
|
|
43
|
+
# If writer specifies exit then aborts
|
|
44
|
+
if new_dialogue == "exit"
|
|
45
|
+
abort
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Autosaves dialogue archive. Auto appends old dialogue above new dialogue.
|
|
49
|
+
open("archive/dialogue.txt", "w") { |f|
|
|
50
|
+
f.puts old_dialogue
|
|
51
|
+
f.print "[#{date} #{name.strip}] "
|
|
52
|
+
f.puts new_dialogue
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# Changes name as if in a chatroom.
|
|
56
|
+
if name_number == name_limit
|
|
57
|
+
name_number = 0
|
|
58
|
+
else
|
|
59
|
+
name_number = name_number + 1
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
data/unfictionWP.gemspec
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
+
require "unfictionWP/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "unfictionWP"
|
|
7
|
+
spec.version = UnfictionWP::VERSION
|
|
8
|
+
spec.authors = ["LWFlouisa"]
|
|
9
|
+
spec.email = ["lwflouisa@gmail.com"]
|
|
10
|
+
|
|
11
|
+
spec.summary = %q{This is not an unfiction wordprocessor.}
|
|
12
|
+
spec.description = %q{This was not created to simplify the chatlog creation process for stories that are completely true!}
|
|
13
|
+
spec.homepage = "https://lwflouisa.github.io/UnfictionWP"
|
|
14
|
+
|
|
15
|
+
# Specify which files should be added to the gem when it is released.
|
|
16
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
17
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
19
|
+
end
|
|
20
|
+
spec.bindir = "exe"
|
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
|
+
spec.require_paths = ["lib"]
|
|
23
|
+
|
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
26
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: unfictionWP
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- LWFlouisa
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2021-10-13 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.16'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.16'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
description: This was not created to simplify the chatlog creation process for stories
|
|
42
|
+
that are completely true!
|
|
43
|
+
email:
|
|
44
|
+
- lwflouisa@gmail.com
|
|
45
|
+
executables: []
|
|
46
|
+
extensions: []
|
|
47
|
+
extra_rdoc_files: []
|
|
48
|
+
files:
|
|
49
|
+
- ".gitignore"
|
|
50
|
+
- Gemfile
|
|
51
|
+
- README.md
|
|
52
|
+
- Rakefile
|
|
53
|
+
- bin/console
|
|
54
|
+
- bin/setup
|
|
55
|
+
- lib/unfictionWP.rb
|
|
56
|
+
- lib/unfictionWP/version.rb
|
|
57
|
+
- unfictionWP.gemspec
|
|
58
|
+
homepage: https://lwflouisa.github.io/UnfictionWP
|
|
59
|
+
licenses: []
|
|
60
|
+
metadata: {}
|
|
61
|
+
post_install_message:
|
|
62
|
+
rdoc_options: []
|
|
63
|
+
require_paths:
|
|
64
|
+
- lib
|
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
|
+
requirements:
|
|
67
|
+
- - ">="
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0'
|
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0'
|
|
75
|
+
requirements: []
|
|
76
|
+
rubyforge_project:
|
|
77
|
+
rubygems_version: 2.7.8
|
|
78
|
+
signing_key:
|
|
79
|
+
specification_version: 4
|
|
80
|
+
summary: This is not an unfiction wordprocessor.
|
|
81
|
+
test_files: []
|