rtext 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -2,3 +2,7 @@
2
2
 
3
3
  * First public release
4
4
 
5
+ =0.2.1
6
+
7
+ * Fixed serialization of enum literals starting with a digit
8
+
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ DocFiles = [
8
8
 
9
9
  RTextGemSpec = Gem::Specification.new do |s|
10
10
  s.name = %q{rtext}
11
- s.version = "0.2.0"
11
+ s.version = "0.2.1"
12
12
  s.date = Time.now.strftime("%Y-%m-%d")
13
13
  s.summary = %q{Ruby Textual Modelling}
14
14
  s.email = %q{martin dot thiede at gmx de}
@@ -132,7 +132,7 @@ class Serializer
132
132
  result << v.to_s
133
133
  end
134
134
  elsif feature.eType.is_a?(RGen::ECore::EEnum)
135
- if v.to_s =~ /\W/
135
+ if v.to_s =~ /^\d|\W/
136
136
  result << "\"#{v.to_s.gsub("\\","\\\\\\\\").gsub("\"","\\\"").gsub("\n","\\n").
137
137
  gsub("\r","\\r").gsub("\t","\\t").gsub("\f","\\f").gsub("\b","\\b")}\""
138
138
  else
@@ -12,7 +12,7 @@ class RTextInstantiatorTest < Test::Unit::TestCase
12
12
  module TestMM
13
13
  extend RGen::MetamodelBuilder::ModuleExtension
14
14
  class TestNode < RGen::MetamodelBuilder::MMBase
15
- SomeEnum = RGen::MetamodelBuilder::DataTypes::Enum.new([:A, :B, :'non-word*chars'])
15
+ SomeEnum = RGen::MetamodelBuilder::DataTypes::Enum.new([:A, :B, :'non-word*chars', :'2you'])
16
16
  has_attr 'text', String
17
17
  has_attr 'integer', Integer
18
18
  has_attr 'boolean', Boolean
@@ -859,10 +859,11 @@ class RTextInstantiatorTest < Test::Unit::TestCase
859
859
  TestNode enum: A
860
860
  TestNode enum: B
861
861
  TestNode enum: "non-word*chars"
862
+ TestNode enum: "2you"
862
863
  }
863
864
  ), TestMM)
864
865
  assert_no_problems(problems)
865
- assert_equal [:A, :B, :'non-word*chars'], env.find(:text => "root").first.childs.collect{|c| c.enum}
866
+ assert_equal [:A, :B, :'non-word*chars', :'2you'], env.find(:text => "root").first.childs.collect{|c| c.enum}
866
867
  end
867
868
 
868
869
  #
@@ -15,7 +15,7 @@ class RTextSerializerTest < Test::Unit::TestCase
15
15
  module TestMM
16
16
  extend RGen::MetamodelBuilder::ModuleExtension
17
17
  SomeEnum = RGen::MetamodelBuilder::DataTypes::Enum.new(
18
- :name => "SomeEnum", :literals => [:A, :B, :'non-word*chars'])
18
+ :name => "SomeEnum", :literals => [:A, :B, :'non-word*chars', :'2you'])
19
19
  class TestNode < RGen::MetamodelBuilder::MMBase
20
20
  has_attr 'text', String
21
21
  has_attr 'integer', Integer
@@ -352,7 +352,8 @@ TestNode {
352
352
  testModel = [
353
353
  TestMM::TestNode.new(:enum => :A),
354
354
  TestMM::TestNode.new(:enum => :B),
355
- TestMM::TestNode.new(:enum => :'non-word*chars')
355
+ TestMM::TestNode.new(:enum => :'non-word*chars'),
356
+ TestMM::TestNode.new(:enum => :'2you')
356
357
  ]
357
358
  output = StringWriter.new
358
359
  serialize(testModel, TestMM, output)
@@ -360,6 +361,7 @@ TestNode {
360
361
  TestNode enum: A
361
362
  TestNode enum: B
362
363
  TestNode enum: "non-word*chars"
364
+ TestNode enum: "2you"
363
365
  ), output
364
366
  end
365
367
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-30 00:00:00.000000000Z
12
+ date: 2012-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rgen
16
- requirement: &24349776 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: 0.6.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *24349776
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.6.0
25
30
  description: RText can be used to derive textual languages from an RGen metamodel
26
31
  with very little effort.
27
32
  email: martin dot thiede at gmx de
@@ -77,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
82
  version: '0'
78
83
  requirements: []
79
84
  rubyforge_project:
80
- rubygems_version: 1.7.2
85
+ rubygems_version: 1.8.23
81
86
  signing_key:
82
87
  specification_version: 3
83
88
  summary: Ruby Textual Modelling