the_game 0.1.0.20120111 → 0.1.0.20120112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/the_game/command.rb +12 -2
- data/lib/the_game/exception.rb +3 -2
- data/lib/the_game/game.rb +5 -2
- data/lib/the_game/item.rb +4 -0
- data/lib/the_game/license.rb +1 -7
- data/lib/the_game/version.rb +1 -1
- metadata +25 -13
data/lib/the_game/command.rb
CHANGED
@@ -35,7 +35,10 @@ class TheGame::Command
|
|
35
35
|
"Usage: set [key] [value]"
|
36
36
|
else
|
37
37
|
key = a.words.first.to_s.downcase
|
38
|
-
pretty_rescue
|
38
|
+
pretty_rescue do
|
39
|
+
g.set(key, value)
|
40
|
+
"#{key.capitalize} set to #{value.inspect}"
|
41
|
+
end
|
39
42
|
end
|
40
43
|
end
|
41
44
|
|
@@ -64,11 +67,18 @@ class TheGame::Command
|
|
64
67
|
|
65
68
|
def _game(g, a); g.inspect; end
|
66
69
|
|
70
|
+
def _items(g,a); g.items.inspect; end
|
71
|
+
|
67
72
|
def _save(g, a); pretty_rescue { g.save; "Game saved." }; end
|
68
73
|
|
69
74
|
def _read_savefile(g, a); pretty_rescue { g.read_savefile }; end
|
70
75
|
|
71
|
-
def _load(g, a)
|
76
|
+
def _load(g, a)
|
77
|
+
pretty_rescue do
|
78
|
+
g.load
|
79
|
+
"Game (name => #{g.name}, saved_at => #{g.saved_at.strftime("%F %R")}) loaded."
|
80
|
+
end
|
81
|
+
end
|
72
82
|
|
73
83
|
def _quit(g, a); exit; end
|
74
84
|
end
|
data/lib/the_game/exception.rb
CHANGED
data/lib/the_game/game.rb
CHANGED
@@ -3,7 +3,9 @@ require 'yaml'
|
|
3
3
|
require 'zlib'
|
4
4
|
|
5
5
|
class TheGame::Game
|
6
|
-
attr_accessor :name, :level
|
6
|
+
attr_accessor :name, :level, :items, :created_at, :saved_at
|
7
|
+
|
8
|
+
I = TheGame::Item
|
7
9
|
|
8
10
|
def initialize
|
9
11
|
TheGame.initialize!
|
@@ -11,6 +13,7 @@ class TheGame::Game
|
|
11
13
|
@saved_at = Time.now
|
12
14
|
@name = "anonymous"
|
13
15
|
@level = 1
|
16
|
+
@items = [I.new("Gold"), I.new("Sword"), I.new("Orb of POWAH")]
|
14
17
|
end
|
15
18
|
|
16
19
|
def yaml_dump
|
@@ -65,7 +68,7 @@ class TheGame::Game
|
|
65
68
|
rescue => e
|
66
69
|
e.pp
|
67
70
|
end
|
68
|
-
puts output unless output.blank?
|
71
|
+
puts output unless input.blank? or output.blank?
|
69
72
|
end
|
70
73
|
end
|
71
74
|
end
|
data/lib/the_game/item.rb
CHANGED
data/lib/the_game/license.rb
CHANGED
@@ -1,9 +1,3 @@
|
|
1
1
|
module TheGame
|
2
|
-
LICENSE = "the_game Copyright (C) 2012 Shigeki Kitajima
|
3
|
-
<http://shigeki.99k.org/the_game/>
|
4
|
-
|
5
|
-
This program is open source: you can redistribute it and/or modify it under the
|
6
|
-
terms of the MIT License. This program is distributed in the hope that it will
|
7
|
-
be useful, but WITHOUT ANY WARRANTY.
|
8
|
-
<http://opensource.org/licenses/MIT/>"
|
2
|
+
LICENSE = "the_game Copyright (C) 2012 Shigeki Kitajima\n\n<http://shigeki.99k.org/the_game/>\n\nThis program is open source: you can redistribute it and/or modify\nit under the terms of the MIT License. This program is distributed\nin the hope that it will be useful, but WITHOUT ANY WARRANTY.\n\n<http://opensource.org/licenses/MIT/>"
|
9
3
|
end
|
data/lib/the_game/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_game
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.20120112
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: shoulda
|
16
|
-
requirement: &
|
16
|
+
requirement: &26942860 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *26942860
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &26942380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *26942380
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &26941900 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.6.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *26941900
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rcov
|
49
|
-
requirement: &
|
49
|
+
requirement: &26941420 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,9 +54,9 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *26941420
|
58
58
|
description: the_game is a text-based game written in Ruby, but it doesn't do much
|
59
|
-
right now.
|
59
|
+
right now. Executable is the_game.
|
60
60
|
email: shigeki.kitajima@gmail.com
|
61
61
|
executables:
|
62
62
|
- the_game
|
@@ -84,7 +84,19 @@ files:
|
|
84
84
|
homepage: http://shigeki.99k.org/the_game/
|
85
85
|
licenses:
|
86
86
|
- MIT
|
87
|
-
post_install_message:
|
87
|
+
post_install_message: ! '================
|
88
|
+
|
89
|
+
the_game v0.1.0.20120112
|
90
|
+
|
91
|
+
<3<3<3<3 Thanks for installing!
|
92
|
+
|
93
|
+
|
94
|
+
Hey! This gem won''t do much until 0.2, so check back later!
|
95
|
+
|
96
|
+
|
97
|
+
(compatible with ruby >= 1.9)
|
98
|
+
|
99
|
+
================'
|
88
100
|
rdoc_options: []
|
89
101
|
require_paths:
|
90
102
|
- lib
|
@@ -96,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
108
|
version: '0'
|
97
109
|
segments:
|
98
110
|
- 0
|
99
|
-
hash:
|
111
|
+
hash: 4087692085263608672
|
100
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
113
|
none: false
|
102
114
|
requirements:
|