ride 0.1.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -10,9 +10,9 @@ app_generators/ride/templates/.vim/ftdetect/ruby.vim
10
10
  app_generators/ride/templates/.vim/ftplugin/ruby/ruby.vim
11
11
  app_generators/ride/templates/.vim/plugin/taglist.vim
12
12
  app_generators/ride/templates/.vim/syntax/eruby.vim
13
- app_generators/ride/templates/History.txt
14
- app_generators/ride/templates/License.txt
15
- app_generators/ride/templates/README.txt
13
+ app_generators/ride/templates/RIDE_History.txt
14
+ app_generators/ride/templates/RIDE_License.txt
15
+ app_generators/ride/templates/RIDE_README.txt
16
16
  app_generators/ride/templates/config/.screenrc.code.erb
17
17
  app_generators/ride/templates/config/code_template.erb
18
18
  app_generators/ride/templates/script/console
@@ -3,7 +3,7 @@ class RideGenerator < RubiGen::Base
3
3
  DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
4
4
  Config::CONFIG['ruby_install_name'])
5
5
 
6
- default_options :author => nil, :language => "ruby", :shell => 'bash', :editor => 'vim', :console_debugger => 'script/console'
6
+ default_options :author => nil, :language => "ruby", :shell => 'bash', :editor => 'vim', :console_debugger => 'script/ride-console'
7
7
 
8
8
  attr_reader :name, :main_lib, :shell, :editor, :template, :language, :screen_name, :console_debugger
9
9
 
@@ -33,13 +33,14 @@ class RideGenerator < RubiGen::Base
33
33
 
34
34
  m.dependency "install_rubigen_scripts", [destination_root, 'ride'],
35
35
  :shebang => options[:shebang], :collision => :force
36
- m.file_copy_each %w{History.txt License.txt README.txt}
36
+ m.file_copy_each %w{RIDE_History.txt RIDE_License.txt RIDE_README.txt}
37
37
  m.file_copy_each [%w{ftplugin ruby ruby.vim}, %w{plugin taglist.vim}, %w{syntax eruby.vim}, %w{ftdetect ruby.vim}].map { |vimfile| File.join(".vim", *vimfile) }
38
38
  script_options = { :chmod => 0755, :shebang => options[:shebang] == RideGenerator::DEFAULT_SHEBANG ? nil : options[:shebang] }
39
39
  m.file_copy_each %w{tasks/rspec.rake tasks/ride.rake}
40
40
  m.template "config/.screenrc.code.erb", "config/.screenrc.code.erb"
41
41
  m.template "config/code_template.erb", "config/code_template.erb"
42
42
  m.template "script/ride", "script/ride", script_options
43
+ m.file "script/console", "script/ride-console", script_options
43
44
  end
44
45
  end
45
46
 
@@ -65,7 +66,7 @@ EOS
65
66
  opts.on("-e", "--editor", String, "Editor to use" "Default: vim") { |options[:editor]| }
66
67
  opts.on("-s", "--shell", String, "Shell to use" "Default: bash") { |options[:shell]| }
67
68
  opts.on("-n", "--name", String, "What to name the screen session" "Default: #{@name}") { |options[:screen_name]| }
68
- opts.on("-d", "--debugger", String, "What to use for window 1, debugger", "Default: script/console") { |options[:console_debugger]| }
69
+ opts.on("-d", "--debugger", String, "What to use for window 1, debugger", "Default: script/ride-console") { |options[:console_debugger]| }
69
70
  opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
70
71
  end
71
72
 
@@ -1,10 +1,28 @@
1
1
  #!/usr/bin/env ruby
2
2
  # File: script/console
3
+ right_here = File.dirname(__FILE__)
4
+
5
+ if File.exists?(console = File.join(right_here, "console")) and File.executable?(console)
6
+ # This is rails or a newgem app or someone who provided their own script/console, use it
7
+ exec "#{console}"
8
+ elsif File.exists?(rakefile = File.join(right_here, "..", "Rakefile")) and File.read(rakefile).match(/Merb\.start/)
9
+ # looks like merb, start merb interactive
10
+ exec "merb -i"
11
+ end
12
+
13
+ # not merb, not rails, not an app with its own ./script/console, run irb
3
14
  irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
15
 
5
- libs = " -r irb/completion"
6
- # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
- # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/<%= main_lib %>.rb'}"
9
- puts "Loading ride gem"
10
- exec "#{irb} #{libs} --simple-prompt"
16
+ # Hold an array of libraries (to be required by irb)
17
+ libs = []
18
+
19
+ # Perhaps use a console_lib to store any extra methods we may want available in the console
20
+ # libs << (File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb')
21
+
22
+ # Add all libs to the irb session (so they can be required)
23
+ Dir["lib/**/*"].map { |f| File.dirname(f) }.uniq.each { |dir| $: << dir }
24
+
25
+ # Preload specific libs
26
+ libs += %w{irb/completion}
27
+ puts "Loading interactive session"
28
+ exec "#{irb} -r #{libs.join(" -r ")}"
data/lib/ride/version.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Ride
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 1
5
- TINY = 2
4
+ MINOR = 2
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -31,7 +31,7 @@ describe "Ride Generator", "when application is generated" do
31
31
  end
32
32
  end
33
33
 
34
- %w{History.txt License.txt README.txt}.each do |file|
34
+ %w{RIDE_History.txt RIDE_License.txt RIDE_README.txt}.each do |file|
35
35
  it "should create #{file}" do
36
36
  File.exists?(full_path(file)).should == true
37
37
  end
@@ -61,12 +61,18 @@ describe "Ride Generator", "when application is generated" do
61
61
  File.exists?(full_path(file_path)).should == true
62
62
  end
63
63
 
64
- it "should create the script/ride file" do
64
+ it "should create the script/ride file (executable)" do
65
65
  file_path = File.join("script", "ride")
66
66
  File.exists?(full_path(file_path)).should == true
67
67
  FileTest.executable?(full_path(file_path)).should == true
68
68
  end
69
69
 
70
+ it "should create the script/ride-console file (executable)" do
71
+ file_path = File.join("script", "ride-console")
72
+ File.exists?(full_path(file_path)).should == true
73
+ FileTest.executable?(full_path(file_path)).should == true
74
+ end
75
+
70
76
  [%w{ftplugin ruby ruby.vim}, %w{plugin taglist.vim}, %w{syntax eruby.vim}, %w{ftdetect ruby.vim}].each do |vimfile|
71
77
  it "Should create #{vim_path = File.join(".vim", *vimfile)}" do
72
78
  File.exists?(full_path(vim_path)).should == true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ride
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Vanderpoel
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-11 00:00:00 -05:00
12
+ date: 2008-10-12 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.7.0
43
+ version: 1.8.0
44
44
  version:
45
45
  description: A Multi-User Console Interactive Development Environment Based On GNUScreen
46
46
  email:
@@ -55,9 +55,9 @@ extra_rdoc_files:
55
55
  - Manifest.txt
56
56
  - PostInstall.txt
57
57
  - README.txt
58
- - app_generators/ride/templates/History.txt
59
- - app_generators/ride/templates/License.txt
60
- - app_generators/ride/templates/README.txt
58
+ - app_generators/ride/templates/RIDE_History.txt
59
+ - app_generators/ride/templates/RIDE_License.txt
60
+ - app_generators/ride/templates/RIDE_README.txt
61
61
  - website/index.txt
62
62
  files:
63
63
  - History.txt
@@ -72,9 +72,9 @@ files:
72
72
  - app_generators/ride/templates/.vim/ftplugin/ruby/ruby.vim
73
73
  - app_generators/ride/templates/.vim/plugin/taglist.vim
74
74
  - app_generators/ride/templates/.vim/syntax/eruby.vim
75
- - app_generators/ride/templates/History.txt
76
- - app_generators/ride/templates/License.txt
77
- - app_generators/ride/templates/README.txt
75
+ - app_generators/ride/templates/RIDE_History.txt
76
+ - app_generators/ride/templates/RIDE_License.txt
77
+ - app_generators/ride/templates/RIDE_README.txt
78
78
  - app_generators/ride/templates/config/.screenrc.code.erb
79
79
  - app_generators/ride/templates/config/code_template.erb
80
80
  - app_generators/ride/templates/script/console