conlang 0.2.0 → 0.2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9c221e8eefb643ff2b4ff6808d7758df343a1f0
4
- data.tar.gz: 61d9f3daab090cfbb598a66a19750ac10a5d805a
3
+ metadata.gz: a2e2972b439eaeeff3a865a94f862ca266bf57c2
4
+ data.tar.gz: c1b94be6c8d7dbee38a2b55be794882f653f42f1
5
5
  SHA512:
6
- metadata.gz: 1a9337ab8f9e2ed17cd1fb83adc6886668ac9b0e7b01e9e439829531a8c1f195b29a22a54f788863fdb89bafc421e7d047a13f0f60cede08822cc498348b8b73
7
- data.tar.gz: fa2f8cc35e30f01dc2db36cab0958e13e8448ae21d73fb1a3b38e8f2d3b363da89de5052d48a85fe736ed6bc13bdf8ca228cf29fce87cf62f95c2b19bf9be20f
6
+ metadata.gz: 873f2eb94c953f7a7df75c60f750c66787f2b028c516b19c2158293afc87957663bb0394da6797ee0fe49071f035e86df23cdcf3cf0ffb9f44dc9d1be3457931
7
+ data.tar.gz: 49fa67c205f1468b636bca6bf9cf0cfba42a89340ed04c85a7108b7985474c67fdb8befd5fbfebf1c9ce72ed656a7119f4e83ea0e68067a0705ebde73ce6f012
data/CHANGELOG.md CHANGED
@@ -6,8 +6,12 @@ TODO
6
6
 
7
7
  Implemented features
8
8
  ====================
9
- * Maybe(A) operator (no weight is requiered,
9
+ * `Maybe(A)` operator (no weight is requiered,
10
10
  default probability is 50)
11
- * Or(A, b) operator (no wight is requiered,
11
+ * `Or(A, b)` operator (no wight is requiered,
12
12
  default probability is 50)
13
- * Published as a Ruby gem
13
+ * Released as a Ruby gem
14
+ * An executable in `\bin` has been included.
15
+ See [README.md](README.md) to see
16
+ documentation about how to use this gem
17
+ as a command line utility.
data/README.md CHANGED
@@ -17,16 +17,24 @@ described language.
17
17
 
18
18
  Instructions
19
19
  ------------
20
- Usage:
20
+ Usage as **command line executable**:
21
+
22
+ conlang <words count> '<LANG file>'
23
+
24
+ This command produces an `output-<name>.txt`
25
+ file that includes a list of the generated words,
26
+ separated by newlines.
27
+
28
+ Usage as **gem**:
21
29
 
22
30
  require 'conlang'
23
31
 
24
32
  # Path to LANG file, as constructor.
25
- x = WordGenerator.new("tokipona.lang")
33
+ x = WordGenerator.new("tokipona.lang")
26
34
 
27
35
  # Print ten generated words as
28
36
  # an array of strings.
29
- p x.get_words(10)
37
+ p x.get_words(10)
30
38
 
31
39
 
32
40
  There are `*.lang` files as examples at `lang-examples`
data/bin/conlang ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This script allows the 'conlang' gem
4
+ # to be used as a command line utility.
5
+
6
+ # Instructions for usage
7
+ USAGE = " Usage:\n conlang <words count> '<LANG file>'\n\n" +
8
+ " See documentation for more information in README at\n" +
9
+ " https://github.com/fluorine/ConlangWordGenerator"
10
+
11
+ # If incorrect quantity of arguments
12
+ if ARGV.length != 2 && ARGV[0] !~ /d+/ && ARGV[1] !~ /\.lang$/
13
+ p "argv"
14
+ puts USAGE
15
+ exit
16
+ end
17
+
18
+ # Import gem
19
+ require 'conlang'
20
+
21
+ # Use conlang gem as an utility and
22
+ # show instructions if an error occurs
23
+ begin
24
+ # Parse arguments
25
+ words_qty = ARGV[0].to_i
26
+ filename = ARGV[1].split(".")[0]
27
+
28
+ # Generate words
29
+ generator = WordGenerator.new(filename + ".lang")
30
+ words = generator.get_words(words_qty)
31
+
32
+ # Produce output file
33
+ IO.write(filename + "-output.txt", words.join("\n"))
34
+ puts " '#{filename + "-output.txt"}' file has been produced."
35
+ rescue
36
+ puts USAGE
37
+ end
@@ -1,3 +1,3 @@
1
1
  module ConlangWordGenerator
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1.1'
3
3
  end
metadata CHANGED
@@ -1,20 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conlang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-06 00:00:00.000000000 Z
11
+ date: 2013-07-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'This gem takes constructed grammar and phonemes from a LANG file to
14
14
  generate random words. You can learn how to create LANG files, or explore some sample
15
15
  files, at this project''s source repository on Github: https://github.com/fluorine/ConlangWordGenerator'
16
16
  email: fluorine@github.com
17
- executables: []
17
+ executables:
18
+ - conlang
18
19
  extensions: []
19
20
  extra_rdoc_files: []
20
21
  files:
@@ -23,10 +24,10 @@ files:
23
24
  - lib/conlang/symbolset.rb
24
25
  - lib/conlang/version.rb
25
26
  - lib/conlang/wordgenerator.rb
27
+ - bin/conlang
26
28
  - CHANGELOG.md
27
29
  - LANG_FILES_DOC.md
28
30
  - README.md
29
- - TODO.md
30
31
  - LICENSE.txt
31
32
  - NOTICE.txt
32
33
  - test/test_file_maybe.lang
@@ -37,8 +38,8 @@ licenses:
37
38
  - Apache
38
39
  metadata: {}
39
40
  post_install_message: |2-
40
- Go to https://github.com/fluorine/ConlangWordGenerator to learn
41
- how to create LANG files to generate words for constructed languages.
41
+ Go to https://github.com/fluorine/ConlangWordGenerator to learn
42
+ how to create LANG files to generate words for constructed languages.
42
43
  rdoc_options: []
43
44
  require_paths:
44
45
  - lib
data/TODO.md DELETED
@@ -1,12 +0,0 @@
1
- TODO
2
- ====
3
- * Support of UTF-8 symbols
4
- * Grammatical exceptions, or replacements
5
- * More operators
6
-
7
- Implemented features
8
- ====================
9
- * Maybe(A) operator (no weight is requiered,
10
- default probability is 50)
11
- * Or(A, b) operator (no wight is requiered,
12
- default probability is 50)