rpxem 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/bin/rpxem CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  if (!ARGV[0] || /^-/ =~ ARGV[0] && !File.exist?(ARGV[0]))
4
4
  require 'rpxem/version'
5
- puts "RPxem (#{RPxem::VERSION}) https://github.com/wtkt/rpxem"
5
+ puts "RPxem (#{RPxem::VERSION}) https://github.com/wktk/rpxem"
6
6
  puts 'Usage: rpxem path-to-pxem-file.pxe'
7
7
  puts 'Report bugs to <https://github.com/wktk/rpxem/issues>.'
8
8
  elsif (!File.exist?(ARGV[0]) || !source = open(ARGV[0]).read)
data/lib/rpxem/stack.rb CHANGED
@@ -38,9 +38,11 @@ module RPxem
38
38
  private
39
39
  def simple_check(*args)
40
40
  args.each do |arg|
41
- raise ArgumentError.new 'Argument must be Fixnum' if (arg.class != Fixnum)
42
- raise ArgumentError.new 'Argument must be positive' if (arg != arg.abs)
43
- raise ArgumentError.new 'Argument must be integer' if (!arg.integer?)
41
+ if (!arg.is_a? Integer)
42
+ raise ArgumentError.new 'Argument must be Integer'
43
+ elsif (arg != arg.abs)
44
+ raise ArgumentError.new 'Argument must be positive'
45
+ end
44
46
  end
45
47
  end
46
48
  end
data/lib/rpxem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RPxem
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
data/spec/rpxem_spec.rb CHANGED
@@ -16,10 +16,6 @@ describe RPxem do
16
16
  @stack = RPxem::Stack.new
17
17
  end
18
18
 
19
- it 'should be Fixnum' do
20
- expect{ @stack.push('a') }.to raise_error ArgumentError
21
- end
22
-
23
19
  it 'should be positive' do
24
20
  expect{ @stack.push(-1) }.to raise_error ArgumentError
25
21
  end
@@ -28,8 +24,13 @@ describe RPxem do
28
24
  expect{ @stack.push(0) }.not_to raise_error
29
25
  end
30
26
 
27
+ it 'can be Bignum' do
28
+ expect{ @stack.push(13**13) }.not_to raise_error
29
+ end
30
+
31
31
  it 'should be integer' do
32
- expect{ @stack.unshift(0.1) }.to raise_error ArgumentError
32
+ expect{ @stack << 'a' }.to raise_error ArgumentError
33
+ expect{ @stack << 0.1 }.to raise_error ArgumentError
33
34
  end
34
35
 
35
36
  it 'can check in #new' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpxem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-03 00:00:00.000000000 Z
12
+ date: 2012-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec