cloudfactory 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/cf.gemspec +9 -6
  2. data/lib/cf/cli/production.rb +1 -2
  3. data/lib/cf/cli/templates/sample-line/form.css +6 -7
  4. data/lib/cf/cli/templates/sample-line/form.html +9 -15
  5. data/lib/cf/cli/templates/sample-line/form.js +2 -2
  6. data/lib/cf/cli/templates/sample-line/line.yml.erb +70 -46
  7. data/lib/cf/cli/templates/sample-line/sample-line.csv +3 -3
  8. data/lib/cf/run.rb +1 -1
  9. data/lib/cf/version.rb +1 -1
  10. metadata +61 -84
  11. data/example/google_translate_app/Gemfile +0 -12
  12. data/example/google_translate_app/config.ru +0 -7
  13. data/example/google_translate_app/google_translate_input.csv +0 -4
  14. data/example/google_translate_app/google_translator_app.rb +0 -53
  15. data/example/google_translate_app/views/index.haml +0 -2
  16. data/example/google_translate_app/views/layout.haml +0 -7
  17. data/example/google_translate_app/views/run.haml +0 -4
  18. data/example/google_translate_app/views/style.sass +0 -2
  19. data/example/human_worker_app/Gemfile +0 -12
  20. data/example/human_worker_app/config.ru +0 -7
  21. data/example/human_worker_app/human_worker_app.rb +0 -55
  22. data/example/human_worker_app/human_worker_input.csv +0 -5
  23. data/example/human_worker_app/public/app.js +0 -12
  24. data/example/human_worker_app/temp.csv +0 -3
  25. data/example/human_worker_app/views/index.haml +0 -15
  26. data/example/human_worker_app/views/layout.haml +0 -10
  27. data/example/human_worker_app/views/result.haml +0 -18
  28. data/example/human_worker_app/views/run.haml +0 -12
  29. data/example/human_worker_app/views/style.sass +0 -25
  30. data/example/sample_yaml_files/concept_tagging_robot.yaml +0 -18
  31. data/example/sample_yaml_files/content_scraping_robot.yaml +0 -19
  32. data/example/sample_yaml_files/entity_extraction_robot.yaml +0 -18
  33. data/example/sample_yaml_files/google_translate_robot.yaml +0 -20
  34. data/example/sample_yaml_files/image_processing_robot.yaml +0 -20
  35. data/example/sample_yaml_files/keyword_matching_and_text_extraction_robot.yaml +0 -26
  36. data/example/sample_yaml_files/mailer_robot.yaml +0 -21
  37. data/example/sample_yaml_files/media_converter_robot.yaml +0 -21
  38. data/example/sample_yaml_files/media_splitting_robot.yaml +0 -20
  39. data/example/sample_yaml_files/multiple_skill_badge.yaml +0 -75
  40. data/example/sample_yaml_files/sentiment_robot.yaml +0 -19
  41. data/example/sample_yaml_files/skill_badge.yaml +0 -56
  42. data/example/sample_yaml_files/stat_badge.yaml +0 -40
  43. data/example/sample_yaml_files/term_extraction_robot.yaml +0 -20
  44. data/example/sample_yaml_files/tournament_station_and_form_fields.yaml +0 -40
@@ -1,12 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'sinatra'
4
- gem 'shotgun'
5
- gem 'haml'
6
- if RUBY_VERSION < '1.9'
7
- gem "ruby-debug", ">= 0.10.3"
8
- else
9
- gem "ruby-debug19", :require => 'ruby-debug'
10
- end
11
-
12
- gem 'cf', :path => "../../"
@@ -1,7 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
-
4
- Bundler.require
5
-
6
- require './google_translator_app'
7
- run GoogleTranslatorApp
@@ -1,4 +0,0 @@
1
- Company,Website
2
- Apple,apple.com
3
- Facebook,facebook.com
4
- Gmail,gmail.com
@@ -1,53 +0,0 @@
1
- class GoogleTranslatorApp < Sinatra::Base
2
-
3
- set :haml, :format => :html5
4
- set :sass, :style => :compact # default Sass style is :nested
5
-
6
- configure do
7
- # CF.api_key = "133fcabc51e35903e616c25aace7ffccc819c8f0"
8
- # CF.email = "sachin@sproutify.com"
9
- # CF.api_url = "sprout.lvh.me:3000/api/"
10
- # CF.api_version = "v1"
11
- end
12
-
13
- get '/' do
14
- haml :index
15
-
16
- end
17
-
18
- get '/run' do
19
- # CF.api_url = "sprout.lvh.me:3000/api/"
20
- response = RestClient.get 'http://sprout.lvh.me:3000/api/v1/lines.json', {:accept => :json}
21
- # @categories = CF::Category.all
22
-
23
- # @categories = RestClient.get 'http://sprout.lvh.me:3000/api/v1/categories.json', {:accept => :json}
24
- # attrs = {:label => "image_url",
25
- # :field_type => "text_data",
26
- # :value => "http://s3.amazon.com/bizcardarmy/medium/1.jpg",
27
- # :required => true,
28
- # :validation_format => "url"
29
- # }
30
- #
31
- # line = CF::Line.new("Demo Line","Survey")
32
-
33
- # line = CF::Line.create("Demo Line","Survey") do |l|
34
- # CF::InputHeader.new(line, attrs)
35
- # CF::Station.create(l, :type => "work") do |s|
36
- # CF::HumanWorker.new(s, 2, 0.2)
37
- # CF::StandardInstruction.create(s,{:title => "Enter name of the CEO of Google", :description => "Enter name of the CEO of Google"}) do |i|
38
- # CF::FormField.new(s, {:label => "First Name", :field_type => "SA", :required => "true"})
39
- # CF::FormField.new(s, {:label => "Middle Name", :field_type => "SA"})
40
- # CF::FormField.new(s, {:label => "Last Name", :field_type => "SA", :required => "true"})
41
- # end
42
- # end
43
- # end
44
- # run = CF::Run.create(line, "run name", File.expand_path("test.csv", __FILE__))
45
- #
46
- haml :run
47
- end
48
-
49
- get '/style.css' do
50
- sass :style, :style => :expanded # overridden
51
- end
52
-
53
- end
@@ -1,2 +0,0 @@
1
- %h1
2
- Welcome to Translator CF App
@@ -1,7 +0,0 @@
1
- !!!
2
- %html
3
- %title Googke Translator CF App
4
- %link{:rel => "stylesheet", :type=> "text/css", :href => "/style.css"}
5
-
6
- %body
7
- = yield
@@ -1,4 +0,0 @@
1
- %h2
2
- Run created.
3
-
4
- = @categories.inspect
@@ -1,2 +0,0 @@
1
- body
2
- background: #444
@@ -1,12 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'sinatra'
4
- gem 'shotgun'
5
- gem 'haml'
6
- if RUBY_VERSION < '1.9'
7
- gem "ruby-debug", ">= 0.10.3"
8
- else
9
- gem "ruby-debug19", :require => 'ruby-debug'
10
- end
11
-
12
- gem 'cloud_factory', :path => "../../", :require => "cf"
@@ -1,7 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
-
4
- Bundler.require
5
-
6
- require './human_worker_app'
7
- run HumanWorkerApp
@@ -1,55 +0,0 @@
1
- class HumanWorkerApp < Sinatra::Base
2
-
3
- enable :logging
4
-
5
- set :haml, :format => :html5
6
- set :sass, :style => :compact # default Sass style is :nested
7
-
8
- configure do
9
- CF.api_key = "f488a62d0307e79ec4f1e6131fa220be47e83d44"
10
- CF.api_url = "http://manish.lvh.me:3000/api/"
11
- CF.api_version = "v1"
12
- end
13
-
14
- helpers do
15
- include Rack::Utils
16
- alias_method :h, :escape_html
17
- end
18
-
19
- get '/' do
20
- haml :index
21
- end
22
-
23
- post '/run' do
24
- response = RestClient.get 'http://sprout.lvh.me:3000/api/v1/lines.json', {:accept => :json}
25
- line = CF::Line.create("Nepali Politicians","Survey") do |l|
26
- CF::Station.create({:line => l, :type => "work"}) do |s|
27
- CF::InputFormat.new({:station => s, :name => "Politician Name", :required => true, :valid_type => "general"})
28
- CF::HumanWorker.new({:station => s, :number => 1, :reward => 20})
29
- CF::TaskForm.create({:station => s, :title => "Gem Sinatra App -2", :instruction => "Guess the amount they have earned through bribe in Rupees"}) do |f|
30
- CF::FormField.new({:form => f, :label => "Amount", :field_type => "SA", :required => "true"})
31
- end
32
- end
33
- end
34
-
35
- input_data_array = []
36
-
37
- params['names'].each do |data|
38
- input_data_array << {"Politician Name" => data, "meta_data_name" => data}
39
- end.join(",")
40
- @run = CF::Run.create(line, "2011 Ghotala", input_data_array)
41
-
42
- haml :run
43
- end
44
-
45
- get '/result/:run' do
46
- run_id = params[:run]
47
- @got_result = CF::Run.get_final_output(run_id)
48
- haml :result
49
- end
50
-
51
- get '/style.css' do
52
- sass :style, :style => :expanded # overridden
53
- end
54
-
55
- end
@@ -1,5 +0,0 @@
1
- Politician Name
2
- Madhav Kumar Nepal
3
- Ram Chandra Poudel
4
- Jhal Nath Khanal
5
- Sher Bahadur Deuwa
@@ -1,12 +0,0 @@
1
- $(document).ready(function() {
2
-
3
- $(".add").click(function() {
4
- $("form > p:first-child").clone(true).insertAfter("form > p:first-child");
5
- return false;
6
- });
7
-
8
- $(".remove").click(function() {
9
- $(this).parent().remove();
10
- });
11
-
12
- });
@@ -1,3 +0,0 @@
1
- Politician Name, meta_data_name
2
- Khurra,Khurra
3
- Politician Name, meta_data_name
@@ -1,15 +0,0 @@
1
- %h1
2
- Bribery App
3
-
4
- #container
5
- %form{:action => "/run", :method => :post, :name => :the_form}
6
- %p
7
- %label Enter the politician name
8
- %input{:type => :text, :name => "names[]"}
9
- %span.remove Remove
10
-
11
-
12
- %span.add Add More Politician
13
-
14
- %p
15
- %input{:type => :submit, :value => "Find It"}
@@ -1,10 +0,0 @@
1
- !!!
2
- %html
3
- %title CloudFactory App
4
- %link{:rel => "stylesheet", :type=> "text/css", :href => "/style.css"}
5
-
6
- %script{:type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"}
7
- %script{:type => "text/javascript", :src => "/app.js"}
8
-
9
- %body
10
- = yield
@@ -1,18 +0,0 @@
1
- %h2
2
- Results
3
- %p
4
- %ol
5
- - @got_result.each do |result|
6
- %li
7
- %b
8
- = result.meta_data['name']
9
- Received
10
- %b
11
- "
12
- = result.final_outputs.last.amount
13
- "
14
- from Bribery
15
- %br
16
- %br
17
- %p
18
- %a{:href => "/"}Go Back to Home
@@ -1,12 +0,0 @@
1
- %h2
2
- Run Successfully created.
3
-
4
- %p
5
- Title of your Production Run is:
6
- = @run.title
7
-
8
- %p
9
- %a{:href =>"result/#{@run.id}"}"Click here to trace Result"
10
-
11
- %p
12
- %a{:href => "/"}Go Back to Home
@@ -1,25 +0,0 @@
1
- body
2
- font-family: Tahoma
3
- font-size: 12px
4
- margin: 20px
5
- cursor: default
6
-
7
- input
8
- border: 1px solid #aaa
9
-
10
- p
11
- margin: 10px 0
12
- &:first-child span
13
- display: none
14
-
15
- span
16
- text-decoration: underline
17
- &:hover
18
- background-color: #ff0
19
- cursor: pointer
20
-
21
- .remove
22
- color: red
23
-
24
- .add
25
- color: green
@@ -1,18 +0,0 @@
1
- api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
2
- title: manish
3
- description: Describe the line what its purpose is and what it does. You got the idea, right?
4
- department: Survey
5
-
6
- input_formats:
7
- - name: url
8
- required: true
9
- valid_type: url
10
-
11
- stations:
12
- - station:
13
- station_index: 1
14
- station_type: work
15
- worker:
16
- worker_type: concept_tagging_robot
17
- settings:
18
- url: ["{url}"]
@@ -1,19 +0,0 @@
1
- api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
2
- title: manish
3
- description: Describe the line what its purpose is and what it does. You got the idea, right?
4
- department: Survey
5
-
6
- input_formats:
7
- - name: url
8
- required: true
9
- valid_type: url
10
-
11
- stations:
12
- - station:
13
- station_index: 1
14
- station_type: work
15
- worker:
16
- worker_type: content_scraping_robot
17
- settings:
18
- document: ["http://www.sprout-technology.com"]
19
- query: 1st 2 links after Sprout products
@@ -1,18 +0,0 @@
1
- api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
2
- title: manish
3
- description: Describe the line what its purpose is and what it does. You got the idea, right?
4
- department: Survey
5
-
6
- input_formats:
7
- - name: url
8
- required: true
9
- valid_type: url
10
-
11
- stations:
12
- - station:
13
- station_index: 1
14
- station_type: work
15
- worker:
16
- worker_type: entity_extraction_robot
17
- settings:
18
- document: ["Franz Kafka and George Orwell are authors. Ludwig Von Beethoven and Mozart are musicians. China and Japan are countries"]
@@ -1,20 +0,0 @@
1
- api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
2
- title: manish
3
- description: Describe the line what its purpose is and what it does. You got the idea, right?
4
- department: Survey
5
-
6
- input_formats:
7
- - name: text
8
- required: true
9
- valid_type: general
10
-
11
- stations:
12
- - station:
13
- station_index: 1
14
- station_type: work
15
- worker:
16
- worker_type: google_translate_robot
17
- settings:
18
- data: ["{text}"]
19
- from: en
20
- to: es
@@ -1,20 +0,0 @@
1
- api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
2
- title: manish
3
- description: Describe the line what its purpose is and what it does. You got the idea, right?
4
- department: Survey
5
-
6
- input_formats:
7
- - name: url
8
- required: true
9
- valid_type: url
10
-
11
- stations:
12
- - station:
13
- station_index: 1
14
- station_type: work
15
- worker:
16
- worker_type: image_processing_robot
17
- settings:
18
- image: ["{url}"]
19
- sharpen:
20
- radius: 10
@@ -1,26 +0,0 @@
1
- api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
2
- title: manish
3
- description: Describe the line what its purpose is and what it does. You got the idea, right?
4
- department: Survey
5
-
6
- input_formats:
7
- - name: url
8
- required: true
9
- valid_type: url
10
-
11
- stations:
12
- - station:
13
- station_index: 1
14
- station_type: work
15
- worker:
16
- worker_type: text_extraction_robot
17
- settings:
18
- url: ["{url}"]
19
- - station:
20
- station_index: 2
21
- station_type: work
22
- worker:
23
- worker_type: keyword_matching_robot
24
- settings:
25
- content: ["{contents_of_url}"]
26
- keywords: 'SaaS,see,additional,deepak,saroj'
@@ -1,21 +0,0 @@
1
- api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
2
- title: manish
3
- description: Describe the line what its purpose is and what it does. You got the idea, right?
4
- department: Survey
5
-
6
- input_formats:
7
- - name: to
8
- required: true
9
- valid_type: general
10
-
11
- stations:
12
- - station:
13
- station_index: 1
14
- station_type: work
15
- worker:
16
- worker_type: mailer_robot
17
- settings:
18
- to: ["manish.das@sprout-technology.com"]
19
- template: '<html><body><h1>Hello {{user}} Welcome to CLoudfactory!!!!</h1><p>Thanks for using!!!!</p></body></html>'
20
- template_variables:
21
- user: Manish