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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d46409aae08052c63a25876ba5803d3b89f42a505f970dc4e757c17ab34c924c
4
- data.tar.gz: '0681d041f3e67890030a43ebcce8ed73bbc22c8bb9417ae404387b2b1c56ec22'
3
+ metadata.gz: 30ccfde98b0baa13f03916b4b2d89c774ed8119e373e23541ca8e46e87f1db06
4
+ data.tar.gz: abd5834683ef1d6e74e6decf61b7c3155a0cf1ef5fd03a4592acb43abd2e7446
5
5
  SHA512:
6
- metadata.gz: 971924929afa5eb9fc5bfc8664483fca5ec08f7b4cf2772117af283c709442634b816029e3ff35c1e0ebf7a4dea1b0af0f88c4d4f4146c9b0c065358362967e0
7
- data.tar.gz: 2bc8ae446064e224a68d6f0f654a740165c41b9691eabd5fea77d72b8e67de6f12e174000690e1fd1542333fc8b2e7a9da9252d25d5d8322909f3890a6e61c73
6
+ metadata.gz: '040408ad8434aaa992df6533dd66954c85c389cfe76130ca188c2008c1592a758e315c0036929e9064b48d3d49bcf18fdf902455f1a7fdd0522da91d76d6085e'
7
+ data.tar.gz: ec2721ba15cb25ec6aff042a5c1c3697b557d1dab85e6c61a2cc242b5be87c6af815e1e685b335e21e7da98b0ebe4156cc39444057141e8fb8521231b2444d7e
@@ -1,5 +1,4 @@
1
1
  language: ruby
2
2
  script: bundle exec rspec
3
3
  rvm:
4
- - 2.3.3
5
- - 2.4.0
4
+ - 2.7.0
@@ -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
- # NOTE: classify will strip plurality, so we restore it if necessary
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
- plural = named.name.pluralize == named.name
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
- # NOTE: classify will strip plurality, so we restore it if necessary
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)
@@ -12,7 +12,11 @@ grammar XdrUnionGrammar
12
12
  rule union_body
13
13
  "switch"
14
14
  space?
15
- "(" discriminant:declaration ")"
15
+ "("
16
+ space?
17
+ discriminant:declaration
18
+ space?
19
+ ")"
16
20
  space?
17
21
  "{"
18
22
  space?
@@ -1,3 +1,3 @@
1
1
  module Xdrgen
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -8,3 +8,14 @@ union MyUnion switch (UnionKey type)
8
8
 
9
9
 
10
10
  };
11
+
12
+ union SomeVeryLongUnionNamePushingSwitchParamToNewLine switch (
13
+ SomeLongUnionKeyType type)
14
+ {
15
+ case ERROR:
16
+ Error error;
17
+ case MULTI:
18
+ Multi things<>;
19
+ default:
20
+ void;
21
+ };
@@ -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", "~> 5"
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", "~> 1.7"
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.1
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-01-23 00:00:00.000000000 Z
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: '5'
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: '5'
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: '1.7'
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: '1.7'
82
+ version: '2'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement