Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix gemspec and installation issue
  • Loading branch information
bouba committed Apr 18, 2011
1 parent b8c2c24 commit 6e8a306
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 27 deletions.
29 changes: 23 additions & 6 deletions bin/fumoffu
Expand Up @@ -34,6 +34,11 @@ optparse = OptionParser.new do|opts|
options[:bundle] = format
end

options[:dependencies] = false
opts.on("-d", "--dependencies", "Download and install the dependencies") do
options[:dependencies] = true
end

# This displays the help screen, all programs are
# assumed to have this option.
opts.on( '-h', '--help', 'Display this screen' ) do
Expand All @@ -44,6 +49,17 @@ end

optparse.parse!

def jruby_jar
# we check if the jruby jar is in the libs if not we download it
if not File.exist? Fumoffu::Application.app_dir+"/interface/lib/java/jruby-complete.jar" then
puts "We download the last stable version of jruby-complete jar..."
sh "rake -f #{File.dirname(__FILE__)}/../tasks/rawr_bundle.rake rawr:get:current-stable-jruby"
sh "mv #{Fumoffu::Application.app_dir}/lib/java/jruby-complete.jar #{Fumoffu::Application.app_dir}/interface/lib"
sh "rmdir #{Fumoffu::Application.app_dir}/lib/java"
sh "rmdir #{Fumoffu::Application.app_dir}/lib"
end
end

begin
if options[:install] then
project_dir = "."
Expand All @@ -58,19 +74,15 @@ begin
# we add the missing gems
puts "Installing default packages ..."
Dir.chdir project_dir do
sh "bundle install"
sh "bundle install --path engine/lib/ruby"
end
exit
end

if not options[:bundle].nil?
if bundle_format.include? options[:bundle].to_sym then
task = nil
# we check if the jruby jar is in the libs if not we download it
if not File.exist? Fumoffu::Application.app_dir+"/lib/java/jruby-complete.jar" then
puts "We download the last stable version of jruby-complete jar..."
sh "rake -f #{File.dirname(__FILE__)}/../tasks/rawr_bundle.rake rawr:get:current-stable-jruby"
end
jruby_jar
if options[:bundle] == :jar
task = "rawr:jar"
else
Expand All @@ -81,6 +93,11 @@ begin
end
end

if options[:dependencies] then
jruby_jar
exit
end

puts "Invalid command line."
end
#
Expand Down
36 changes: 19 additions & 17 deletions fumoffu.gemspec
Expand Up @@ -5,11 +5,11 @@

Gem::Specification.new do |s|
s.name = %q{fumoffu}
s.version = "0.0.2"
s.version = "0.1.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Lionel Abderemane"]
s.date = %q{2011-02-24}
s.date = %q{2011-04-18}
s.default_executable = %q{fumoffu}
s.description = %q{I will make the description later}
s.email = %q{alionel@gmail.com}
Expand All @@ -32,31 +32,33 @@ Gem::Specification.new do |s|
"lib/fumoffu/generators/fumoffu_generator.rb",
"lib/fumoffu/generators/fumoffu_lib_generator.rb",
"lib/fumoffu/generators/fumoffu_src_generator.rb",
"lib/fumoffu/generators/tasks/generator.rake",
"lib/fumoffu/generators/tasks/install.rake",
"lib/fumoffu/generators/tasks/package.rake",
"lib/fumoffu/generators/templates/Gemfile",
"lib/fumoffu/generators/templates/Rakefile",
"lib/fumoffu/generators/templates/build_configuration.rb",
"lib/fumoffu/generators/templates/lib/java/AbsoluteLayout.jar",
"lib/fumoffu/generators/templates/lib/java/swing-layout.jar",
"lib/fumoffu/generators/templates/engine/config/initializers/app_classes.rb",
"lib/fumoffu/generators/templates/engine/config/initializers/configuration.rb",
"lib/fumoffu/generators/templates/engine/config/initializers/init.rb",
"lib/fumoffu/generators/templates/engine/config/initializers/java_classes.rb",
"lib/fumoffu/generators/templates/engine/config/initializers/ruby_classes.rb",
"lib/fumoffu/generators/templates/engine/src/actions/controllers/application_controller.rb",
"lib/fumoffu/generators/templates/engine/src/actions/handlers/application_handler.rb",
"lib/fumoffu/generators/templates/engine/src/main.rb",
"lib/fumoffu/generators/templates/engine/src/setup.rb",
"lib/fumoffu/generators/templates/engine/test/spec/spec_helper.rb",
"lib/fumoffu/generators/templates/interface/lib/AbsoluteLayout.jar",
"lib/fumoffu/generators/templates/interface/lib/SwingLayout.jar",
"lib/fumoffu/generators/templates/interface/src/org/github/bouba/fumoffu/ActionManager.java",
"lib/fumoffu/generators/templates/interface/src/org/github/bouba/fumoffu/UIActions.java",
"lib/fumoffu/generators/templates/interface/src/org/rubyforge/rawr/Main.java",
"lib/fumoffu/generators/templates/scripts/package.sh",
"lib/fumoffu/generators/templates/scripts/start.sh",
"lib/fumoffu/generators/templates/src/java/org/github/bouba/fumoffu/ActionManager.java",
"lib/fumoffu/generators/templates/src/java/org/github/bouba/fumoffu/UIActions.java",
"lib/fumoffu/generators/templates/src/java/org/rubyforge/rawr/Main.java",
"lib/fumoffu/generators/templates/src/ruby/app/actions/controllers/application_controller.rb",
"lib/fumoffu/generators/templates/src/ruby/app/actions/handlers/application_handler.rb",
"lib/fumoffu/generators/templates/src/ruby/app/main.rb",
"lib/fumoffu/generators/templates/src/ruby/app/setup.rb",
"lib/fumoffu/generators/templates/src/ruby/app/utils/component_search.rb",
"lib/fumoffu/generators/templates/src/ruby/config/configuration.rb",
"lib/fumoffu/generators/templates/src/ruby/config/initializers/app_classes.rb",
"lib/fumoffu/generators/templates/src/ruby/config/initializers/init.rb",
"lib/fumoffu/generators/templates/src/ruby/config/initializers/java_classes.rb",
"lib/fumoffu/generators/templates/src/ruby/config/initializers/ruby_classes.rb",
"lib/fumoffu/handler.rb",
"lib/fumoffu/java_mapping.rb",
"lib/fumoffu/utils/component_search.rb",
"tasks/rawr_bundle.rake",
"test/coverage/index.html",
"test/coverage/jquery-1.3.2.min.js",
"test/coverage/jquery.tablesorter.min.js",
Expand Down
9 changes: 5 additions & 4 deletions lib/fumoffu/generators/templates/Rakefile
Expand Up @@ -26,7 +26,7 @@ require 'rspec/core/rake_task'
require 'yaml'

Rake::RDocTask.new do |rdoc|
files =['README', 'LICENSE', 'lib/**/*.rb']
files =['README', 'LICENSE', 'engine/lib/**/*.rb']
rdoc.rdoc_files.add(files)
rdoc.main = "README" # page to start on
rdoc.title = "Your project Docs"
Expand All @@ -35,7 +35,7 @@ Rake::RDocTask.new do |rdoc|
end

Rake::TestTask.new do |t|
t.test_files = FileList['test/**/*.rb']
t.test_files = FileList['engine/test/**/*.rb']
end

#RSpec::Core::RakeTask.new do |t|
Expand All @@ -45,14 +45,15 @@ end

desc "Launch rspec tests"
task :spec do
sh "jruby -S spec test/ruby/spec/ -c"
puts "Not working !!! use `jruby -S spec engine/test/spec/ -c` in a terminal "
end
# Setup default global constant
env ||= ENV['env']
env = "development" unless env

APP_ENV = env
ROOT_DIR = File.dirname(__FILE__)
IS_FROM_JAR = false

# import custom rake tasks
Dir.glob(File.dirname(__FILE__)+"/config/tasks/*.rake").each {|file| import file }
Dir.glob(File.dirname(__FILE__)+"/engine/config/tasks/*.rake").each {|file| import file }

0 comments on commit 6e8a306

Please sign in to comment.