Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

replaced ask with input detector

  • Loading branch information...
commit 3a27b637e86c67b3edf9914e6ca5c5b8beb66812 1 parent c4cc575
@smeevil authored
Showing with 5 additions and 13 deletions.
  1. +1 −4 lib/fresnel.rb
  2. +4 −9 lib/fresnel/setup_wizard.rb
View
5 lib/fresnel.rb
@@ -314,10 +314,7 @@ def links(number)
links.each_with_index{|link,i|t << [i,link]}
end
puts link_table
- pick=ask("open link # : ", Integer) do |q|
- q.below=links.size
- q.above=-1
- end
+ pick=InputDetector.new("open link # : ", 0...links.size).answer
url=links[pick]
url="http://#{url}" unless url=~/^http/
`open '#{url}'`
View
13 lib/fresnel/setup_wizard.rb
@@ -41,14 +41,9 @@ def self.project(fresnel)
data=fresnel.projects(:object=>true)
current_dir=File.expand_path(".").split("/").last
fresnel.projects(:selectable=>true, :clear=>false, :setup=>true)
-
- project_id=ask("please select which project # resides here : ", Integer) do |q|
- q.validate = /^\d+$/
- q.below=data.size
- q.responses[:ask_on_error]="This project is # : "
- end
- config['project_id']=data[project_id].id
- puts "generated your config in #{fresnel.project_config_file}, going on with main program..."
- File.open(fresnel.project_config_file,'w+'){ |f| f.write(YAML::dump(config)) }
+ project_id=InputDetector.new("please select which project # resides here : ", 0...data.size).answer
+ config['project_id']=data[project_id].id
+ puts "generated your config in #{fresnel.project_config_file}, going on with main program..."
+ File.open(fresnel.project_config_file,'w+'){ |f| f.write(YAML::dump(config)) }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.