smalruby 0.0.28-x86-mingw32 → 0.0.29-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of smalruby might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbd593e1b2c6ceef1851955dd57c59590556bbfd
4
- data.tar.gz: 86a88450d558dd10e9b80593f37d32def3488e25
3
+ metadata.gz: 9055cdbe4363fdb124c7bf8e901ba3660211784e
4
+ data.tar.gz: 86653734c1238b5db0a2e4738f15aeb29e96b53c
5
5
  SHA512:
6
- metadata.gz: 77d75eaef5470b25ae4ee674b86e6c1776717bac511b1712a5d25bb961288fe6d8d453a3ca5a67e02c5590699020798210ca23c4a95fe7847692cb9a712725bc
7
- data.tar.gz: 656430127324a91ea3f777fb695df73e3d36875ae1c4c223ef62764b3c775b720edfe764b7853cddb54d96997bdbb60c790b6872812d42b4a13d5bbc62a73bf8
6
+ metadata.gz: c52361b582b109c938155f9e82b0c25ca8297df7077ae1e29aab6c3d5cd6cb698997e9ed638d277519a3a3ffdbd7442ce7ffdec2282111dc632e85c62d74e175
7
+ data.tar.gz: 5116cc90b8acaf4a6e21ae879901958d5a84c9d95ea2f0c4566a904164002cb2c6ef9c2979ef03bf02d8628f4d71ae211ed24d6fa81d5ce619c1762655b38b4b
@@ -50,10 +50,7 @@ module Smalruby
50
50
  @initialized_hardware = true
51
51
  rescue Exception
52
52
  Util.print_exception($!)
53
-
54
- canvas = Canvas.new(height: 32)
55
- canvas.draw_font(string: 'ハードウェアの準備に失敗しました',
56
- color: 'red')
53
+ @failed_init_hardware = true
57
54
  end
58
55
  end
59
56
 
@@ -67,6 +64,11 @@ module Smalruby
67
64
  end
68
65
  end
69
66
 
67
+ # ハードウェアの初期化に失敗したかどうかを返す
68
+ def failed?
69
+ @failed_init_hardware
70
+ end
71
+
70
72
  # ハードウェアのインスタンスを生成する
71
73
  #
72
74
  # 作成したハードウェアのインスタンスはキャッシュする
@@ -86,6 +88,7 @@ module Smalruby
86
88
  private
87
89
 
88
90
  @initialized_hardware = false
91
+ @failed_init_hardware = false
89
92
  @hardware_cache = {}
90
93
  @hardware_cache.extend(Mutex_m)
91
94
  end
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module Smalruby
4
- VERSION = '0.0.28'
4
+ VERSION = '0.0.29'
5
5
  end
data/lib/smalruby.rb CHANGED
@@ -126,6 +126,11 @@ module Smalruby
126
126
  unless world.objects.any? { |o| o.is_a?(Stage) }
127
127
  Stage.new(color: 'white') unless Util.raspberrypi?
128
128
  end
129
+ if Hardware.failed?
130
+ canvas = Canvas.new(height: 32)
131
+ canvas.draw_font(string: 'ハードウェアの準備に失敗しました',
132
+ color: 'red')
133
+ end
129
134
  world.objects.each do |object|
130
135
  object.start
131
136
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smalruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.29
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Kouji Takao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-18 00:00:00.000000000 Z
11
+ date: 2014-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler