ryan 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ryan/const.rb +9 -4
- data/lib/ryan/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 527a6c434d9f082c3151c2c59d4e2462424dadbb819288d8cf03b66e9feae455
|
4
|
+
data.tar.gz: c4ce5bb3e7cd2d307778946c81b65ef099815f95a21850d7e993ccba17e2832f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94faf3d9f4818a97659c0ab800ca3701e04c574f85d61eb93d1cd54e73e65ea6cddf528ac7231829c8eb7dd3cea61812a72895b025553098e9636744501ef3c0
|
7
|
+
data.tar.gz: 02b5b4f29eb55e5b5d5ac2e69cc676fa366140d1bab727cef77446d790dbba03da7d0e5e19b3bc5fa1b58a8a82f74dc4ce5814a226108b99169b84ad46a44f03
|
data/lib/ryan/const.rb
CHANGED
@@ -1,14 +1,19 @@
|
|
1
1
|
class Ryan::Const
|
2
2
|
CLASS_MOD_DEFS = { class: :class, module: :module }
|
3
|
-
CONSTANT_DEFS
|
4
|
-
PRIVATE_DEFS
|
3
|
+
CONSTANT_DEFS = { cdecl: :class }.merge CLASS_MOD_DEFS
|
4
|
+
PRIVATE_DEFS = [:private, :protected]
|
5
5
|
|
6
6
|
attr_reader :sexp
|
7
7
|
|
8
8
|
# @param [Sexp] sexp
|
9
9
|
def initialize(sexp)
|
10
|
-
|
11
|
-
|
10
|
+
if sexp[0] == :block
|
11
|
+
# This is common when the file ha require or other code at the top before the class def,
|
12
|
+
# in which case, grab the last element of the block and assume that's the class def.
|
13
|
+
@sexp = sexp[sexp.size - 1]
|
14
|
+
else
|
15
|
+
@sexp = sexp
|
16
|
+
end
|
12
17
|
end
|
13
18
|
|
14
19
|
# @description Extracts the class/mod definition from a Sexp object. Handles stuff that looks like:
|
data/lib/ryan/version.rb
CHANGED