gameon-points 0.0.0.pre19 → 0.0.0.pre20

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 +11 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d17b695e6711f1f6a6a106d2c468cda5d246f576
4
- data.tar.gz: 47940971f56fa7827f4e0b8b0c38b6adf4212131
3
+ metadata.gz: 562527a8f208a582a9d05fcd80901b646e0522d5
4
+ data.tar.gz: 0595abd90fd8c9f4271394100b0bffb3aea7f5c4
5
5
  SHA512:
6
- metadata.gz: ebde8e71c55e4db93aa775d175c342d8d401cc9691b1e79c3b7265b823bf7c07429ea968b196a4c325b01c708b9818856f1adb6b8abd4fcba60996fed703d21b
7
- data.tar.gz: 40123436f34009ff4a644b55f4cb55872909a63f8db4868a944e4de32f19715cfbcafd9d00bbda61a3e576cc17a5265a273b120df5ff28cb1dc3ca97b18d089b
6
+ metadata.gz: 5d80da33ec9740a84fcadf74fb2f3f4d057fc4cb7ae761eb160e8c4d18b6857607f7c45d632c55ef823e00bfe6a0a3d3459a0bffa56d54a1a6afca555d6083aa
7
+ data.tar.gz: 74f32919e4f9ceec0bb32bc5c2a5c0499f62ed9528097d7a44d6a31367b8be4555d198bd52ddd4d82081fc722c445226ac48d9fbe0178c96c5fe3b67efb24c7d
@@ -11,10 +11,8 @@ GameOn::Env.register do
11
11
  end
12
12
  def remove_points value
13
13
  if @points.nil?
14
- p "- value"
15
14
  @points = -value
16
15
  else
17
- p "- points"
18
16
  @points -= value
19
17
  end
20
18
  end
@@ -32,15 +30,18 @@ module GameOn
32
30
  end
33
31
 
34
32
  def call(env)
35
- if !@params.nil? && @params.has_key?(:add)
36
- env[:gameon].add_points(@params[:add] * @opts[:inc_by])
37
- #env[:gameon].points = GameOn::Env.add_points(@params[:add] * @opts[:inc_by])
38
- #GameOn::Env.add_points(@params[:add] * @opts[:inc_by])
33
+ t = Thread.new do
34
+ if !@params.nil? && @params.has_key?(:add)
35
+ env[:gameon].add_points(@params[:add] * @opts[:inc_by])
36
+ #env[:gameon].points = GameOn::Env.add_points(@params[:add] * @opts[:inc_by])
37
+ #GameOn::Env.add_points(@params[:add] * @opts[:inc_by])
38
+ end
39
+ if !@params.nil? && @params.has_key?(:remove)
40
+ env[:gameon].remove_points(@params[:remove] * @opts[:dec_by])
41
+ end
42
+ @app.call(env) # run the next middleware
39
43
  end
40
- if !@params.nil? && @params.has_key?(:remove)
41
- env[:gameon].remove_points(@params[:remove] * @opts[:dec_by])
42
- end
43
- @app.call(env) # run the next middleware
44
+ t.join
44
45
  end
45
46
  end
46
47
  end
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.pre19
4
+ version: 0.0.0.pre20
5
5
  platform: ruby
6
6
  authors:
7
7
  - theotherstupidguy