citrus 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ = 3.0.0 / 2014-03-14
2
+
3
+ * Moved Object#grammar to citrus/core_ext.rb. Citrus no longer installs core
4
+ extensions by default. Use "require 'citrus/core_ext.rb'" instead of
5
+ "require 'citrus'" to keep the previous behavior.
6
+
1
7
  = 2.5.0 / 2014-03-13
2
8
 
3
9
  * Inputs may be generated from many different sources, including Pathname and
@@ -0,0 +1,19 @@
1
+ require 'citrus'
2
+ class Object
3
+ # A sugar method for creating Citrus grammars from any namespace.
4
+ #
5
+ # grammar :Calc do
6
+ # end
7
+ #
8
+ # module MyModule
9
+ # grammar :Calc do
10
+ # end
11
+ # end
12
+ #
13
+ def grammar(name, &block)
14
+ namespace = respond_to?(:const_set) ? self : Object
15
+ namespace.const_set(name, Citrus::Grammar.new(&block))
16
+ rescue NameError
17
+ raise ArgumentError, "Invalid grammar name: #{name}"
18
+ end
19
+ end
@@ -1,6 +1,6 @@
1
1
  module Citrus
2
2
  # The current version of Citrus as [major, minor, patch].
3
- VERSION = [2, 5, 0]
3
+ VERSION = [3, 0, 0]
4
4
 
5
5
  # Returns the current version of Citrus as a string.
6
6
  def self.version
data/lib/citrus.rb CHANGED
@@ -1556,23 +1556,3 @@ module Citrus
1556
1556
  end
1557
1557
  end
1558
1558
  end
1559
-
1560
- class Object
1561
- # A sugar method for creating Citrus grammars from any namespace.
1562
- #
1563
- # grammar :Calc do
1564
- # end
1565
- #
1566
- # module MyModule
1567
- # grammar :Calc do
1568
- # end
1569
- # end
1570
- #
1571
- def grammar(name, &block)
1572
- warn("Object#grammar will no longer be available by default in citrus 3.0; You should require 'citrus/core_ext'.")
1573
- namespace = respond_to?(:const_set) ? self : Object
1574
- namespace.const_set(name, Citrus::Grammar.new(&block))
1575
- rescue NameError
1576
- raise ArgumentError, "Invalid grammar name: #{name}"
1577
- end
1578
- end
data/test/helper.rb CHANGED
@@ -2,7 +2,7 @@ lib = File.expand_path('../../lib', __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  require 'test/unit'
5
- require 'citrus'
5
+ require 'citrus/core_ext'
6
6
 
7
7
  class Test::Unit::TestCase
8
8
  include Citrus
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citrus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -46,6 +46,7 @@ files:
46
46
  - doc/links.markdown
47
47
  - doc/syntax.markdown
48
48
  - doc/testing.markdown
49
+ - lib/citrus/core_ext.rb
49
50
  - lib/citrus/file.rb
50
51
  - lib/citrus/grammars.rb
51
52
  - lib/citrus/version.rb