gameon-points 0.0.0.pre21 → 0.0.0.pre22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gameon-points/base.rb +4 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d51e4be502f2443c2a75bfa66d0af2d54cc8c71d
4
- data.tar.gz: f43f8c0cdd4ebe5249cef7a3e955efb36b620e26
3
+ metadata.gz: 26c8a889aab4a8061c68bb3de6ac8a9a7f126e34
4
+ data.tar.gz: f04555e0378f72d8ffc3cd51faae86543efdbc1b
5
5
  SHA512:
6
- metadata.gz: 0fc8b4a7d209d12f86b1d952a8207b40122967e8fbbc9f65a862164dc688d9cb0ec49595deb4c020086ad73331c69684cc2c9b60632fe6e9aa1d1dceee476027
7
- data.tar.gz: 1bc892e9a897afe898c7d378a0174a25fa4704f8825fbcaab17eec9bea3be1297b6e652f63b920b3391671526cc1ad9c487ffc26cf0965e56ed0abff0868ed3d
6
+ metadata.gz: 893a1101c95c305ff438f14aec635e77b5c2a32b8d1e3b809f5e82bf71ec4533b972ce973bf30a7b4bf9fdcd9cbd32f634b25411a769f06736e1a775b1b160a0
7
+ data.tar.gz: 5b471d252b2aa0214bf82d9c0e7a38e8e9cd22292deb51247a4a4b1970dcbc90f7df11bb5ca7842560158b8dfbf4cba00a4f41e7ae786e1b088a0fe84a88509b
@@ -2,7 +2,8 @@ GameOn::Env.register do
2
2
  @mutex = Mutex.new
3
3
  @mutex.synchronize {
4
4
  attr_accessor :points
5
- def add_points value
5
+ }
6
+ def add_points value
6
7
  if @points.nil?
7
8
  @points = value
8
9
  else
@@ -16,7 +17,6 @@ GameOn::Env.register do
16
17
  @points -= value
17
18
  end
18
19
  end
19
- }
20
20
  end
21
21
 
22
22
  module GameOn
@@ -31,12 +31,12 @@ module GameOn
31
31
 
32
32
  def call(env)
33
33
  t = Thread.new do
34
- if !@params.nil? && @params.has_key?(:add)
34
+ if !@opts.nil? && !@params.nil? && @params.has_key?(:add)
35
35
  env[:gameon].add_points(@params[:add] * @opts[:inc_by])
36
36
  #env[:gameon].points = GameOn::Env.add_points(@params[:add] * @opts[:inc_by])
37
37
  #GameOn::Env.add_points(@params[:add] * @opts[:inc_by])
38
38
  end
39
- if !@params.nil? && @params.has_key?(:remove)
39
+ if !@opts.nil? && !@params.nil? && @params.has_key?(:remove)
40
40
  env[:gameon].remove_points(@params[:remove] * @opts[:dec_by])
41
41
  end
42
42
  @app.call(env) # run the next middleware
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gameon-points
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.pre21
4
+ version: 0.0.0.pre22
5
5
  platform: ruby
6
6
  authors:
7
7
  - theotherstupidguy