pario 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/pario.rb +15 -13
  2. data/lib/pario/version.rb +1 -1
  3. metadata +4 -4
@@ -109,13 +109,20 @@ class Pario
109
109
  # create_licesnse
110
110
  end
111
111
 
112
+ # This will take ""
112
113
  def game_name
113
- # For testing
114
- # puts "*"*80
115
- # raise "{:command => #{@command.inspect}, :arguments => #{@arguments[0].inspect}}"
116
114
  @game_name ||= @arguments[0]
117
115
  end
118
116
 
117
+ def game_name_downcase
118
+ game_name.split(/(?=[A-Z])/).join('_').downcase
119
+ end
120
+
121
+ def game_name_upcase
122
+ #TODO: need to handle camelcase
123
+ game_name.to_s.gsub(/\b\w/){$&.upcase}
124
+ end
125
+
119
126
  def create_base_files
120
127
  build_main
121
128
  # build_game_config
@@ -124,7 +131,7 @@ class Pario
124
131
 
125
132
  def build_game_class
126
133
  Dir.chdir("game")
127
- game_file = File.open(@game_name + ".rb", "w+")
134
+ game_file = File.open(game_name_downcase + ".rb", "w+")
128
135
  game_file.puts game_class
129
136
  end
130
137
 
@@ -142,7 +149,7 @@ require 'gosu'
142
149
  Dir.glob(File.join("game", "*.rb")).each {|file| require file }
143
150
 
144
151
 
145
- game = #{game_upcase}.new(800, 600)
152
+ game = #{game_name_upcase}.new(800, 600)
146
153
  game.show
147
154
  EOF
148
155
  main_template.result(binding)
@@ -150,7 +157,7 @@ main_template.result(binding)
150
157
 
151
158
  def game_class
152
159
  game_template = ERB.new <<-EOF
153
- class #{game_upcase} < Gosu::Window
160
+ class #{game_name_upcase} < Gosu::Window
154
161
  def initialize(window_width, window_height)
155
162
  super(window_width,window_height,0)
156
163
  end
@@ -159,14 +166,9 @@ EOF
159
166
  game_template.result(binding)
160
167
  end
161
168
 
162
- def game_upcase
163
- #TODO: need to handle camelcase
164
- @game_name.to_s.gsub(/\b\w/){$&.upcase}
165
- end
166
-
167
169
  def create_directories
168
- Dir.mkdir(game_name) unless File.directory?(game_name)
169
- Dir.chdir(game_name)
170
+ Dir.mkdir(game_name_downcase) unless File.directory?(game_name_downcase)
171
+ Dir.chdir(game_name_downcase)
170
172
  Directories.each do |sub_folder|
171
173
  Dir.mkdir sub_folder unless File.directory?(sub_folder)
172
174
  end
@@ -1,3 +1,3 @@
1
1
  module Pario
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pario
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bill Davenport
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-14 00:00:00 -05:00
19
+ date: 2011-02-15 00:00:00 -05:00
20
20
  default_executable: pario
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency