Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:trema/trema into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasunobu Chiba committed Jul 5, 2012
2 parents ed02d08 + f657725 commit d352ad6
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .yardopts
@@ -0,0 +1,3 @@
--readme README.md
ruby/trema/**/*.rb
ruby/trema/**/*.c
4 changes: 2 additions & 2 deletions Gemfile
Expand Up @@ -9,7 +9,7 @@ gemspec
# Add dependencies to develop your gem here. # Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc. # Include everything needed to run rake, tests, features, etc.
group :development do group :development do
gem "cucumber", "~> 1.1.9" gem "cucumber", "~> 1.2.1"
gem "flay", "~> 1.4.3" gem "flay", "~> 1.4.3"
gem "flog", "~> 2.5.3" gem "flog", "~> 2.5.3"
gem "rake", "~> 0.9.2.2" gem "rake", "~> 0.9.2.2"
Expand All @@ -18,6 +18,6 @@ group :development do
gem "redcarpet", "~> 2.1.0" gem "redcarpet", "~> 2.1.0"
gem "reek", "~> 1.2.8" gem "reek", "~> 1.2.8"
gem "roodi", "~> 2.1.0" gem "roodi", "~> 2.1.0"
gem "rspec", "~> 2.9.0" gem "rspec", "~> 2.10.0"
gem "yard", "~> 0.7" gem "yard", "~> 0.7"
end end
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -22,7 +22,7 @@ Getting Started


1.Install the prerequisites at the command prompt: 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: 2.Install Trema at the command prompt:


Expand Down
19 changes: 10 additions & 9 deletions ruby/trema/command/run.rb
Expand Up @@ -91,26 +91,27 @@ def load_config


if ARGV[ 0 ] if ARGV[ 0 ]
controller_file = ARGV[ 0 ].split.first 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 = Trema::DSL::Run.new
stanza.path controller_file stanza.path controller_file
stanza.options ARGV[ 0 ].split[ 1..-1 ] stanza.options ARGV[ 0 ].split[ 1..-1 ]
Trema::App.new( stanza ) 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
end end


config config
end end




def c_controller? def ruby_controller?
/ELF/=~ `file #{ ARGV[ 0 ].split.first }` /\.rb\Z/=~ ARGV[ 0 ].split.first
end end
end end
end end
Expand Down
2 changes: 1 addition & 1 deletion ruby/trema/command/version.rb
Expand Up @@ -25,7 +25,7 @@


module Trema module Trema
module Command module Command
def version def show_version
puts "trema version #{ Trema::VERSION }" puts "trema version #{ Trema::VERSION }"
end end
end end
Expand Down
2 changes: 1 addition & 1 deletion ruby/trema/version.rb
Expand Up @@ -19,7 +19,7 @@




module Trema module Trema
VERSION = "0.2.2.1" VERSION = "0.2.3"
end end




Expand Down
2 changes: 1 addition & 1 deletion trema
Expand Up @@ -45,7 +45,7 @@ end
def method_for command def method_for command
case command case command
when "version", "-V", "--version" when "version", "-V", "--version"
return :version return :show_version
when "ruby" when "ruby"
return :ruby return :ruby
when "help", "-h", "--help", "/?", "-?" when "help", "-h", "--help", "/?", "-?"
Expand Down

0 comments on commit d352ad6

Please sign in to comment.