cloudfactory 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/.gitignore +11 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +10 -0
  4. data/README.md +44 -0
  5. data/Rakefile +40 -0
  6. data/bin/cf +8 -0
  7. data/cf.gemspec +76 -0
  8. data/example/google_translate_app/Gemfile +12 -0
  9. data/example/google_translate_app/config.ru +7 -0
  10. data/example/google_translate_app/google_translate_input.csv +4 -0
  11. data/example/google_translate_app/google_translator_app.rb +53 -0
  12. data/example/google_translate_app/views/index.haml +2 -0
  13. data/example/google_translate_app/views/layout.haml +7 -0
  14. data/example/google_translate_app/views/run.haml +4 -0
  15. data/example/google_translate_app/views/style.sass +2 -0
  16. data/example/human_worker_app/Gemfile +12 -0
  17. data/example/human_worker_app/config.ru +7 -0
  18. data/example/human_worker_app/human_worker_app.rb +55 -0
  19. data/example/human_worker_app/human_worker_input.csv +5 -0
  20. data/example/human_worker_app/public/app.js +12 -0
  21. data/example/human_worker_app/temp.csv +3 -0
  22. data/example/human_worker_app/views/index.haml +15 -0
  23. data/example/human_worker_app/views/layout.haml +10 -0
  24. data/example/human_worker_app/views/result.haml +18 -0
  25. data/example/human_worker_app/views/run.haml +12 -0
  26. data/example/human_worker_app/views/style.sass +25 -0
  27. data/example/sample_yaml_files/concept_tagging_robot.yaml +18 -0
  28. data/example/sample_yaml_files/content_scraping_robot.yaml +19 -0
  29. data/example/sample_yaml_files/entity_extraction_robot.yaml +18 -0
  30. data/example/sample_yaml_files/google_translate_robot.yaml +20 -0
  31. data/example/sample_yaml_files/image_processing_robot.yaml +20 -0
  32. data/example/sample_yaml_files/keyword_matching_and_text_extraction_robot.yaml +26 -0
  33. data/example/sample_yaml_files/mailer_robot.yaml +21 -0
  34. data/example/sample_yaml_files/media_converter_robot.yaml +21 -0
  35. data/example/sample_yaml_files/media_splitting_robot.yaml +20 -0
  36. data/example/sample_yaml_files/multiple_skill_badge.yaml +75 -0
  37. data/example/sample_yaml_files/sentiment_robot.yaml +19 -0
  38. data/example/sample_yaml_files/skill_badge.yaml +56 -0
  39. data/example/sample_yaml_files/stat_badge.yaml +40 -0
  40. data/example/sample_yaml_files/term_extraction_robot.yaml +20 -0
  41. data/example/sample_yaml_files/tournament_station_and_form_fields.yaml +40 -0
  42. data/features/form_generation.feature +46 -0
  43. data/features/form_preview.feature +98 -0
  44. data/features/line_creation.feature +99 -0
  45. data/features/line_deletion.feature +50 -0
  46. data/features/line_generation.feature +57 -0
  47. data/features/run.feature +141 -0
  48. data/features/support/cli_steps.rb +16 -0
  49. data/features/support/env.rb +23 -0
  50. data/features/target_url.feature +82 -0
  51. data/fixtures/api_credentials_example.yml +4 -0
  52. data/fixtures/input_data/media_converter_robot.csv +2 -0
  53. data/fixtures/input_data/test.csv +2 -0
  54. data/lib/cf.rb +94 -0
  55. data/lib/cf/account.rb +32 -0
  56. data/lib/cf/cli.rb +52 -0
  57. data/lib/cf/cli/config.rb +87 -0
  58. data/lib/cf/cli/form.rb +82 -0
  59. data/lib/cf/cli/line.rb +237 -0
  60. data/lib/cf/cli/production.rb +62 -0
  61. data/lib/cf/cli/templates/css_file.css.erb +22 -0
  62. data/lib/cf/cli/templates/form_preview.html.erb +17 -0
  63. data/lib/cf/cli/templates/html_file.html.erb +21 -0
  64. data/lib/cf/cli/templates/js_file.js.erb +18 -0
  65. data/lib/cf/cli/templates/line.tt +55 -0
  66. data/lib/cf/cli/templates/sample-line/form.css +27 -0
  67. data/lib/cf/cli/templates/sample-line/form.html +26 -0
  68. data/lib/cf/cli/templates/sample-line/form.js +7 -0
  69. data/lib/cf/cli/templates/sample-line/line.yml.erb +67 -0
  70. data/lib/cf/cli/templates/sample-line/sample-line.csv +3 -0
  71. data/lib/cf/client.rb +56 -0
  72. data/lib/cf/custom_task_form.rb +136 -0
  73. data/lib/cf/department.rb +24 -0
  74. data/lib/cf/final_output.rb +20 -0
  75. data/lib/cf/form_field.rb +62 -0
  76. data/lib/cf/human_worker.rb +67 -0
  77. data/lib/cf/input_format.rb +134 -0
  78. data/lib/cf/line.rb +231 -0
  79. data/lib/cf/robot_worker.rb +31 -0
  80. data/lib/cf/run.rb +158 -0
  81. data/lib/cf/station.rb +340 -0
  82. data/lib/cf/task_form.rb +147 -0
  83. data/lib/cf/version.rb +3 -0
  84. data/lib/generators/cf/form/form_generator.rb +55 -0
  85. data/lib/generators/cf/form/templates/cf_form.html.erb +11 -0
  86. data/lib/generators/cf/install/install_generator.rb +22 -0
  87. data/lib/generators/cf/install/templates/README +13 -0
  88. data/lib/generators/cf/install/templates/cloud_factory.rb +7 -0
  89. data/spec/account_spec.rb +11 -0
  90. data/spec/badge_spec.rb +88 -0
  91. data/spec/concept_tagging_robot_spec.rb +54 -0
  92. data/spec/config_spec.rb +20 -0
  93. data/spec/content_scraping_robot_spec.rb +58 -0
  94. data/spec/custom_task_form_spec.rb +190 -0
  95. data/spec/department_spec.rb +14 -0
  96. data/spec/entity_extraction_robot_spec.rb +56 -0
  97. data/spec/form_field_spec.rb +126 -0
  98. data/spec/generators/form_generator_spec.rb +60 -0
  99. data/spec/generators/install_generator_spec.rb +35 -0
  100. data/spec/google_translate_robot_spec.rb +64 -0
  101. data/spec/human_worker_spec.rb +118 -0
  102. data/spec/image_processing_robot_spec.rb +56 -0
  103. data/spec/input_format_spec.rb +113 -0
  104. data/spec/keyword_matching_and_text_extraction_robot_spec.rb +73 -0
  105. data/spec/line_spec.rb +338 -0
  106. data/spec/mailer_robot_spec.rb +62 -0
  107. data/spec/media_converter_robot_spec.rb +72 -0
  108. data/spec/media_splitting_robot_spec.rb +62 -0
  109. data/spec/run_spec.rb +298 -0
  110. data/spec/sentiment_robot_spec.rb +56 -0
  111. data/spec/spec_helper.rb +39 -0
  112. data/spec/station_spec.rb +256 -0
  113. data/spec/task_form_spec.rb +96 -0
  114. data/spec/term_extraction_robot_spec.rb +58 -0
  115. data/spec/text_appending_robot_spec.rb +86 -0
  116. metadata +472 -0
@@ -0,0 +1,18 @@
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
@@ -0,0 +1,12 @@
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
@@ -0,0 +1,25 @@
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
@@ -0,0 +1,18 @@
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}"]
@@ -0,0 +1,19 @@
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
@@ -0,0 +1,18 @@
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"]
@@ -0,0 +1,20 @@
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
@@ -0,0 +1,20 @@
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
@@ -0,0 +1,26 @@
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'
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,21 @@
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: media_converter_robot
17
+ settings:
18
+ url: http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov
19
+ to: mpg
20
+ audio_quality: 320
21
+ video_quality: 3
@@ -0,0 +1,20 @@
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: media_splitting_robot
17
+ settings:
18
+ url: ["http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"]
19
+ split_duration: 2
20
+ overlapping_time: 1
@@ -0,0 +1,75 @@
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: human
17
+ num_workers: 1
18
+ reward: 10
19
+ skill_badges:
20
+ - title: Football Fanatic
21
+ description: This qualification allows you to perform work at stations which have this badge.
22
+ max_badges: 3
23
+ test:
24
+ input:
25
+ name: Lionel Andres Messi
26
+ country: Argentina
27
+ expected_output:
28
+ - birthplace: 'Rosario, Santa Fe, Argentina'
29
+ match_options:
30
+ tolerance: 10
31
+ ignore_case: true
32
+ - position: CF
33
+ match_options:
34
+ tolerance: 1
35
+ - current_club: Barcelona
36
+ match_options:
37
+ tolerance: 1
38
+ ignore_case: false
39
+ - title: Football Fanatic
40
+ description: This qualification allows you to perform work at stations which have this badge.
41
+ max_badges: 3
42
+ test:
43
+ input:
44
+ name: Cristiano Ronaldo
45
+ country: Portugal
46
+ expected_output:
47
+ - birthplace: 'Portugal'
48
+ match_options:
49
+ tolerance: 10
50
+ ignore_case: true
51
+ - position: CF
52
+ match_options:
53
+ tolerance: 1
54
+ - current_club: Real Madrid
55
+ match_options:
56
+ tolerance: 1
57
+ ignore_case: false
58
+ task_form:
59
+ form_title: Enter text from a business card image
60
+ instruction: Description should be written here
61
+ form_fields:
62
+ - label: First Name
63
+ required: true
64
+ field_type: SA
65
+ - label: Middle Name
66
+ field_type: SA
67
+ - label: Last Name
68
+ required: true
69
+ field_type: SA
70
+ - label: Gender
71
+ required: true
72
+ field_type: RB
73
+ option_values:
74
+ - male
75
+ - female
@@ -0,0 +1,19 @@
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: sentiment_robot
17
+ settings:
18
+ document: ["{url}"]
19
+ sanitize: true
@@ -0,0 +1,56 @@
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: human
17
+ num_workers: 1
18
+ reward: 10
19
+ skill_badges:
20
+ - title: Football Fanatic
21
+ description: This qualification allows you to perform work at stations which have this badge.
22
+ max_badges: 3
23
+ test:
24
+ input:
25
+ name: Lionel Andres Messi
26
+ country: Argentina
27
+ expected_output:
28
+ - birthplace: 'Rosario, Santa Fe, Argentina'
29
+ match_options:
30
+ tolerance: 10
31
+ ignore_case: true
32
+ - position: CF
33
+ match_options:
34
+ tolerance: 1
35
+ - current_club: Barcelona
36
+ match_options:
37
+ tolerance: 1
38
+ ignore_case: false
39
+ task_form:
40
+ form_title: Enter text from a business card image
41
+ instruction: Description should be written here
42
+ form_fields:
43
+ - label: First Name
44
+ required: true
45
+ field_type: SA
46
+ - label: Middle Name
47
+ field_type: SA
48
+ - label: Last Name
49
+ required: true
50
+ field_type: SA
51
+ - label: Gender
52
+ required: true
53
+ field_type: RB
54
+ option_values:
55
+ - male
56
+ - female
@@ -0,0 +1,40 @@
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: human
17
+ num_workers: 1
18
+ reward: 10
19
+ stat_badge:
20
+ approval_rating: 40
21
+ assignment_duration: 1800
22
+ abandonment_rate: 30
23
+ task_form:
24
+ form_title: Enter text from a business card image
25
+ instruction: Description should be written here
26
+ form_fields:
27
+ - label: First Name
28
+ required: true
29
+ field_type: SA
30
+ - label: Middle Name
31
+ field_type: SA
32
+ - label: Last Name
33
+ required: true
34
+ field_type: SA
35
+ - label: Gender
36
+ required: true
37
+ field_type: RB
38
+ option_values:
39
+ - male
40
+ - female