Permalink
Browse files

mac-r drank 88672 bottles of mate

  • Loading branch information...
1 parent 1248dd1 commit 7b5ab67c765b1576c01680cc933e13578ddc8e89 @mac-r mac-r committed Jan 16, 2013
View
@@ -1,5 +1,3 @@
language: ruby
rvm:
- - 1.9.3
- - jruby-19mode
- - rbx-19mode
+ - 1.9.3
View
@@ -1,8 +1,9 @@
source 'https://rubygems.org'
group :test do
- gem 'rake'
- gem 'rspec'
+ gem "rake"
+ gem "rspec"
+ gem "aruba", "~> 0.4.6"
end
gem "rio"
@@ -12,4 +13,5 @@ gem "tilt"
gem "liquid"
gem "foreman"
gem "sinatra"
-gem "mongo_mapper"
+gem "mongo_mapper"
+gem "rubyvis"
View
@@ -6,11 +6,26 @@ GEM
builder (~> 2.1.2)
i18n (~> 0.5.0)
activesupport (3.0.19)
+ aruba (0.4.11)
+ childprocess (>= 0.2.3)
+ cucumber (>= 1.1.1)
+ ffi (>= 1.0.11)
+ rspec (>= 2.7.0)
bson (1.8.1)
builder (2.1.2)
+ childprocess (0.3.6)
+ ffi (~> 1.0, >= 1.0.6)
+ cucumber (1.2.1)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.3)
+ gherkin (~> 2.11.0)
+ json (>= 1.4.6)
diff-lcs (1.1.3)
+ ffi (1.3.1)
foreman (0.60.2)
thor (>= 0.13.6)
+ gherkin (2.11.5)
+ json (>= 1.4.6)
gli (2.5.3)
i18n (0.5.0)
json (1.7.6)
@@ -40,6 +55,7 @@ GEM
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.1)
+ rubyvis (0.5.2)
sinatra (1.3.3)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
@@ -52,6 +68,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ aruba (~> 0.4.6)
foreman
gli
liquid
@@ -60,5 +77,6 @@ DEPENDENCIES
rdoc
rio
rspec
+ rubyvis
sinatra
tilt
View
@@ -1,4 +1,6 @@
#!/usr/bin/env rake
+require 'cucumber'
+require 'cucumber/rake/task'
task :default => [:test]
@@ -16,3 +18,8 @@ task :cp do
system "git push origin master"
end
+
+Cucumber::Rake::Task.new(:features) do |t|
+ t.cucumber_opts = "features --format pretty -x"
+ t.fork = false
+end
View
@@ -20,4 +20,6 @@ Gem::Specification.new do |s|
s.add_dependency("foreman")
s.add_dependency("sinatra")
s.add_dependency("mongo_mapper")
+ s.add_dependency("rubyvis")
+ s.add_development_dependency("aruba", '~> 0.4.6')
end
@@ -21,11 +21,11 @@ def additional_params(args)
return keys
end
-def target_dir(args)
- return "datasets/" if args[0] == "selector"
- return "sandbox/miners/" if args[0] == "miner"
- return "sandbox/presenters/" if args[0] == "presenter"
- return "sandbox/tables/" if args[0] == "table"
+def target_dir(instance)
+ return "datasets/" if instance == "selector"
+ return "sandbox/miners/" if instance == "miner"
+ return "sandbox/presenters/" if instance == "presenter"
+ return "sandbox/tables/" if instance == "table"
end
def parse_columns(columns)
@@ -87,4 +87,10 @@ def get_columns(table)
end
raise TypeError, warning("Could not open \"#{table}\". There is something wrong with it.") if columns == []
return columns
-end
+end
+
+# def get_instances(type)
+# instances = []
+
+
+# end
@@ -30,12 +30,16 @@
end
end
end
- post do |global_options,command,options,args|
+end
+
+post do |global_options,command,options,args|
+ if command.name == :run
if args == []
system "foreman start"
else
options = args
if options.first == "miner"
+
system "ruby #{ROOT}/sandbox/miners/#{options[1].downcase}.miner.rb"
end
if options.first == "selector"
@@ -38,8 +38,8 @@
if args[0] == "presenter"
raise TypeError, warning("Presenters are not available, sorry")
end
-
- dir = target_dir(args)
+ instance = args[0]
+ dir = target_dir(instance)
File.open(ROOT + "/#{dir}#{args[1].downcase}.#{args[0]}.rb", 'w') {|f| f.write(content) }
File.open(ROOT + "/sandbox/helpers/#{args[1].downcase}.helper.rb", 'w') {|f| f.write("") } if args[0] == "miner"
puts success("Generated #{args[0]} #{args[1]} successfully!")
@@ -1,77 +1,67 @@
command :help do |c|
c.action do |global_options,options,args|
- puts "Ajaila Datamining Sandbox v. 0.0.2"
- puts "\tDo Science Magic Smoothly and Efficiently!"
- puts "\nCommands:"
- puts " generate new application:\n\t - ajaila new YourApp\n"
- puts " generate table:\n\t - ajaila generate table SomeTable"
- puts " generate selector:\n\t - ajaila generate selector SomeSelector using file:input.csv table:sometable"
- puts " generate miner:\n\t - ajaila generate miner SomeMiner using table:sometable"
- puts " generate presenter:\n\t - ajaila generate presenter SomePresenter using table:sometable"
- puts " generate api:\n\t - ajaila generate api MyApi using table:sometable"
- puts " list of tables:\n\t - ajaila tables"
- puts " list of selectors:\n\t - ajaila seletors"
- puts " list of miners:\n\t - ajaila miners"
- puts " list of presenters:\n\t - ajaila presenters"
+ puts "Ajaila Datamining Sandbox v. 0.0.2"
end
end
command :tables do |c|
c.action do |global_options,options,args|
- puts "These are the app tables:"
- tables, ind = {}, 1
- Dir.glob("sandbox/tables/*.rb").each do |table|
- tables[ind] = table.split("/").last.split(".").first
- ind += 1
- end
- tables[0] = "There are now tables" if tables == {}
- tables.each_key do |ind|
- puts "\t#{ind}) #{tables[ind]}"
- end
+ set_root
+ puts "These are the app tables:"
+ tables, ind = {}, 1
+ Dir.glob(ROOT + "sandbox/tables/*.rb").each do |table|
+ tables[ind] = table.split("/").last.split(".").first
+ ind += 1
+ end
+ tables[0] = "There are now tables" if tables == {}
+ tables.each_key do |ind|
+ puts "\t#{ind}) #{tables[ind]}"
+ end
end
end
command :miners do |c|
c.action do |global_options,options,args|
- puts "These are the app miners:"
- miners, ind = {}, 1
- Dir.glob("sandbox/miners/*.rb").each do |miner|
- miners[ind] = miner.split("/").last.split(".").first
- ind += 1
- end
- miners[0] = "There are now miners" if miners == {}
- miners.each_key do |ind|
- puts "\t#{ind}) #{miners[ind]}"
- end
+ set_root
+ puts "These are the app miners:"
+ miners, ind = {}, 1
+ Dir.glob(ROOT + "sandbox/miners/*.rb").each do |miner|
+ miners[ind] = miner.split("/").last.split(".").first
+ ind += 1
+ end
+ miners[0] = "There are now miners" if miners == {}
+ miners.each_key do |ind|
+ puts "\t#{ind}) #{miners[ind]}"
+ end
end
end
command :selectors do |c|
c.action do |global_options,options,args|
- puts "These are the app selectors:"
- selectors, ind = {}, 1
- Dir.glob("datasets/*.selector.rb").each do |selector|
- selectors[ind] = selector.split("/").last.split(".").first
- ind += 1
- end
- selectors[0] = "There are now selectors" if selectors == {}
- selectors.each_key do |ind|
- puts "\t#{ind}) #{selectors[ind]}"
- end
+ puts "These are the app selectors:"
+ selectors, ind = {}, 1
+ Dir.glob("datasets/*.selector.rb").each do |selector|
+ selectors[ind] = selector.split("/").last.split(".").first
+ ind += 1
+ end
+ selectors[0] = "There are now selectors" if selectors == {}
+ selectors.each_key do |ind|
+ puts "\t#{ind}) #{selectors[ind]}"
+ end
end
end
command :presenters do |c|
c.action do |global_options,options,args|
- puts "These are the app presenters:"
- presenters, ind = {}, 1
- Dir.glob("sandbox/presenters/*.presenter.rb").each do |presenter|
- presenters[ind] = presenter.split("/").last.split(".").first
- ind += 1
- end
- presenters[0] = "There are now presenters" if presenters == {}
- presenters.each_key do |ind|
- puts "\t#{ind}) #{presenters[ind]}"
- end
+ puts "These are the app presenters:"
+ presenters, ind = {}, 1
+ Dir.glob("sandbox/presenters/*.presenter.rb").each do |presenter|
+ presenters[ind] = presenter.split("/").last.split(".").first
+ ind += 1
+ end
+ presenters[0] = "There are now presenters" if presenters == {}
+ presenters.each_key do |ind|
+ puts "\t#{ind}) #{presenters[ind]}"
+ end
end
end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 7b5ab67

Please sign in to comment.