Top Level Namespace
Defined Under Namespace
Modules: Dubious
Constant Summary collapse
- SERVLET_JAR =
File.join(AppEngine::SDK::SDK_ROOT, *%w{lib shared servlet-api.jar})
- CLASSPATH =
[SERVLET_JAR, AppEngine::SDK::API_JAR].join(":")
- MODEL_SRC_JAR =
File.dirname(Gem.find_files('dubious.rb').first) + '/../javalib/mirahdatastore.jar'
- MIRAH_HOME =
ENV['MIRAH_HOME'] ? ENV['MIRAH_HOME'] : Gem.find_files('mirah').first.sub(/lib\/mirah.rb/,'')
Instance Method Summary collapse
- #appengine_app(name, src, hash = {}, &block) ⇒ Object
-
#mirah_compile_options(opts) ⇒ Object
sets mirah compile opts.
- #mirahc(*files) ⇒ Object
Instance Method Details
#appengine_app(name, src, hash = {}, &block) ⇒ Object
131 132 133 134 135 136 137 138 139 140 |
# File 'lib/dubious_tasks.rb', line 131 def appengine_app(name,src,hash={}, &block) war = hash.keys.first deps = hash[war] || [] task = AppEngine::Rake::AppEngineTask.define_task(name => deps, &block) src = File.(src || 'src') war = File.(war || 'war') task.init(src, war) task end |
#mirah_compile_options(opts) ⇒ Object
sets mirah compile opts
147 148 149 150 151 |
# File 'lib/dubious_tasks.rb', line 147 def opts Mirah.dest_paths << opts[:dest_path] Mirah.source_paths.unshift *opts[:source_paths] Mirah..push *opts[:compiler_options] end |
#mirahc(*files) ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/dubious_tasks.rb', line 154 def mirahc *files if files[-1].kind_of?(Hash) = files.pop else = {} end source_dir = .fetch(:dir, Mirah.source_path) dest = File.(.fetch(:dest, Mirah.dest_path)) files = files.map {|f| f.sub(/^#{source_dir}\//, '')} flags = .fetch(:options, Mirah.) args = ['-d', dest, *flags] + files chdir(source_dir) do cmd = "mirahc #{args.join ' '}" puts cmd if files.any? {|f|f.include? 'controllers'} system cmd else Mirah.compile(*args) Mirah.reset end end end |