littlebrat 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/littlebrat +53 -3
  2. metadata +39 -37
@@ -1,9 +1,59 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'littlebrat'
4
+ require 'optparse'
4
5
 
5
- # TODO: Grab the config values from the arguments
6
+ # This hash will hold all of the options
7
+ # parsed from the command-line by
8
+ # OptionParser.
9
+ options = { }
10
+
11
+ optparse = OptionParser.new do |opts|
12
+ # Set a banner, displayed at the top
13
+ # of the help screen.
14
+ opts.banner = "Usage: littlebrat [options]"
15
+
16
+ options[:height] = Gosu.screen_height - 200
17
+ opts.on( '--height NUM', 'Height of the screen' ) do |height|
18
+ options[:height] = Integer(height)
19
+ end
20
+
21
+ options[:width] = Gosu.screen_width - 200
22
+ opts.on( '--width NUM', 'Width of the screen' ) do |width|
23
+ options[:width] = Integer(width)
24
+ end
25
+
26
+ # options[:height] = Gosu.screen_height - 200
27
+ # opts.on( '-h', '--height NUM', 'Height of the screen' ) do |height|
28
+ # height = height.to_i
29
+ # options[:height] = height if height > 0
30
+ # end
31
+
32
+ # options[:width] = Gosu.screen_width - 200
33
+ # opts.on( '-w', '--width NUM', 'Width of the screen' ) do |width|
34
+ # width = width.to_i
35
+ # options[:width] = width if widt > 0
36
+ # end
37
+
38
+ options[:fullscreen] = false
39
+ opts.on( '--fullscreen', 'Open in full screen mode' ) do
40
+ options[:fullscreen] = true
41
+ end
42
+
43
+ # This displays the help screen, all programs are
44
+ # assumed to have this option.
45
+ opts.on( '-h', '--help', 'Display this screen' ) do
46
+ puts opts
47
+ exit
48
+ end
49
+ end
50
+
51
+ # Parse the command-line. Remember there are two forms
52
+ # of the parse method. The 'parse' method simply parses
53
+ # ARGV, while the 'parse!' method parses ARGV and removes
54
+ # any options found there, as well as any parameters for
55
+ # the options. What's left is the list of files to resize.
56
+ optparse.parse!
6
57
 
7
58
  # Time to shut the little brats up!
8
- # LittleBrat.new(800, 600, false).show
9
- LittleBrat.new.show
59
+ LittleBrat.new(options[:width], options[:height], options[:fullscreen]).show
metadata CHANGED
@@ -1,37 +1,40 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: littlebrat
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Mike Moore
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2010-11-09 00:00:00 -07:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2012-07-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: gosu
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.7.24
17
22
  type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
21
27
  - - ~>
22
- - !ruby/object:Gem::Version
28
+ - !ruby/object:Gem::Version
23
29
  version: 0.7.24
24
- version:
25
30
  description: Because kids like to smash buttons
26
- email:
31
+ email:
27
32
  - mike@blowmage.com
28
- executables:
33
+ executables:
29
34
  - littlebrat
30
35
  extensions: []
31
-
32
36
  extra_rdoc_files: []
33
-
34
- files:
37
+ files:
35
38
  - lib/littlebrat.rb
36
39
  - sounds/AMFMBEEP.WAV
37
40
  - sounds/ARRP.WAV
@@ -49,33 +52,32 @@ files:
49
52
  - sounds/TYPEKEY.WAV
50
53
  - sounds/TYPESPAC.WAV
51
54
  - sounds/WATER.WAV
52
- has_rdoc: true
55
+ - bin/littlebrat
53
56
  homepage: http://rubygems.org/gems/littlebrat
54
57
  licenses: []
55
-
56
58
  post_install_message:
57
59
  rdoc_options: []
58
-
59
- require_paths:
60
+ require_paths:
60
61
  - lib
61
- required_ruby_version: !ruby/object:Gem::Requirement
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- version: "0"
66
- version:
67
- required_rubygems_version: !ruby/object:Gem::Requirement
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ segments:
69
+ - 0
70
+ hash: 4566469034392694451
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
71
76
  version: 1.3.6
72
- version:
73
77
  requirements: []
74
-
75
78
  rubyforge_project: littlebrat
76
- rubygems_version: 1.3.5
79
+ rubygems_version: 1.8.24
77
80
  signing_key:
78
81
  specification_version: 3
79
82
  summary: A handy little app to entertain the kiddos
80
83
  test_files: []
81
-