This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alpha.txt is supposed to be a text file with multiple lines | |
# my_sort_file.rb | |
class MySortFile | |
def call(env) | |
req = Rack::Request.new(env) | |
initial_file = req.params['file'] | |
Rack::Response.new.finish do |res| | |
res['Content-Type'] = 'text/plain' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jruby01.rb | |
require 'java' | |
java_import('java.util.Date') { |pkg, name| 'JDate' } | |
# To get the locales | |
java_import('java.util.Locale') { |pkg, name| 'JLocale'} | |
java_import('java.text.DateFormat') | |
# Get the date in local format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using MigLayout as frankly Javax Swing without a decent GUI | |
# tool is really a nightmare | |
# One has to download the MigLayout jar from its site | |
# then put it inside the jruby/lib folder | |
require 'java' | |
# For rvm users => allow to just run jruby frontend.rb | |
# provided that a .rvmrc has been created in the directory where | |
# frontend.rb is located. |
OlderNewer