Permalink
Browse files

removed untested spike code from gizmo executable

  • Loading branch information...
1 parent 6c407ca commit 96282a93ec8a55e619828ac562cda3b2b98dedee Luke Cunningham committed Apr 8, 2010
Showing with 3 additions and 40 deletions.
  1. +3 −40 bin/gizmo
View
@@ -7,46 +7,11 @@ require 'active_support'
$LOAD_PATH << File.dirname(__FILE__) + '/../lib'
require 'gizmo'
-@current_mixin = nil
-
-def puts_list methods
- return puts "[]" if methods.empty?
- puts methods.sort.join(', ')
-end
opts = OptionParser.new do |opts|
- opts.on("-v", "--version", "what's the frequency kenneth?") do
- puts "gizmo version: 0.0.0"
- end
-
- opts.on("-g", "--generate-mixin [NAME]", "generate a new page mixin") do |mixin_name|
- File.open("#{Gizmo::Config.mixin_path}/page_with_#{mixin_name}.rb", "w") do |file|
- content = <<-EOS
- module PageWith#{mixin_name.camelize}
- # def valid
- # has_selector?('my-container')
- # end
- end
- EOS
- file.write(content.strip)
- end
- end
-
- opts.on("-p", "--with-page [NAME]") do |mixin_name|
- Gizmo.load_mixins! File.join(Dir.pwd, Gizmo::Config.mixin_path)
- mixin = Object.const_get("PageWith" + mixin_name.camelize)
- @current_mixin = { :name => mixin_name, :obj => Gizmo::Page.new({}, '', {}).extend(mixin) }
- end
-
- opts.on('-m', '--list-methods', 'list all the methods for a mixin') do
- puts "---- methods for #{@current_mixin[:name]} ----"
- puts_list @current_mixin[:obj].methods
- end
-
- opts.on('-f', '--filter-methods [QUERY]', 'filter methods for a mixin') do |query|
- puts "---- methods for #{@current_mixin[:name]} matching #{query} ----"
- puts_list @current_mixin[:obj].methods.select { |m| m =~ /#{query}/ }
+ opts.on("-v", "--version") do
+ puts "gizmo #{IO.readlines(File.join(File.dirname(__FILE__), '..', 'VERSION'))}"
end
end
@@ -57,6 +22,4 @@ if ARGV.size == 0
exit 1
end
-opts.parse!
-
-@current_mixin = nil
+opts.parse!

0 comments on commit 96282a9

Please sign in to comment.