bot_mob_rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +32 -0
  4. data/app/assets/javascripts/bot_mob/documentation_controller.js +2 -0
  5. data/app/assets/javascripts/bot_mob_rails/application.js +13 -0
  6. data/app/assets/stylesheets/bot_mob/rails/application.css +20 -0
  7. data/app/assets/stylesheets/bot_mob/rails/body.scss +49 -0
  8. data/app/assets/stylesheets/bot_mob/rails/fonts.css +1 -0
  9. data/app/assets/stylesheets/bot_mob/rails/header.scss +34 -0
  10. data/app/assets/stylesheets/bot_mob/rails/layout.scss +51 -0
  11. data/app/assets/stylesheets/bot_mob/rails/privacy.scss +3 -0
  12. data/app/assets/stylesheets/bot_mob/rails/responsivity.scss +13 -0
  13. data/app/assets/stylesheets/bot_mob_rails/application.css +15 -0
  14. data/app/controllers/bot_mob/rails/application_controller.rb +7 -0
  15. data/app/controllers/bot_mob/rails/authentication_controller.rb +23 -0
  16. data/app/controllers/bot_mob/rails/documentation_controller.rb +8 -0
  17. data/app/helpers/bot_mob/rails/application_helper.rb +6 -0
  18. data/app/helpers/bot_mob/rails/documentation_helper.rb +6 -0
  19. data/app/helpers/bot_mob/rails/slack_helper.rb +28 -0
  20. data/app/models/bot_mob/install.rb +6 -0
  21. data/app/views/bot_mob/rails/documentation/index.html.erb +3 -0
  22. data/app/views/layouts/bot_mob/rails/application.html.erb +42 -0
  23. data/config/routes.rb +6 -0
  24. data/db/migrate/20160822232956_create_bot_mob_installs.rb +11 -0
  25. data/lib/bot_mob_rails/engine.rb +7 -0
  26. data/lib/bot_mob_rails/version.rb +5 -0
  27. data/lib/bot_mob_rails.rb +6 -0
  28. data/lib/tasks/bot_mob_rails_tasks.rake +4 -0
  29. data/test/bot_mob_rails_test.rb +7 -0
  30. data/test/controllers/bot_mob/documentation_controller_controller_test.rb +9 -0
  31. data/test/dummy/README.rdoc +28 -0
  32. data/test/dummy/Rakefile +6 -0
  33. data/test/dummy/app/assets/javascripts/application.js +13 -0
  34. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  35. data/test/dummy/app/controllers/application_controller.rb +5 -0
  36. data/test/dummy/app/helpers/application_helper.rb +2 -0
  37. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  38. data/test/dummy/bin/bundle +3 -0
  39. data/test/dummy/bin/rails +4 -0
  40. data/test/dummy/bin/rake +4 -0
  41. data/test/dummy/config/application.rb +23 -0
  42. data/test/dummy/config/boot.rb +5 -0
  43. data/test/dummy/config/database.yml +25 -0
  44. data/test/dummy/config/environment.rb +5 -0
  45. data/test/dummy/config/environments/development.rb +37 -0
  46. data/test/dummy/config/environments/production.rb +78 -0
  47. data/test/dummy/config/environments/test.rb +39 -0
  48. data/test/dummy/config/initializers/assets.rb +8 -0
  49. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  50. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  51. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  52. data/test/dummy/config/initializers/inflections.rb +16 -0
  53. data/test/dummy/config/initializers/mime_types.rb +4 -0
  54. data/test/dummy/config/initializers/session_store.rb +3 -0
  55. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  56. data/test/dummy/config/locales/en.yml +23 -0
  57. data/test/dummy/config/routes.rb +3 -0
  58. data/test/dummy/config/secrets.yml +22 -0
  59. data/test/dummy/config.ru +4 -0
  60. data/test/dummy/db/development.sqlite3 +0 -0
  61. data/test/dummy/db/schema.rb +26 -0
  62. data/test/dummy/db/test.sqlite3 +0 -0
  63. data/test/dummy/log/development.log +3007 -0
  64. data/test/dummy/log/test.log +23 -0
  65. data/test/dummy/public/404.html +67 -0
  66. data/test/dummy/public/422.html +67 -0
  67. data/test/dummy/public/500.html +66 -0
  68. data/test/dummy/public/favicon.ico +0 -0
  69. data/test/dummy/tmp/cache/assets/development/sass/cd357afef6dd16ce8969929b008dff8d89651fef/body.scssc +0 -0
  70. data/test/dummy/tmp/cache/assets/development/sass/cd357afef6dd16ce8969929b008dff8d89651fef/header.scssc +0 -0
  71. data/test/dummy/tmp/cache/assets/development/sass/cd357afef6dd16ce8969929b008dff8d89651fef/layout.scssc +0 -0
  72. data/test/dummy/tmp/cache/assets/development/sass/cd357afef6dd16ce8969929b008dff8d89651fef/privacy.scssc +0 -0
  73. data/test/dummy/tmp/cache/assets/development/sass/cd357afef6dd16ce8969929b008dff8d89651fef/responsivity.scssc +0 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/02614c0d5d5e10c518233fa209f16caf +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/1798740c0bc42cd2d125c389dbf10f6c +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/1fb3ba35dfb9e7361e6a02e2a77e329f +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/2e0bdd20538969b9ca27389b61745917 +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/39c45f1e98556824855e1ea260603d39 +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/52eb4578da2019f3b89f0c4832ebcdb6 +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/6f19d872fd3e50ae9b3a1d9f77cde927 +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/8684c2e031d48fccc34834dbd71871db +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/873c7cb76ddbf69cff492ea0059815cf +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/a16bd85361ff92dc1efa91bcedd47069 +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/b1c2434bbbf20881a0b798ae28d72ecf +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/b3ccb35a4ea56c5592bce4edbf2e4634 +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/b420531b7074c3ce50e80824ec7ad9b5 +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/b84dd1714b3288464ce87d4bef96ccbe +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/c4c2734e277a2609838bb4aa8f9f1767 +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/cfd400f36a908e003a632b22b8e652e1 +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/e1690738db93c0027c7a774fbb2a7564 +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/f11c555a1969a3d1992d29af4df33e96 +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/f14408e0295a58601e53eb73c9a96931 +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/f464e446ae858d2486a7b19b402fd167 +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/fb8922cb5177ecafec9945db561327ea +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6x/6xa7Qk4BZ-kN9z0_hMdlwXMuQ2ihNnMa9YlGEgw9ps0.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7P/7PYI_OmVWAHVRq7yxJAz9ixi3j5oiKCo6Voet5cu2t8.cache +1 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7a/7aPTB6EoTtmRK7tM41exLq51QVSwXEINKjl99wLE3Eo.cache +2 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CZ/CZMo9FAN-4YG9s63U7sN8sOdhw0tKVGhi_U2TqW5jdY.cache +1 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Ft/Ftfl3J7IjANHIISdTRf3bVMwfwo_qDDRrn9weuRUOzE.cache +1 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GV/GVoA_Lb_pZJEq-FmUCURajsbt1uikDJDfRXlOMY2WWw.cache +1 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/I9/I9jJKZmV6uzmvnBEC0-zFcS_XMuHZu2HLXPrF0Q5zhM.cache +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Ib/IbsFF84tDTvkYwb32XyTMVFQm2Z1HVaqRkU3sqN09_w.cache +1 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/O-/O-OCaexzb-JrNSFufC-bfFst1au0DAFxoFjOY3lW7qA.cache +1 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Q1/Q1xN5aCbp2JNHK6cBLP08upw-blW0lOSmW7bZnY6xW4.cache +2 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QB/QBIL2YvNSF6S8pUMfIITmBsZmxnw3IUngNRMv7uAefs.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SX/SX1hAgXE1dEP5UcX5D-N7_xfrtrA0-beoStGQTp7vdc.cache +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/St/StTAKcTGhtikQyTxBTAEqrqw-JeGiHj5eCa6EfqCFX4.cache +1 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/U_/U_oZoud8j7ZAhpbBolbs56zetOGF8807zFE8haOfbrc.cache +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Y4/Y4NwKgDcHFfaoSKMCP521pFoLrV2s6kbpCuuGQGHsQ4.cache +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Zo/Zo4JMXCzWyPVQe8O44BfMsVheeuMjeyvBLkXs9HgYSg.cache +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/aG/aG1-rImy_qI6kL6LdJYmpTap4kHrxfDoML28pQLd-ZQ.cache +1 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/eO/eO9-5tDXft0NfrYQpmeQ_4vDeica0im3FENqIRK3ajc.cache +3 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fl/fl7KphvI6X39yLUsNy5JhEPYM3iMawAf9g_jJ0LV5Fw.cache +1 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jg/jgLw5qXfO9Rqm2mlEhZ5ECbq9763waE-Jq4llZj3L6M.cache +2 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/l1/l1HmRUQ72BhS846swsvpHumDaZ_ovpdlkgmrSpDMkn8.cache +1 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/lJ/lJnSfnhNfqlDYwi8bsBJGltkH9-3dL0y1CKf3HI30uQ.cache +2 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/lo/lovLJmHqBTcEZbjeY9QBetoerjsIqcaO9UeFXX6F3CM.cache +3 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/oc/oc6Dp3Z4kWAv6468BSrQzE-Jz0MYaOrrWX-QW_kijS4.cache +3 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pz/pzKe1NF0GjqPatxKLnxBU-1s1YUWbgi_spOc6u-R08I.cache +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/r3/r3SCY8okbFCTdPxPz2Vy116jPL2r8fCCqVYfJ1qHfWA.cache +1 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xV/xVJE1BsHW_tquPkSHVTvwnyjMF8jobPOTn6_LULMdZU.cache +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xc/xc8qruiUXemVtzfkKPmgds-Djf2LwvnsYILO3eB4cuk.cache +1 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xd/xdGhh1YHwj2Xdj_eFFx5hX8FsF1e7t10SVl3sr0Dbvc.cache +0 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/zY/zYZwL3W-wzZOKoxcyWW6Flv10zMUdsoeWFYVTdMUZt8.cache +1 -0
  125. data/test/dummy/tmp/pids/server.pid +1 -0
  126. data/test/fixtures/bot_mob/installs.yml +11 -0
  127. data/test/helpers/bot_mob/documentation_controller_helper_test.rb +6 -0
  128. data/test/integration/navigation_test.rb +10 -0
  129. data/test/models/bot_mob/install_test.rb +9 -0
  130. data/test/test_helper.rb +19 -0
  131. metadata +331 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 60b1b0fe136b4798a8e9ff3250787a0ff833daaa
4
+ data.tar.gz: 3250a3548331267872a74fdc2f7185ac6fae6cea
5
+ SHA512:
6
+ metadata.gz: 214e8659483c9c7ee07c3d27b9b8533d558b907e837c7b4bf9f66adc65a457b6c9cf6df2f9007fcaab00512066c7e684ab0c5a73854a6bd84114c13deb3dcf8d
7
+ data.tar.gz: e2cc47c3499ad8cd3c567c83c82a244c516a30b676fec393df2fd3f35cd2eca7037002dfad677a1d6156664c96173f04fcb8cc0eb8f593ee38535ef491e7dfa1
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 Matthew Werner
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'BotMob::Rails'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
22
+ require 'rake/testtask'
23
+
24
+ Rake::TestTask.new(:test) do |t|
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
29
+ end
30
+
31
+
32
+ task default: :test
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,20 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require ./fonts
14
+ *= require ./layout
15
+ *= require ./header
16
+ *= require ./body
17
+ *= require ./privacy
18
+ *= require ./responsivity
19
+ *= require_self
20
+ */
@@ -0,0 +1,49 @@
1
+ .inner {
2
+ max-width: 640px;
3
+ margin: 0 auto;
4
+ }
5
+
6
+ #main {
7
+ text-align: center;
8
+ h3 {
9
+ font-size: 20px;
10
+ font-weight: 300;
11
+ margin: 50px 0;
12
+ color: rgba(0, 0, 0, 0.88);
13
+ }
14
+ p {
15
+ font-size: 16px;
16
+ color: rgba(0, 0, 0, 0.64);
17
+ line-height: 24px;
18
+ margin-bottom: 16px;
19
+ }
20
+ .screenshot {
21
+ width: 100%;
22
+ }
23
+ }
24
+
25
+ .section {
26
+ margin-bottom: 72px;
27
+ p {
28
+ font-size: 15px;
29
+ line-height: 24px;
30
+ font-family: 'Helvetica Neue', Arial;
31
+ }
32
+ }
33
+
34
+ .privacy p, .privacy h3, .privacy ol {
35
+ margin-bottom: 24px;
36
+ line-height: 24px;
37
+ }
38
+
39
+ #document {
40
+ text-align: left;
41
+ }
42
+
43
+ #footer {
44
+ padding: 50px 0;
45
+ text-align: center;
46
+ a {
47
+ margin: 0 10px;
48
+ }
49
+ }
@@ -0,0 +1 @@
1
+ @import 'https://fonts.googleapis.com/css?family=Montserrat:400,700';
@@ -0,0 +1,34 @@
1
+ #header {
2
+ padding: 72px 0 48px;
3
+ line-height: 24px;
4
+ line-height: 28px;
5
+ text-align: left;
6
+ border-bottom: 1px solid #ddd;
7
+ padding: 10px;
8
+ margin: 30px 0;
9
+
10
+ h1 {
11
+ margin: 12px 0 0;
12
+ float: left;
13
+ font-size: 18px;
14
+ a {
15
+ color: #000;
16
+ }
17
+ }
18
+ .slack_button {
19
+ float: right
20
+ }
21
+ }
22
+
23
+ #header:before,
24
+ #header:after {
25
+ content: "";
26
+ display: table;
27
+ }
28
+ #header:after {
29
+ clear: both;
30
+ }
31
+ #header {
32
+ clear: both;
33
+ *zoom: 1;
34
+ }
@@ -0,0 +1,51 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ list-style: none;
5
+ text-decoration: none;
6
+ border: none;
7
+ outline: none;
8
+ -webkit-font-smoothing: antialiased;
9
+ box-sizing: border-box;
10
+ -moz-box-sizing: border-box;
11
+ -webkit-box-sizing: border-box;
12
+ -webkit-text-size-adjust: none;
13
+ letter-spacing: .2px;
14
+ font-size: 15px;
15
+ }
16
+
17
+ html, body {
18
+ width: 100%;
19
+ overflow-x: hidden;
20
+ font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
21
+ background: #ffffff;
22
+ }
23
+
24
+ a {
25
+ color: #327cce;
26
+ &:visited {
27
+ color: #899eb5;
28
+ }
29
+ &:hover {
30
+ color: #2682e6;
31
+ }
32
+ }
33
+
34
+ code {
35
+ background: #eee;
36
+ padding: 0 2px;
37
+ border-radius: 2px;
38
+ border: 1px solid #ddd;
39
+ color: #7a8ab9;
40
+ }
41
+
42
+ h3 {
43
+ font-weight: 400;
44
+ font-size: 20px;
45
+ margin-bottom: 16px;
46
+ }
47
+ h4 {
48
+ font-size: 22px;
49
+ font-weight: 400;
50
+ margin: 30px 0 5px;
51
+ }
@@ -0,0 +1,3 @@
1
+ #privacy {
2
+ text-align: left;
3
+ }
@@ -0,0 +1,13 @@
1
+ @media screen and (max-width: 720px) {
2
+ #main {
3
+ p {
4
+ padding: 0;
5
+ }
6
+ h2 {
7
+ font-size: 24px;
8
+ }
9
+ .screenshot {
10
+ width: 100%;
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,7 @@
1
+ module BotMob
2
+ module Rails
3
+ class ApplicationController < ActionController::Base
4
+ protect_from_forgery with: :exception
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,23 @@
1
+ require_dependency "bot_mob/rails/application_controller"
2
+
3
+ module BotMob
4
+ module Rails
5
+ class AuthenticationController < ApplicationController
6
+ def index
7
+ BotMob.roster.authority.process(bot)
8
+
9
+ redirect_to setup_path, notice: 'Thanks for installing!'
10
+ end
11
+
12
+ private
13
+
14
+ def authority
15
+ @authority ||= BotMob::Authority.new(network, params[:code])
16
+ end
17
+
18
+ def network
19
+ params[:network].to_s.to_sym
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,8 @@
1
+ require_dependency "bot_mob/rails/application_controller"
2
+
3
+ module BotMob
4
+ module Rails
5
+ class DocumentationController < ApplicationController
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ module BotMob
2
+ module Rails
3
+ module ApplicationHelper
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module BotMob
2
+ module Rails
3
+ module DocumentationHelper
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,28 @@
1
+ module BotMob
2
+ module Rails
3
+ module SlackHelper
4
+ URL = 'https://slack.com/oauth/authorize'
5
+
6
+ def slack_button(*scopes)
7
+ params = URI.encode_www_form({
8
+ client_id: ENV['SLACK_CLIENT_ID'],
9
+ scope: scopes.join(' ')
10
+ })
11
+
12
+ content_tag(:a, button, href: "#{URL}?#{params}", class: 'slack_button').html_safe
13
+ end
14
+
15
+ private
16
+
17
+ def button
18
+ content_tag(:img, nil, {
19
+ alt: 'Add to Slack',
20
+ height: 40,
21
+ width: 139,
22
+ src: 'https://platform.slack-edge.com/img/add_to_slack.png',
23
+ srcset: 'https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x'
24
+ })
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,6 @@
1
+ module BotMob
2
+ module Rails
3
+ class Install < ActiveRecord::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ <h3>Ticker Symbols in your Slack</h3>
2
+
3
+ <%= image_tag 'screenshot.png', class: 'screenshot' %>
@@ -0,0 +1,42 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <title>BotMob</title>
6
+ <%= csrf_meta_tags %>
7
+ <meta charset="utf-8">
8
+ <link rel="icon" type="image/png" href="/assets/favicon.png">
9
+ <meta name="description" content="">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
11
+ <%= stylesheet_link_tag "bot_mob/rails/application", media: "all" %>
12
+ <%= javascript_include_tag "bot_mob/rails/application" %>
13
+ </head>
14
+
15
+ <body class="index" style="zoom: 1;">
16
+ <div class="inner">
17
+ <div id="header">
18
+ <h1><%= link_to '📈 BotMob', root_path %></h1>
19
+
20
+ <%= slack_button('bot', 'incoming-webhook') %>
21
+ </div>
22
+
23
+ <div>
24
+ <% if flash[:notice] %>
25
+ <span><%= flash[:notice] %></span>
26
+ <% end %>
27
+ <% if flash[:error] %>
28
+ <span><%= flash[:error] %></span>
29
+ <% end %>
30
+ </div>
31
+
32
+ <div id="main">
33
+ <%= yield %>
34
+ </div>
35
+ </div>
36
+
37
+ <div id="footer">
38
+ <%= link_to 'Home', root_path %>
39
+ <%= link_to 'Setup', setup_path %>
40
+ </div>
41
+ </body>
42
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,6 @@
1
+ BotMob::Rails::Engine.routes.draw do
2
+ get '/:network/callback' => 'authentication#callback', as: :callback
3
+ get '/setup' => 'documentation#setup', as: :setup
4
+
5
+ root 'documentation#index'
6
+ end
@@ -0,0 +1,11 @@
1
+ class CreateBotMobInstalls < ActiveRecord::Migration
2
+ def change
3
+ create_table :bot_mob_installs do |t|
4
+ t.string :bot_class, required: true
5
+ t.string :external_id, required: true
6
+ t.text :token, required: true
7
+ t.timestamps null: false
8
+ end
9
+ add_index :bot_mob_installs, :external_id
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ module BotMob
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace BotMob::Rails
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module BotMob
2
+ module Rails
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ require "bot_mob_rails/engine"
2
+
3
+ module BotMob
4
+ module Rails
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :bot_mob_rails do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class BotMobRailsTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, BotMob::Rails
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module BotMob::Rails
4
+ class DocumentationControllerControllerTest < ActionController::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "bot_mob_rails"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+ end
22
+ end
23
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3