jsobfu 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmYzNDQzNTA3YzQ3NGMwMDY1YzViYTkxOGYzYzVmM2Q5MzI5OGRlOA==
4
+ YmUxZDBhNjdkODI2MTY1N2QxMjQzNmNiOGExYTBlODA0NzEwZmNhMQ==
5
5
  data.tar.gz: !binary |-
6
- MWM3MDA4ZDg3MmY2ZDE2MWMzODcyMzY3Y2YzMTdhNzY3MWQ4Njk3Mw==
6
+ OGNlMzY5NGRhOTJlYmY0NTMzNTg4MzI4NzhlMjg4OGQ4MmVlODRkOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjdkNDdjYjQ1ODliNmYwMTY5MTAxYzQyOTE0M2IzZWIxYzI2OGE0YTU2ZTQx
10
- ZDY2M2E2MDc4MTBlMGVhZmU1ZmQ5NzFlZTc1NjAxZjVjOWQ5ODFhMGMxMDdl
11
- MTM5ODIyZWU1YzQ4OGE1ZmM1MGQ0ZTJjMzc4NGE4MTQ1YWExMjU=
9
+ NDI1ODA1ODRhOWY3ZTNiZjU0MDc4ZDkyY2VlZmM3ZWM2MmQ3YTUwMmM4MmQz
10
+ ZjM5NDc3ODc2MTJmZDRjZTQzN2Q5NmQ3ZDZhMTc4ZGJlOGQ3NTQzM2JmNzUz
11
+ Y2M3NDkyZDI5M2I5OGRkYjMzZGVhZTlhODg5ODIwYzhmZTZkMDU=
12
12
  data.tar.gz: !binary |-
13
- NDhiYzNjMzliYmI1ZjZlMzZkYTk4NjBlNzM2NjQ1M2FkZTM0NTM2YTY5ODFj
14
- MmYxMmRlZDIwNDFhYzYwMTYyZTRkYjQ1NDIzM2YzYzY4OWRjZjcwM2MxZjk3
15
- YWI0MTQ1MzdhMGM4OWNlMDY3OGNlM2Y1YWU5YzVkMjkzOTM5ODI=
13
+ YjJmMzA2ODMzMWI0YTYzMTNmMmVlMmZlNTNjY2E1YTE3YWQxZDYwMDM3MjQy
14
+ NWYxZjNkYjFhYTBhZmNlMzE0YjAxMTQ5ZTliNzQ1NTRlODYxNGRlNzliMWJh
15
+ YzY1YjdmOTE1NTJiNTBhMjlmZTI3ODYwNTVhOTMyYzVhYTU4ZGU=
data/lib/jsobfu.rb CHANGED
@@ -88,7 +88,7 @@ class JSObfu
88
88
  # @param [String] sym the name of the variable or function
89
89
  # @return [String] the obfuscated name
90
90
  def sym(sym)
91
- raise RuntimeError, "Must obfuscate before calling #sym" if @renames.nil?
91
+ return sym.to_s if @renames.nil?
92
92
  @renames[sym.to_s]
93
93
  end
94
94
 
@@ -8,12 +8,13 @@ module JSObfu::Disable
8
8
  @@lock = Mutex.new
9
9
  @@disabled = false
10
10
 
11
- # Disables obfuscation globally, useful for unit tests etc
11
+ # Globally enable or disable obfuscation, useful for unit tests etc
12
+ # @param val [Boolean] the global obfuscation state to set
12
13
  def disabled=(val)
13
14
  @@lock.synchronize { @@disabled = val }
14
15
  end
15
16
 
16
- # Disables obfuscation globally, useful for unit tests etc
17
+ # @return [Boolean] obfuscation is globally disabled
17
18
  def disabled?
18
19
  @@disabled
19
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsobfu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Lee