Permalink
Browse files

Renamed a gem executable command from 'greenshoes' to 'gshoes'. Added…

… -h, -v and -p options.
  • Loading branch information...
1 parent 692941a commit abb10da33a58761d3ea01c2ebc6ce51aa4516e53 @ashbb committed Dec 18, 2011
Showing with 63 additions and 28 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 VERSION
  3. +0 −22 bin/greenshoes
  4. +57 −0 bin/gshoes
  5. +4 −4 green_shoes.gemspec
View
@@ -13,7 +13,7 @@ Jeweler::Tasks.new do |gem|
gem.summary = %Q{Green Shoes}
gem.description = %Q{Green Shoes is one of colorful Shoes, written in pure Ruby with Ruby/GTK2.}
gem.email = "ashbbb@gmail.com"
- gem.executables = ["greenshoes"]
+ gem.executables = ["gshoes"]
gem.homepage = "http://github.com/ashbb/green_shoes"
gem.authors = ["ashbb"]
gem.add_dependency 'gtk2'
View
@@ -1 +1 @@
-1.0.339
+1.0.340
View
@@ -1,22 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../lib/green_shoes'
-
-arg = ARGV[0]
-path = File.expand_path(arg.gsub(/\\/, "/"))
-ARGV[0] = path
-
-case
-when path =~ /\.gsy$/
- base = File.basename(path, ".gsy")
- tmpdir = "%s/shoes-%s.%d" % [Dir.tmpdir, base, $$]
- shy = Shy.x(path, tmpdir)
- Dir.chdir(tmpdir)
- p "Loaded GSY: #{shy.name} #{shy.version} by #{shy.creator}"
- load File.join(tmpdir, shy.launch)
-when arg == '-m'
- Shoes.show_manual
-when arg == '-mj'
- Shoes.show_manual 'Japanese'
-else
- load path
-end
View
@@ -0,0 +1,57 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../lib/green_shoes'
+
+arg = ARGV[0]
+path = File.expand_path(arg.gsub(/\\/, "/")) if arg
+ARGV[0] = path
+
+case arg
+when '-m', '-men'
+ Shoes.show_manual
+when '-mjp'
+ Shoes.show_manual 'Japanese'
+when '-h', nil
+ puts "Usage: gshoes (options or app.rb or app.gsy)
+ -m, -men Open the built-in English manual.
+ -mjp Open the built-in Japanese manual.
+ -p Package a Green Shoes app as a .gsy file.
+ -v Display the version info.
+ -h Show this message."
+when '-v'
+ puts IO.read File.join(DIR, '../VERSION')
+when '-p'
+ launch_script = ask_open_file
+ Shoes.app do
+ top_dir = File.dirname(launch_script)
+ launch_script = File.basename(launch_script)
+ shy_name = "#{top_dir}.gsy"
+ para "Almost ready to make #{shy_name}"
+ fields = {}
+ [["Project Name", "name"], ["Version", "version"], ["Your Name", "creator"]].each do |label, name|
+ flow do
+ para "#{label}: ", width: 200
+ fields[name] = edit_line
+ end
+ end
+ button "Build .gsy" do
+ shy_desc = Shy.new
+ fields.keys.each do |name|
+ shy_desc.send("#{name}=", fields[name].text)
+ end
+ shy_desc.launch = launch_script
+ Shy.c(shy_name, shy_desc, top_dir)
+ clear{para "Built #{shy_name}"}
+ end
+ end if launch_script
+else
+ if path =~ /\.gsy$/
+ base = File.basename(path, ".gsy")
+ tmpdir = "%s/shoes-%s.%d" % [Dir.tmpdir, base, $$]
+ shy = Shy.x(path, tmpdir)
+ Dir.chdir(tmpdir)
+ puts "Loaded GSY: #{shy.name} #{shy.version} by #{shy.creator}"
+ load File.join(tmpdir, shy.launch)
+ else
+ load path
+ end
+end
View
@@ -5,21 +5,21 @@
Gem::Specification.new do |s|
s.name = "green_shoes"
- s.version = "1.0.339"
+ s.version = "1.0.340"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["ashbb"]
- s.date = "2011-12-14"
+ s.date = "2011-12-18"
s.description = "Green Shoes is one of colorful Shoes, written in pure Ruby with Ruby/GTK2."
s.email = "ashbbb@gmail.com"
- s.executables = ["greenshoes"]
+ s.executables = ["gshoes"]
s.extra_rdoc_files = [
"LICENSE",
"README.md"
]
s.files = [
"VERSION",
- "bin/greenshoes",
+ "bin/gshoes",
"lib/ext/bloops.rb",
"lib/ext/bloops/bloops.so",
"lib/ext/bloops/libportaudio-2.dll",

0 comments on commit abb10da

Please sign in to comment.