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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b27b330b1dbb7aafbe79a37e1c8ad052862abd043cb9ce66176b0395faa21705
4
- data.tar.gz: 1f5a038be755ed3b63cbc78e64d2ff3558ca9e3685afb8aa714a45b118634b3b
3
+ metadata.gz: 527a6c434d9f082c3151c2c59d4e2462424dadbb819288d8cf03b66e9feae455
4
+ data.tar.gz: c4ce5bb3e7cd2d307778946c81b65ef099815f95a21850d7e993ccba17e2832f
5
5
  SHA512:
6
- metadata.gz: 2d17d1ae82693a889ecc6f7df6066b1bc84ea1de150b12642777cb360883c62f9ad0558151be1482629e100f3e316914650ac117348adbd7c5277b8817b97f7b
7
- data.tar.gz: c46e36144fba9cdec4432192c3d392d16ffcd55d28f0f2cd09d0cb8eed759aaaef6099ee92ba4aa10b3821eb5eb4b1e9bdb259c0ae09ca7b2445cdad258d8426
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 = { cdecl: :class }.merge CLASS_MOD_DEFS
4
- PRIVATE_DEFS = [:private, :protected]
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
- sexp = sexp[2] if sexp[0] == :block
11
- @sexp = sexp
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
@@ -1,3 +1,3 @@
1
1
  class Ryan
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ryan
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley