Skip to content
Browse files

Merge remote-tracking branch 'upstream/develop' into develop

  • Loading branch information...
2 parents 2e2cb53 + f657725 commit 1ec50eb8339e948ec99b1d4916e2cdbf236ac254 Scott Richmond committed Jul 4, 2012
Showing with 19 additions and 15 deletions.
  1. +3 −0 .yardopts
  2. +2 −2 Gemfile
  3. +1 −1 README.md
  4. +10 −9 ruby/trema/command/run.rb
  5. +1 −1 ruby/trema/command/version.rb
  6. +1 −1 ruby/trema/version.rb
  7. +1 −1 trema
View
3 .yardopts
@@ -0,0 +1,3 @@
+--readme README.md
+ruby/trema/**/*.rb
+ruby/trema/**/*.c
View
4 Gemfile
@@ -9,7 +9,7 @@ gemspec
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
- gem "cucumber", "~> 1.1.9"
+ gem "cucumber", "~> 1.2.1"
gem "flay", "~> 1.4.3"
gem "flog", "~> 2.5.3"
gem "rake", "~> 0.9.2.2"
@@ -18,6 +18,6 @@ group :development do
gem "redcarpet", "~> 2.1.0"
gem "reek", "~> 1.2.8"
gem "roodi", "~> 2.1.0"
- gem "rspec", "~> 2.9.0"
+ gem "rspec", "~> 2.10.0"
gem "yard", "~> 0.7"
end
View
2 README.md
@@ -22,7 +22,7 @@ Getting Started
1.Install the prerequisites at the command prompt:
- $ sudo apt-get install gcc make ruby rubygems ruby-dev irb file libpcap-dev libsqlite3-dev
+ $ sudo apt-get install gcc make ruby rubygems ruby-dev irb libpcap-dev libsqlite3-dev
2.Install Trema at the command prompt:
View
19 ruby/trema/command/run.rb
@@ -91,26 +91,27 @@ def load_config
if ARGV[ 0 ]
controller_file = ARGV[ 0 ].split.first
- if c_controller?
+ if ruby_controller?
+ require "trema"
+ include Trema
+ ARGV.replace ARGV[ 0 ].split
+ $LOAD_PATH << File.dirname( controller_file )
+ load controller_file
+ else
+ # Assume that the controller is written in C
stanza = Trema::DSL::Run.new
stanza.path controller_file
stanza.options ARGV[ 0 ].split[ 1..-1 ]
Trema::App.new( stanza )
- else
- # Ruby controller
- require "trema"
- ARGV.replace ARGV[ 0 ].split
- $LOAD_PATH << File.dirname( controller_file )
- Trema.module_eval IO.read( controller_file )
end
end
config
end
- def c_controller?
- /ELF/=~ `file #{ ARGV[ 0 ].split.first }`
+ def ruby_controller?
+ /\.rb\Z/=~ ARGV[ 0 ].split.first
end
end
end
View
2 ruby/trema/command/version.rb
@@ -25,7 +25,7 @@
module Trema
module Command
- def version
+ def show_version
puts "trema version #{ Trema::VERSION }"
end
end
View
2 ruby/trema/version.rb
@@ -19,7 +19,7 @@
module Trema
- VERSION = "0.2.2.1"
+ VERSION = "0.2.3"
end
View
2 trema
@@ -45,7 +45,7 @@ end
def method_for command
case command
when "version", "-V", "--version"
- return :version
+ return :show_version
when "ruby"
return :ruby
when "help", "-h", "--help", "/?", "-?"

0 comments on commit 1ec50eb

Please sign in to comment.
Something went wrong with that request. Please try again.