houston-core 0.8.4 → 0.9.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +72 -78
  4. data/app/assets/javascripts/houston/app/models/role.coffee +4 -0
  5. data/app/assets/javascripts/houston/app/views/nested_resources.coffee +44 -0
  6. data/app/assets/javascripts/houston/app/views/team_roles_view.coffee +10 -0
  7. data/app/assets/javascripts/houston/application.js +3 -1
  8. data/app/assets/javascripts/houston/core/ajax_helpers.coffee +26 -0
  9. data/app/assets/javascripts/houston/core/app.coffee +0 -45
  10. data/app/assets/javascripts/houston/core/errors.coffee +1 -12
  11. data/app/assets/javascripts/houston/core/handlebars_helpers.coffee +8 -70
  12. data/app/assets/javascripts/houston/core/jquery_extensions.coffee +0 -138
  13. data/app/assets/javascripts/houston/core/timeline_helpers.coffee +44 -0
  14. data/app/assets/javascripts/houston/core/uploader_helpers.coffee +99 -0
  15. data/app/assets/javascripts/houston/vendor.js +26 -9
  16. data/app/assets/stylesheets/houston/application/actions.scss +22 -0
  17. data/app/assets/stylesheets/houston/application/navigation.scss +2 -2
  18. data/app/assets/stylesheets/houston/application/{freight_train.css.scss → nested_resources.scss} +1 -0
  19. data/app/assets/stylesheets/houston/core/alerts.scss +0 -4
  20. data/app/assets/stylesheets/houston/core/timeline.scss +204 -0
  21. data/app/assets/templates/houston/teams/roles/index.hbs +1 -0
  22. data/app/assets/templates/houston/teams/roles/show.hbs +19 -0
  23. data/app/channels/events_channel.rb +1 -1
  24. data/app/concerns/houston/props.rb +3 -2
  25. data/app/controllers/actions_controller.rb +8 -3
  26. data/app/controllers/application_controller.rb +9 -12
  27. data/app/controllers/authorizations_controller.rb +41 -14
  28. data/app/controllers/errors_controller.rb +3 -3
  29. data/app/controllers/project_follows_controller.rb +23 -0
  30. data/app/controllers/project_options_controller.rb +1 -1
  31. data/app/controllers/user_options_controller.rb +1 -1
  32. data/app/helpers/actions_helper.rb +12 -0
  33. data/app/helpers/application_helper.rb +0 -10
  34. data/app/helpers/layout_helper.rb +20 -0
  35. data/app/helpers/markdown_helper.rb +2 -10
  36. data/app/helpers/navigation_helper.rb +5 -5
  37. data/app/helpers/project_helper.rb +6 -0
  38. data/app/helpers/url_helper.rb +4 -4
  39. data/app/helpers/view_extensions_helper.rb +20 -0
  40. data/app/models/action.rb +61 -44
  41. data/app/models/authorization.rb +55 -10
  42. data/app/models/follow.rb +6 -0
  43. data/app/models/persistent_trigger.rb +11 -1
  44. data/app/models/project.rb +5 -27
  45. data/app/models/user.rb +15 -59
  46. data/app/presenters/project_presenter.rb +2 -2
  47. data/app/views/actions/_actions.html.erb +8 -5
  48. data/app/views/actions/index.html.erb +1 -1
  49. data/app/views/actions/running.html.erb +9 -15
  50. data/app/views/actions/show.html.erb +6 -3
  51. data/app/views/actions/unqueued.html.erb +41 -0
  52. data/app/views/authorizations/_form.html.erb +28 -16
  53. data/app/views/authorizations/index.html.erb +9 -4
  54. data/app/views/{oauth/providers/edit.html.erb → authorizations/oauth2_callback.html.erb} +3 -2
  55. data/app/views/devise/sessions/new.html.erb +0 -8
  56. data/app/views/errors/index.html.erb +9 -5
  57. data/app/views/layouts/_navigation.html.erb +9 -0
  58. data/app/views/layouts/application.html.erb +11 -6
  59. data/app/views/layouts/dashboard.html.erb +9 -0
  60. data/app/views/projects/_form.html.erb +7 -18
  61. data/app/views/projects/_header.html.erb +2 -6
  62. data/app/views/projects/index.html.erb +4 -4
  63. data/app/views/teams/_form.html.erb +7 -17
  64. data/app/views/teams/index.html.erb +1 -1
  65. data/app/views/users/_form.html.erb +1 -38
  66. data/config/application.rb +8 -5
  67. data/config/initializers/devise.rb +0 -14
  68. data/config/initializers/secret_token.rb +8 -13
  69. data/config/routes.rb +12 -28
  70. data/db/migrate/20130706141443_drop_deprecated_project_roles.rb +5 -1
  71. data/db/migrate/20170118005958_remove_antecedents_from_versions_of_tickets.rb +1 -1
  72. data/db/migrate/20170130011016_drop_users_environments_subscribed_to.rb +9 -0
  73. data/db/migrate/20170205004452_drop_settings.rb +12 -0
  74. data/db/migrate/20170206002030_drop_extension_hstore.rb +9 -0
  75. data/db/migrate/20170206002732_drop_legacy_columns_from_users.rb +10 -0
  76. data/db/migrate/20170209022159_rename_projects_color_to_color_name.rb +5 -0
  77. data/db/migrate/20170213001453_change_providers_from_models_to_extensions.rb +27 -0
  78. data/db/migrate/20170215012012_add_props_to_authorizations.rb +5 -0
  79. data/db/migrate/20170216041034_add_user_to_persistent_triggers.rb +5 -0
  80. data/db/migrate/20170226201504_create_follows.rb +20 -0
  81. data/db/migrate/20170301014051_drop_name_from_authorizations.rb +9 -0
  82. data/db/migrate/20170307032041_add_created_at_to_actions.rb +11 -0
  83. data/db/migrate/20170307035755_allow_actions_started_at_to_be_null.rb +5 -0
  84. data/db/migrate/20170310024505_replace_authorizations_provider_name_with_type.rb +12 -0
  85. data/db/migrate/20170329030329_drop_consumer_tokens.rb +9 -0
  86. data/db/structure.sql +187 -212
  87. data/houston-core.gemspec +10 -13
  88. data/lib/houston/boot.rb +1 -4
  89. data/lib/houston/boot/actions.rb +24 -21
  90. data/lib/houston/boot/configuration.rb +46 -113
  91. data/lib/houston/boot/extensions.rb +54 -341
  92. data/lib/houston/boot/extensions/deprecated.rb +194 -0
  93. data/lib/houston/boot/extensions/dsl.rb +99 -0
  94. data/lib/houston/boot/extensions/events.rb +81 -0
  95. data/lib/houston/boot/extensions/features.rb +42 -0
  96. data/lib/houston/boot/extensions/layout.rb +70 -0
  97. data/lib/houston/boot/extensions/navigation.rb +42 -0
  98. data/lib/houston/boot/extensions/oauth.rb +62 -0
  99. data/lib/houston/boot/extensions/serializers.rb +29 -0
  100. data/lib/houston/boot/extensions/view.rb +34 -0
  101. data/lib/houston/boot/observer.rb +10 -5
  102. data/{app/models/oauth → lib/houston/boot}/provider.rb +7 -5
  103. data/lib/houston/boot/running_as.rb +0 -5
  104. data/lib/houston/boot/serializer.rb +12 -6
  105. data/lib/houston/boot/{active_record_serializer.rb → serializers/active_record_serializer.rb} +0 -2
  106. data/lib/houston/boot/{readonly_hash_serializer.rb → serializers/readonly_hash_serializer.rb} +0 -2
  107. data/lib/houston/boot/timer.rb +10 -0
  108. data/lib/houston/boot/triggers.rb +27 -8
  109. data/lib/houston/version.rb +1 -1
  110. data/templates/new-instance/.gitignore +0 -4
  111. data/templates/new-instance/config/main.rb +8 -10
  112. data/templates/new-module/test/dummy/houston.rb +1 -0
  113. data/test/acceptance/layout_test.rb +58 -0
  114. data/test/acceptance/updating_props_test.rb +72 -0
  115. data/test/support/config.rb +1 -0
  116. data/test/unit/extensions/events_extension_test.rb +33 -0
  117. data/test/unit/extensions/layout_extension_test.rb +74 -0
  118. data/test/unit/extensions/navigation_extension_test.rb +62 -0
  119. data/test/unit/extensions/oauth_extension_test.rb +91 -0
  120. data/test/unit/extensions/project_features_extension_test.rb +79 -0
  121. data/test/unit/extensions/serializers_extension_test.rb +47 -0
  122. data/test/unit/extensions/view_extension_test.rb +98 -0
  123. data/test/unit/models/actions_test.rb +11 -5
  124. data/test/unit/models/configuration_test.rb +0 -8
  125. data/test/unit/models/observer_test.rb +16 -0
  126. data/test/unit/models/persistent_trigger_test.rb +29 -2
  127. data/test/unit/models/serializer_test.rb +6 -0
  128. data/test/unit/models/timer_test.rb +88 -0
  129. metadata +87 -168
  130. data/app/assets/font/octicons.eot +0 -0
  131. data/app/assets/font/octicons.svg +0 -198
  132. data/app/assets/font/octicons.ttf +0 -0
  133. data/app/assets/font/octicons.woff +0 -0
  134. data/app/assets/font/roboto-black-webfont.eot +0 -0
  135. data/app/assets/font/roboto-black-webfont.svg +0 -675
  136. data/app/assets/font/roboto-black-webfont.ttf +0 -0
  137. data/app/assets/font/roboto-black-webfont.woff +0 -0
  138. data/app/assets/font/roboto-blackitalic-webfont.eot +0 -0
  139. data/app/assets/font/roboto-blackitalic-webfont.svg +0 -677
  140. data/app/assets/font/roboto-blackitalic-webfont.ttf +0 -0
  141. data/app/assets/font/roboto-blackitalic-webfont.woff +0 -0
  142. data/app/assets/font/roboto-bold-webfont.eot +0 -0
  143. data/app/assets/font/roboto-bold-webfont.svg +0 -675
  144. data/app/assets/font/roboto-bold-webfont.ttf +0 -0
  145. data/app/assets/font/roboto-bold-webfont.woff +0 -0
  146. data/app/assets/font/roboto-bolditalic-webfont.eot +0 -0
  147. data/app/assets/font/roboto-bolditalic-webfont.svg +0 -677
  148. data/app/assets/font/roboto-bolditalic-webfont.ttf +0 -0
  149. data/app/assets/font/roboto-bolditalic-webfont.woff +0 -0
  150. data/app/assets/font/roboto-italic-webfont.eot +0 -0
  151. data/app/assets/font/roboto-italic-webfont.svg +0 -668
  152. data/app/assets/font/roboto-italic-webfont.ttf +0 -0
  153. data/app/assets/font/roboto-italic-webfont.woff +0 -0
  154. data/app/assets/font/roboto-light-webfont.eot +0 -0
  155. data/app/assets/font/roboto-light-webfont.svg +0 -666
  156. data/app/assets/font/roboto-light-webfont.ttf +0 -0
  157. data/app/assets/font/roboto-light-webfont.woff +0 -0
  158. data/app/assets/font/roboto-lightitalic-webfont.eot +0 -0
  159. data/app/assets/font/roboto-lightitalic-webfont.svg +0 -668
  160. data/app/assets/font/roboto-lightitalic-webfont.ttf +0 -0
  161. data/app/assets/font/roboto-lightitalic-webfont.woff +0 -0
  162. data/app/assets/font/roboto-medium-webfont.eot +0 -0
  163. data/app/assets/font/roboto-medium-webfont.svg +0 -675
  164. data/app/assets/font/roboto-medium-webfont.ttf +0 -0
  165. data/app/assets/font/roboto-medium-webfont.woff +0 -0
  166. data/app/assets/font/roboto-mediumitalic-webfont.eot +0 -0
  167. data/app/assets/font/roboto-mediumitalic-webfont.svg +0 -677
  168. data/app/assets/font/roboto-mediumitalic-webfont.ttf +0 -0
  169. data/app/assets/font/roboto-mediumitalic-webfont.woff +0 -0
  170. data/app/assets/font/roboto-regular-webfont.eot +0 -0
  171. data/app/assets/font/roboto-regular-webfont.svg +0 -666
  172. data/app/assets/font/roboto-regular-webfont.ttf +0 -0
  173. data/app/assets/font/roboto-regular-webfont.woff +0 -0
  174. data/app/assets/font/roboto-thin-webfont.eot +0 -0
  175. data/app/assets/font/roboto-thin-webfont.svg +0 -666
  176. data/app/assets/font/roboto-thin-webfont.ttf +0 -0
  177. data/app/assets/font/roboto-thin-webfont.woff +0 -0
  178. data/app/assets/font/roboto-thinitalic-webfont.eot +0 -0
  179. data/app/assets/font/roboto-thinitalic-webfont.svg +0 -668
  180. data/app/assets/font/roboto-thinitalic-webfont.ttf +0 -0
  181. data/app/assets/font/roboto-thinitalic-webfont.woff +0 -0
  182. data/app/assets/images/bug-fixed-128.png +0 -0
  183. data/app/assets/images/bug-fixed-32.png +0 -0
  184. data/app/assets/images/bug-fixed-48.png +0 -0
  185. data/app/assets/images/bug-new-128.png +0 -0
  186. data/app/assets/images/bug-new-32.png +0 -0
  187. data/app/assets/images/bug-new-48.png +0 -0
  188. data/app/assets/images/bug-open-32.png +0 -0
  189. data/app/assets/images/bug-zero-128.png +0 -0
  190. data/app/assets/images/bug-zero-48.png +0 -0
  191. data/app/assets/images/drag-grip.png +0 -0
  192. data/app/assets/javascripts/houston/core/burndown_chart.coffee +0 -111
  193. data/app/assets/javascripts/houston/core/stacked_area_graph.coffee +0 -113
  194. data/app/assets/javascripts/houston/core/stacked_bar_graph.coffee +0 -108
  195. data/app/assets/stylesheets/houston/application/project_tiles.scss +0 -26
  196. data/app/assets/stylesheets/houston/application/tips.scss +0 -5
  197. data/app/assets/stylesheets/houston/core/octicons-icons.scss +0 -221
  198. data/app/assets/stylesheets/houston/core/octicons.scss.erb +0 -9
  199. data/app/assets/stylesheets/houston/core/roboto.scss.erb +0 -131
  200. data/app/concerns/historical_weekly_stats.rb +0 -15
  201. data/app/concerns/nosync.rb +0 -21
  202. data/app/controllers/oauth/providers_controller.rb +0 -45
  203. data/app/controllers/project_roles_controller.rb +0 -22
  204. data/app/controllers/settings_controller.rb +0 -14
  205. data/app/controllers/tester_bar_controller.rb +0 -12
  206. data/app/controllers/user_credentials_controller.rb +0 -24
  207. data/app/models/role.rb +0 -33
  208. data/app/models/setting.rb +0 -10
  209. data/app/models/settings.rb +0 -38
  210. data/app/models/slackdown.rb +0 -23
  211. data/app/models/user_credentials.rb +0 -27
  212. data/app/views/errors/_actions.html.erb +0 -17
  213. data/app/views/layouts/_tester_bar.html.erb +0 -6
  214. data/app/views/layouts/minimal.html.erb +0 -50
  215. data/app/views/layouts/naked.html.erb +0 -47
  216. data/app/views/layouts/naked_dashboard.html.erb +0 -50
  217. data/app/views/oauth/providers/_form.html.erb +0 -54
  218. data/app/views/oauth/providers/index.html.erb +0 -41
  219. data/app/views/oauth/providers/new.html.erb +0 -7
  220. data/config/initializers/add_navigation_renderers.rb +0 -5
  221. data/config/initializers/vestal_versions.rb +0 -9
  222. data/db/migrate/20130519163615_create_user_credentials.rb +0 -18
  223. data/lib/houston/boot/events.rb +0 -10
  224. data/lib/tasks/keypair.rake +0 -17
  225. data/vendor/assets/javascripts/jquery.pjax.js +0 -817
@@ -1,9 +0,0 @@
1
- @font-face {
2
- font-family: 'octicons';
3
- src: url('<%= font_path("octicons.eot") %>?#iefix') format('embedded-opentype'),
4
- url('<%= font_path("octicons.woff") %>') format('woff'),
5
- url('<%= font_path("octicons.ttf") %>') format('truetype'),
6
- url('<%= font_path("octicons.svg") %>#octicons') format('svg');
7
- font-weight: normal;
8
- font-style: normal;
9
- }
@@ -1,131 +0,0 @@
1
- @font-face {
2
- font-family: 'roboto';
3
- src: url('<%= font_path("roboto-black-webfont.eot") %>');
4
- src: url('<%= font_path("roboto-black-webfont.eot") %>?#iefix') format('embedded-opentype'),
5
- url('<%= font_path("roboto-black-webfont.woff") %>') format('woff'),
6
- url('<%= font_path("roboto-black-webfont.ttf") %>') format('truetype'),
7
- url('<%= font_path("roboto-black-webfont.svg") %>#robotoblack') format('svg');
8
- font-weight: 900;
9
- font-style: normal;
10
- }
11
-
12
- @font-face {
13
- font-family: 'roboto';
14
- src: url('<%= font_path("roboto-light-webfont.eot") %>');
15
- src: url('<%= font_path("roboto-light-webfont.eot") %>?#iefix') format('embedded-opentype'),
16
- url('<%= font_path("roboto-light-webfont.woff") %>') format('woff'),
17
- url('<%= font_path("roboto-light-webfont.ttf") %>') format('truetype'),
18
- url('<%= font_path("roboto-light-webfont.svg") %>#robotolight') format('svg');
19
- font-weight: 200;
20
- font-style: normal;
21
- }
22
-
23
- @font-face {
24
- font-family: 'roboto';
25
- src: url('<%= font_path("roboto-bold-webfont.eot") %>');
26
- src: url('<%= font_path("roboto-bold-webfont.eot") %>?#iefix') format('embedded-opentype'),
27
- url('<%= font_path("roboto-bold-webfont.woff") %>') format('woff'),
28
- url('<%= font_path("roboto-bold-webfont.ttf") %>') format('truetype'),
29
- url('<%= font_path("roboto-bold-webfont.svg") %>#robotobold') format('svg');
30
- font-weight: 700;
31
- font-style: normal;
32
- }
33
-
34
- @font-face {
35
- font-family: 'roboto';
36
- src: url('<%= font_path("roboto-italic-webfont.eot") %>');
37
- src: url('<%= font_path("roboto-italic-webfont.eot") %>?#iefix') format('embedded-opentype'),
38
- url('<%= font_path("roboto-italic-webfont.woff") %>') format('woff'),
39
- url('<%= font_path("roboto-italic-webfont.ttf") %>') format('truetype'),
40
- url('<%= font_path("roboto-italic-webfont.svg") %>#robotoitalic') format('svg');
41
- font-weight: normal;
42
- font-style: italic;
43
- }
44
-
45
- @font-face {
46
- font-family: 'roboto';
47
- src: url('<%= font_path("roboto-blackitalic-webfont.eot") %>');
48
- src: url('<%= font_path("roboto-blackitalic-webfont.eot") %>?#iefix') format('embedded-opentype'),
49
- url('<%= font_path("roboto-blackitalic-webfont.woff") %>') format('woff'),
50
- url('<%= font_path("roboto-blackitalic-webfont.ttf") %>') format('truetype'),
51
- url('<%= font_path("roboto-blackitalic-webfont.svg") %>#robotoblack_italic') format('svg');
52
- font-weight: 900;
53
- font-style: italic;
54
- }
55
-
56
- @font-face {
57
- font-family: 'roboto';
58
- src: url('<%= font_path("roboto-regular-webfont.eot") %>');
59
- src: url('<%= font_path("roboto-regular-webfont.eot") %>?#iefix') format('embedded-opentype'),
60
- url('<%= font_path("roboto-regular-webfont.woff") %>') format('woff'),
61
- url('<%= font_path("roboto-regular-webfont.ttf") %>') format('truetype'),
62
- url('<%= font_path("roboto-regular-webfont.svg") %>#robotoregular') format('svg');
63
- font-weight: 400;
64
- font-style: normal;
65
- }
66
-
67
- @font-face {
68
- font-family: 'roboto';
69
- src: url('<%= font_path("roboto-bolditalic-webfont.eot") %>');
70
- src: url('<%= font_path("roboto-bolditalic-webfont.eot") %>?#iefix') format('embedded-opentype'),
71
- url('<%= font_path("roboto-bolditalic-webfont.woff") %>') format('woff'),
72
- url('<%= font_path("roboto-bolditalic-webfont.ttf") %>') format('truetype'),
73
- url('<%= font_path("roboto-bolditalic-webfont.svg") %>#robotobold_italic') format('svg');
74
- font-weight: 700;
75
- font-style: italic;
76
- }
77
-
78
- @font-face {
79
- font-family: 'roboto';
80
- src: url('<%= font_path("roboto-thin-webfont.eot") %>');
81
- src: url('<%= font_path("roboto-thin-webfont.eot") %>?#iefix') format('embedded-opentype'),
82
- url('<%= font_path("roboto-thin-webfont.woff") %>') format('woff'),
83
- url('<%= font_path("roboto-thin-webfont.ttf") %>') format('truetype'),
84
- url('<%= font_path("roboto-thin-webfont.svg") %>#robotothin') format('svg');
85
- font-weight: 100;
86
- font-style: normal;
87
- }
88
-
89
- @font-face {
90
- font-family: 'roboto';
91
- src: url('<%= font_path("roboto-mediumitalic-webfont.eot") %>');
92
- src: url('<%= font_path("roboto-mediumitalic-webfont.eot") %>?#iefix') format('embedded-opentype'),
93
- url('<%= font_path("roboto-mediumitalic-webfont.woff") %>') format('woff'),
94
- url('<%= font_path("roboto-mediumitalic-webfont.ttf") %>') format('truetype'),
95
- url('<%= font_path("roboto-mediumitalic-webfont.svg") %>#robotomedium_italic') format('svg');
96
- font-weight: 500;
97
- font-style: italic;
98
- }
99
-
100
- @font-face {
101
- font-family: 'roboto';
102
- src: url('<%= font_path("roboto-medium-webfont.eot") %>');
103
- src: url('<%= font_path("roboto-medium-webfont.eot") %>?#iefix') format('embedded-opentype'),
104
- url('<%= font_path("roboto-medium-webfont.woff") %>') format('woff'),
105
- url('<%= font_path("roboto-medium-webfont.ttf") %>') format('truetype'),
106
- url('<%= font_path("roboto-medium-webfont.svg") %>#robotomedium') format('svg');
107
- font-weight: 500;
108
- font-style: normal;
109
- }
110
-
111
- @font-face {
112
- font-family: 'roboto';
113
- src: url('<%= font_path("roboto-thinitalic-webfont.eot") %>');
114
- src: url('<%= font_path("roboto-thinitalic-webfont.eot") %>?#iefix') format('embedded-opentype'),
115
- url('<%= font_path("roboto-thinitalic-webfont.woff") %>') format('woff'),
116
- url('<%= font_path("roboto-thinitalic-webfont.ttf") %>') format('truetype'),
117
- url('<%= font_path("roboto-thinitalic-webfont.svg") %>#robotothin_italic') format('svg');
118
- font-weight: 100;
119
- font-style: italic;
120
- }
121
-
122
- @font-face {
123
- font-family: 'roboto';
124
- src: url('<%= font_path("roboto-lightitalic-webfont.eot") %>');
125
- src: url('<%= font_path("roboto-lightitalic-webfont.eot") %>?#iefix') format('embedded-opentype'),
126
- url('<%= font_path("roboto-lightitalic-webfont.woff") %>') format('woff'),
127
- url('<%= font_path("roboto-lightitalic-webfont.ttf") %>') format('truetype'),
128
- url('<%= font_path("roboto-lightitalic-webfont.svg") %>#robotolight_italic') format('svg');
129
- font-weight: 200;
130
- font-style: italic;
131
- }
@@ -1,15 +0,0 @@
1
- module HistoricalWeeklyStats
2
-
3
- def history_range
4
- @history_range ||= ((weeks_of_history - 1).weeks.before(this_week.begin))..this_week.end
5
- end
6
-
7
- def history_weeks
8
- @history_weeks ||= history_range.step(7)
9
- end
10
-
11
- def new_history_vector
12
- Hash[history_weeks.zip([0] * weeks_of_history)]
13
- end
14
-
15
- end
@@ -1,21 +0,0 @@
1
- module Nosync
2
-
3
- def nosync
4
- value = nosync?
5
- begin
6
- self.nosync = true
7
- yield
8
- ensure
9
- self.nosync = value
10
- end
11
- end
12
-
13
- def nosync=(value)
14
- @nosync = value
15
- end
16
-
17
- def nosync?
18
- !!@nosync
19
- end
20
-
21
- end
@@ -1,45 +0,0 @@
1
- module Oauth
2
- class ProvidersController < ApplicationController
3
-
4
- def index
5
- @title = "Providers"
6
- authorize! :read, Oauth::Provider
7
- @providers = Oauth::Provider.all
8
- end
9
-
10
- def new
11
- @title = "New Provider"
12
- authorize! :create, Oauth::Provider
13
- @provider = Oauth::Provider.new
14
- end
15
-
16
- def create
17
- @provider = Oauth::Provider.new(params[:oauth_provider])
18
- authorize! :create, @provider
19
-
20
- if @provider.save
21
- redirect_to oauth_providers_path
22
- else
23
- render action: :new
24
- end
25
- end
26
-
27
- def edit
28
- @title = "Edit Provider"
29
- @provider = Oauth::Provider.find(params[:id])
30
- authorize! :update, @provider
31
- end
32
-
33
- def update
34
- @provider = Oauth::Provider.find(params[:id])
35
- authorize! :update, @provider
36
-
37
- if @provider.update_attributes(params[:oauth_provider])
38
- redirect_to oauth_providers_path
39
- else
40
- render action: :edit
41
- end
42
- end
43
-
44
- end
45
- end
@@ -1,22 +0,0 @@
1
- class ProjectRolesController < ApplicationController
2
- before_action :find_project
3
-
4
-
5
- def create
6
- Role.where(project_id: @project.id, user_id: current_user.id).first_or_create(name: "Follower")
7
- redirect_to :back, notice: "You are now following #{@project.name}"
8
- end
9
-
10
- def destroy
11
- Role.where(project_id: @project.id, user_id: current_user.id).delete_all
12
- redirect_to :back, notice: "You are no longer following #{@project.name}"
13
- end
14
-
15
-
16
- private
17
-
18
- def find_project
19
- @project = Project.find_by_slug!(params[:project_id])
20
- end
21
-
22
- end
@@ -1,14 +0,0 @@
1
- class SettingsController < ApplicationController
2
- load_and_authorize_resource
3
-
4
- def show
5
- @settings = Settings.new
6
- end
7
-
8
- def update
9
- @settings = Settings.new(params[:settings])
10
- @settings.save!
11
- redirect_to settings_path, :notice => "Changes saved"
12
- end
13
-
14
- end
@@ -1,12 +0,0 @@
1
- class TesterBarController < ApplicationController
2
-
3
- def login_as
4
- user = User.find_by_email(params[:email])
5
- if user
6
- flash[:notice] = "You have signed in as #{user.name}"
7
- sign_in(user)
8
- end
9
- redirect_to request.referrer || root_url
10
- end
11
-
12
- end
@@ -1,24 +0,0 @@
1
- class UserCredentialsController < ApplicationController
2
-
3
- def upsert
4
- credentials = current_user.credentials.where(service: params[:service]).first_or_initialize
5
- credentials.login = params[:login]
6
- credentials.password = params[:password]
7
-
8
- if credentials.save
9
- head :ok
10
- else
11
- render json: credentials.errors, status: :unprocessable_entity
12
- end
13
- end
14
-
15
- def destroy
16
- credentials = current_user.credentials.find_by_id(params[:id])
17
- if credentials && credentials.delete
18
- redirect_to :back, notice: "Houston has deleted your credentials for #{credentials.service}"
19
- else
20
- redirect_to :back
21
- end
22
- end
23
-
24
- end
data/app/models/role.rb DELETED
@@ -1,33 +0,0 @@
1
- class Role < ActiveRecord::Base
2
-
3
- belongs_to :user
4
- belongs_to :project
5
-
6
- validates :user_id, presence: true
7
- validates :project, presence: true
8
-
9
- class << self
10
- def to_users
11
- User.where(id: all.select(:user_id))
12
- end
13
-
14
- def to_projects
15
- Project.where(id: all.select(:project_id))
16
- end
17
-
18
- def for_user(user_or_id)
19
- user_id = user_or_id.is_a?(User) ? user_or_id.id : user_or_id
20
- where user_id: user_id
21
- end
22
-
23
- def for_project(project_or_id)
24
- project_id = project_or_id.is_a?(Project) ? project_or_id.id : project_or_id
25
- where project_id: project_id
26
- end
27
-
28
- def any?
29
- count > 0
30
- end
31
- end
32
-
33
- end
@@ -1,10 +0,0 @@
1
- class Setting < ActiveRecord::Base
2
-
3
- validates_presence_of :name, :value
4
-
5
- def self.[](name)
6
- setting = where(name: name).first
7
- setting && setting.value
8
- end
9
-
10
- end
@@ -1,38 +0,0 @@
1
- class Settings
2
-
3
- def initialize(attributes={})
4
- attributes.each do |key, value|
5
- self[key] = value
6
- end
7
- end
8
-
9
- def [](name)
10
- fetch(name, nil)
11
- end
12
-
13
- def fetch(name, *args)
14
- setting = settings.find { |setting| setting.name == name }
15
- return setting.value if setting
16
- raise KeyError, "key not found: #{name.inspect}" if args.empty?
17
- args.first
18
- end
19
-
20
- def []=(name, value)
21
- setting = settings.find { |setting| setting.name == name }
22
- settings << (setting = Setting.new(name: name)) unless setting
23
- setting.value = value
24
- end
25
-
26
- def save!
27
- settings.each do |setting|
28
- setting.save if setting.changed?
29
- end
30
- end
31
-
32
- private
33
-
34
- def settings
35
- @settings ||= Setting.all
36
- end
37
-
38
- end
@@ -1,23 +0,0 @@
1
- # Converts GitHub-flavored Markdown to Slack-flavored Markdown
2
- class Slackdown
3
- attr_reader :markdown
4
-
5
- def initialize(markdown)
6
- @markdown = markdown.to_s
7
- end
8
-
9
- def convert
10
- # Remove the source name from fenced code blocks
11
- slackdown = markdown.gsub(/^```(ruby|diff|css|json|sql|html|xml|coffee(?:script)?|javascript|js|bash)/, "```")
12
-
13
- # Convert `__` and `**` to `*`
14
- slackdown = slackdown.gsub(/(?<!_)__(?!_)/, "*")
15
- .gsub(/(?<!\*)\*\*(?!\*)/, "*")
16
-
17
- # Replace images with their URLs: Slack will unfurl them
18
- slackdown = slackdown.gsub(/<img[^>]*src="([^"]+)"[^>]*>/, "\\1")
19
- slackdown
20
- end
21
- alias :to_s :convert
22
-
23
- end
@@ -1,27 +0,0 @@
1
- class UserCredentials < ActiveRecord::Base
2
-
3
- class MissingCredentials < RuntimeError; end
4
- class InsufficientPermissions < RuntimeError; end
5
- class InvalidCredentials < RuntimeError; end
6
- class AccountLocked < RuntimeError; end
7
-
8
- encrypt_with_public_key :password, key_pair: Houston.config.keypair
9
-
10
- validate :test_connection
11
- validates :service, inclusion: { in: Houston.user_credentials_support_services }
12
-
13
- belongs_to :user
14
-
15
- def self.for(service)
16
- credentials = where(service: service).first || (raise MissingCredentials)
17
- [credentials.login, credentials.password.decrypt(Houston.config.passphrase)]
18
- rescue OpenSSL::PKey::RSAError
19
- credentials.delete
20
- raise MissingCredentials
21
- end
22
-
23
- def test_connection
24
- Houston.test_connection_to(self)
25
- end
26
-
27
- end