calyx 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7beefadeb8e2f98a6c802a85dec4fb2ee9a81de
4
- data.tar.gz: aeeb4015155d4ea728f0289fff21488fda88d37d
3
+ metadata.gz: 27169df4f2bd509b5032e94a52faf2a66caac896
4
+ data.tar.gz: de708f687c780fb782d9dee7857afabc1fd64e92
5
5
  SHA512:
6
- metadata.gz: ee1a4994645a80f6ceef3824f348653a9ac44eee32f127db31f457c4ca57c5e5ff26b5228109ba6f407d5ca7c3761d1632b3adcdfb65dd165e8b18d0d1dac24b
7
- data.tar.gz: 3cd0f9955a377a9e97d4f62b1b2e2b5f256af0dd33089de81fa95d938f29633e0c771ba71d9fd581ed23f310d8edc29c18f4ad3b43b953fbeb905cf2ca100ac0
6
+ metadata.gz: 9a4a39f5d884dbec68f98dd861196b877139398c95549a3c01892c199f26e698680d028128fe6a009192851dba2be636ada636aec2a3b5acac3409b73c8c0e92
7
+ data.tar.gz: 3a31249994903e00bb8ec895eed7929a7343e1736e5d2750d400ed69a4980ff6be7f5b100ff051ceb64820a5f51295729debc9a0bc0d87b514b8eaafcbfa0318
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ rvm:
3
3
  - 2.1
4
4
  - 2.2
5
5
  - 2.3.1
6
- - 2.4.0-preview1
6
+ - 2.4.1
7
7
  - ruby-head
8
8
  - jruby-9
9
9
  before_install: gem install bundler -v 1.10.6
data/README.md CHANGED
@@ -333,12 +333,14 @@ end
333
333
 
334
334
  ### Modifier Mixins
335
335
 
336
- In order to use more intricate natural language processing capabilities, you can add modifier methods to a module and extend the grammar with it:
336
+ In order to use more intricate rewriting and formatting methods in a modifier chain, you can add methods to a module and embed it in a grammar using the `modifier` classmethod.
337
+
338
+ Modifier methods accept a single argument representing the input string from the previous step in the expression chain and must return a string, representing the modified output.
337
339
 
338
340
  ```ruby
339
341
  module FullStop
340
- def full_stop
341
- self << '.'
342
+ def full_stop(input)
343
+ input << '.'
342
344
  end
343
345
  end
344
346
 
@@ -355,8 +357,8 @@ To share custom modifiers across multiple grammars, you can include the module i
355
357
 
356
358
  ```ruby
357
359
  module FullStop
358
- def full_stop
359
- self << '.'
360
+ def full_stop(input)
361
+ input << '.'
360
362
  end
361
363
  end
362
364
 
@@ -12,7 +12,7 @@ module Calyx
12
12
  choices = productions.map do |choice|
13
13
  if choice.is_a?(String)
14
14
  Concat.parse(choice, registry)
15
- elsif choice.is_a?(Fixnum)
15
+ elsif choice.is_a?(Integer)
16
16
  Terminal.new(choice.to_s)
17
17
  elsif choice.is_a?(Symbol)
18
18
  if choice[0] == Memo::SIGIL
data/lib/calyx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Calyx
2
- VERSION = '0.14.0'.freeze
2
+ VERSION = '0.14.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calyx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rickerby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-11 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,8 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.5.1
109
+ rubygems_version: 2.6.11
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Generate text with declarative recursive grammars
113
113
  test_files: []
114
+ has_rdoc: