xdrgen 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/lib/xdrgen/generators/elixir.rb +2 -5
- data/lib/xdrgen/generators/javascript.rb +10 -5
- data/lib/xdrgen/grammar/union.treetop +5 -1
- data/lib/xdrgen/version.rb +1 -1
- data/spec/fixtures/parser/union.x +11 -0
- data/xdrgen.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30ccfde98b0baa13f03916b4b2d89c774ed8119e373e23541ca8e46e87f1db06
|
4
|
+
data.tar.gz: abd5834683ef1d6e74e6decf61b7c3155a0cf1ef5fd03a4592acb43abd2e7446
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '040408ad8434aaa992df6533dd66954c85c389cfe76130ca188c2008c1592a758e315c0036929e9064b48d3d49bcf18fdf902455f1a7fdd0522da91d76d6085e'
|
7
|
+
data.tar.gz: ec2721ba15cb25ec6aff042a5c1c3697b557d1dab85e6c61a2cc242b5be87c6af815e1e685b335e21e7da98b0ebe4156cc39444057141e8fb8521231b2444d7e
|
data/.travis.yml
CHANGED
@@ -164,7 +164,7 @@ module Xdrgen
|
|
164
164
|
parent = name named.parent_defn if named.is_a?(AST::Concerns::NestedDefinition)
|
165
165
|
|
166
166
|
# NOTE: classify will strip plurality, so we restore it if necessary
|
167
|
-
plural = named.name.pluralize == named.name
|
167
|
+
plural = named.name.downcase.pluralize == named.name.downcase
|
168
168
|
base = named.name.underscore.classify
|
169
169
|
result = plural ? base.pluralize : base
|
170
170
|
|
@@ -172,10 +172,7 @@ module Xdrgen
|
|
172
172
|
end
|
173
173
|
|
174
174
|
def const_name(named)
|
175
|
-
|
176
|
-
plural = named.name.pluralize == named.name
|
177
|
-
base = named.name.underscore.upcase
|
178
|
-
plural ? base.pluralize : base
|
175
|
+
named.name.underscore.upcase
|
179
176
|
end
|
180
177
|
|
181
178
|
def member_name(member)
|
@@ -170,7 +170,15 @@ module Xdrgen
|
|
170
170
|
parent = name named.parent_defn if named.is_a?(AST::Concerns::NestedDefinition)
|
171
171
|
|
172
172
|
# NOTE: classify will strip plurality, so we restore it if necessary
|
173
|
-
|
173
|
+
#
|
174
|
+
# Downcase the value since pluralize adds a lower case `s`.
|
175
|
+
#
|
176
|
+
# Without downcasing, the following appears as singular, but it's plural:
|
177
|
+
#
|
178
|
+
# "BEGIN_SPONSORING_FUTURE_RESERVEs" == "BEGIN_SPONSORING_FUTURE_RESERVES"
|
179
|
+
# => false
|
180
|
+
#
|
181
|
+
plural = named.name.downcase.pluralize == named.name.downcase
|
174
182
|
base = named.name.underscore.classify
|
175
183
|
result = plural ? base.pluralize : base
|
176
184
|
|
@@ -178,10 +186,7 @@ module Xdrgen
|
|
178
186
|
end
|
179
187
|
|
180
188
|
def const_name(named)
|
181
|
-
|
182
|
-
plural = named.name.pluralize == named.name
|
183
|
-
base = named.name.underscore.upcase
|
184
|
-
plural ? base.pluralize : base
|
189
|
+
named.name.underscore.upcase
|
185
190
|
end
|
186
191
|
|
187
192
|
def member_name(member)
|
data/lib/xdrgen/version.rb
CHANGED
data/xdrgen.gemspec
CHANGED
@@ -20,11 +20,11 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.required_ruby_version = '>= 2.1.0'
|
21
21
|
|
22
22
|
spec.add_dependency "treetop", "~> 1.5.3"
|
23
|
-
spec.add_dependency "activesupport", "~>
|
23
|
+
spec.add_dependency "activesupport", "~> 6"
|
24
24
|
spec.add_dependency "slop", "~> 3.4"
|
25
25
|
spec.add_dependency "memoist", "~> 0.11.0"
|
26
26
|
|
27
|
-
spec.add_development_dependency "bundler", "~>
|
27
|
+
spec.add_development_dependency "bundler", "~> 2"
|
28
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
29
29
|
spec.add_development_dependency "rspec", "~> 3.1"
|
30
30
|
spec.add_development_dependency "guard-rspec"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xdrgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Fleckenstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '6'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: slop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|