pario 0.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.rdoc +41 -0
- data/bin/pario +5 -0
- data/lib/pario/version.rb +11 -0
- data/lib/pario.rb +125 -0
- data/pario.gemspec +26 -0
- metadata +93 -0
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/README.rdoc
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
== Welcome to Pario
|
2
|
+
|
3
|
+
Pario is a Gosu Game framework that helps to give you structure and a start for creating games.
|
4
|
+
|
5
|
+
== Installation
|
6
|
+
|
7
|
+
sudo gem install pario
|
8
|
+
|
9
|
+
== Getting Started
|
10
|
+
|
11
|
+
1. At the command prompt, create a new Pario application:
|
12
|
+
|
13
|
+
pario new my_game
|
14
|
+
|
15
|
+
where myapp is the game name.
|
16
|
+
|
17
|
+
2. Change the directory to myapp and start the game:
|
18
|
+
|
19
|
+
pario play
|
20
|
+
|
21
|
+
3. To create more classes for your game (which will appear in the game folder):
|
22
|
+
|
23
|
+
pario create my_class
|
24
|
+
|
25
|
+
where my_class is the name of your class.
|
26
|
+
|
27
|
+
4. ADVANCED: You may also want to create many classes(files) and relate them.
|
28
|
+
Pario will not create subfolders, rather, it will auto-generate the code inside and properly relate them.
|
29
|
+
** NOTE: This can be done manually, which means you'll need to create the files and add
|
30
|
+
the appropriate 'require' statements. Pario simplifies this for you.
|
31
|
+
|
32
|
+
pario create my_class menu background
|
33
|
+
|
34
|
+
== Learning Ruby
|
35
|
+
|
36
|
+
* {Ruby4kids:} [link:http://www.ruby4kids.com]
|
37
|
+
* {HacketyHack:} [link:http://hackety-hack.com]
|
38
|
+
* {Learn to Program:} [link:http://pine.fm/LearnToProgram]
|
39
|
+
|
40
|
+
These resources will bring you up to speed on the Ruby language and also on
|
41
|
+
programming in general.
|
data/bin/pario
ADDED
data/lib/pario.rb
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'rdoc/usage'
|
3
|
+
require 'ostruct'
|
4
|
+
require 'date'
|
5
|
+
|
6
|
+
|
7
|
+
class Pario
|
8
|
+
VERSION = '0.0.1'
|
9
|
+
|
10
|
+
attr_reader :options
|
11
|
+
|
12
|
+
def initialize(arguments, stdin)
|
13
|
+
@arguments = arguments
|
14
|
+
@stdin = stdin
|
15
|
+
|
16
|
+
# Set defaults
|
17
|
+
@options = OpenStruct.new
|
18
|
+
@options.verbose = false
|
19
|
+
@options.quiet = false
|
20
|
+
# TO DO - add additional defaults
|
21
|
+
end
|
22
|
+
|
23
|
+
# Parse options, check arguments, then process the command
|
24
|
+
def run
|
25
|
+
|
26
|
+
if parsed_options? && arguments_valid?
|
27
|
+
|
28
|
+
puts "Start at #{DateTime.now}\
|
29
|
+
\
|
30
|
+
" if @options.verbose
|
31
|
+
|
32
|
+
output_options if @options.verbose # [Optional]
|
33
|
+
|
34
|
+
process_arguments
|
35
|
+
process_command
|
36
|
+
|
37
|
+
puts "\
|
38
|
+
Finished at #{DateTime.now}" if @options.verbose
|
39
|
+
|
40
|
+
else
|
41
|
+
output_usage
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
48
|
+
def parsed_options?
|
49
|
+
|
50
|
+
# Specify options
|
51
|
+
opts = OptionParser.new
|
52
|
+
opts.on('-v', '--version') { output_version ; exit 0 }
|
53
|
+
opts.on('-h', '--help') { output_help }
|
54
|
+
opts.on('-V', '--verbose') { @options.verbose = true }
|
55
|
+
opts.on('-q', '--quiet') { @options.quiet = true }
|
56
|
+
# TO DO - add additional options
|
57
|
+
|
58
|
+
opts.parse!(@arguments) rescue return false
|
59
|
+
|
60
|
+
process_options
|
61
|
+
true
|
62
|
+
end
|
63
|
+
|
64
|
+
# Performs post-parse processing on options
|
65
|
+
def process_options
|
66
|
+
@options.verbose = false if @options.quiet
|
67
|
+
end
|
68
|
+
|
69
|
+
def output_options
|
70
|
+
puts "Options:\
|
71
|
+
"
|
72
|
+
|
73
|
+
@options.marshal_dump.each do |name, val|
|
74
|
+
puts " #{name} = #{val}"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# True if required arguments were provided
|
79
|
+
def arguments_valid?
|
80
|
+
# TO DO - implement your real logic here
|
81
|
+
true if @arguments.length == 1
|
82
|
+
end
|
83
|
+
|
84
|
+
# Setup the arguments
|
85
|
+
def process_arguments
|
86
|
+
# TO DO - place in local vars, etc
|
87
|
+
end
|
88
|
+
|
89
|
+
def output_help
|
90
|
+
output_version
|
91
|
+
RDoc::usage() #exits app
|
92
|
+
end
|
93
|
+
|
94
|
+
def output_usage
|
95
|
+
RDoc::usage('usage') # gets usage from comments above
|
96
|
+
end
|
97
|
+
|
98
|
+
def output_version
|
99
|
+
puts "#{File.basename(__FILE__)} version #{VERSION}"
|
100
|
+
end
|
101
|
+
|
102
|
+
def process_command
|
103
|
+
# TO DO - do whatever this app does
|
104
|
+
|
105
|
+
#process_standard_input # [Optional]
|
106
|
+
end
|
107
|
+
|
108
|
+
def process_standard_input
|
109
|
+
input = @stdin.read
|
110
|
+
# TO DO - process input
|
111
|
+
|
112
|
+
# [Optional]
|
113
|
+
# @stdin.each do |line|
|
114
|
+
# # TO DO - process each line
|
115
|
+
#end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
# TO DO - Add your Modules, Classes, etc
|
121
|
+
|
122
|
+
|
123
|
+
# Create and run the application
|
124
|
+
app = Pario.new(ARGV, STDIN)
|
125
|
+
app.run
|
data/pario.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
pario_path = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(pario_path) unless $LOAD_PATH.include?(pario_path)
|
5
|
+
require 'pario/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'pario'
|
9
|
+
s.version = Pario::Version::STRING
|
10
|
+
s.platform = Gem::Platform::RUBY
|
11
|
+
s.authors = ['Bill Davenport', 'Anthony Burns']
|
12
|
+
s.email = ['bill@infoether.com', 'anthony@infoether.com']
|
13
|
+
s.homepage = 'http://github.com/ruby4kids/pario'
|
14
|
+
s.summary = %q{A Gosu game framework}
|
15
|
+
s.description = %q{Pario is a Gosu game framework that helps to give you structure and a start for creating games}
|
16
|
+
|
17
|
+
s.required_rubygems_version = '>= 1.3.7'
|
18
|
+
s.rubyforge_project = 'pario'
|
19
|
+
|
20
|
+
s.add_dependency('gosu', '~> 0.7.26')
|
21
|
+
|
22
|
+
s.files = `git ls-files`.split("\n")
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
24
|
+
s.default_executable = 'pario'
|
25
|
+
s.require_paths = ['lib']
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pario
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 961915980
|
5
|
+
prerelease: 6
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
- pre
|
11
|
+
version: 0.1.0.pre
|
12
|
+
platform: ruby
|
13
|
+
authors:
|
14
|
+
- Bill Davenport
|
15
|
+
- Anthony Burns
|
16
|
+
autorequire:
|
17
|
+
bindir: bin
|
18
|
+
cert_chain: []
|
19
|
+
|
20
|
+
date: 2011-02-12 00:00:00 -05:00
|
21
|
+
default_executable: pario
|
22
|
+
dependencies:
|
23
|
+
- !ruby/object:Gem::Dependency
|
24
|
+
name: gosu
|
25
|
+
prerelease: false
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ~>
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
hash: 55
|
32
|
+
segments:
|
33
|
+
- 0
|
34
|
+
- 7
|
35
|
+
- 26
|
36
|
+
version: 0.7.26
|
37
|
+
type: :runtime
|
38
|
+
version_requirements: *id001
|
39
|
+
description: Pario is a Gosu game framework that helps to give you structure and a start for creating games
|
40
|
+
email:
|
41
|
+
- bill@infoether.com
|
42
|
+
- anthony@infoether.com
|
43
|
+
executables:
|
44
|
+
- pario
|
45
|
+
extensions: []
|
46
|
+
|
47
|
+
extra_rdoc_files: []
|
48
|
+
|
49
|
+
files:
|
50
|
+
- .gitignore
|
51
|
+
- README.rdoc
|
52
|
+
- bin/pario
|
53
|
+
- lib/pario.rb
|
54
|
+
- lib/pario/version.rb
|
55
|
+
- pario.gemspec
|
56
|
+
has_rdoc: true
|
57
|
+
homepage: http://github.com/ruby4kids/pario
|
58
|
+
licenses: []
|
59
|
+
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
hash: 21
|
80
|
+
segments:
|
81
|
+
- 1
|
82
|
+
- 3
|
83
|
+
- 7
|
84
|
+
version: 1.3.7
|
85
|
+
requirements: []
|
86
|
+
|
87
|
+
rubyforge_project: pario
|
88
|
+
rubygems_version: 1.4.2
|
89
|
+
signing_key:
|
90
|
+
specification_version: 3
|
91
|
+
summary: A Gosu game framework
|
92
|
+
test_files: []
|
93
|
+
|