beyond 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/beyond/application.js +13 -0
  6. data/app/assets/stylesheets/beyond/application.css +13 -0
  7. data/app/controllers/beyond/application_controller.rb +4 -0
  8. data/app/controllers/beyond/plugins_controller.rb +43 -0
  9. data/app/controllers/beyond/tenants_controller.rb +68 -0
  10. data/app/helpers/beyond/application_helper.rb +4 -0
  11. data/app/models/beyond/plugin.rb +40 -0
  12. data/app/models/beyond/tenant.rb +62 -0
  13. data/app/models/beyond/user.rb +8 -0
  14. data/app/views/beyond/plugins/new.html.haml +20 -0
  15. data/app/views/beyond/tenants/edit.html.haml +16 -0
  16. data/app/views/beyond/tenants/new.html.haml +4 -0
  17. data/app/views/beyond/tenants/show.html.haml +14 -0
  18. data/app/views/beyond/users/_new.html.haml +16 -0
  19. data/app/views/layouts/beyond/application.html.erb +17 -0
  20. data/config/initializers/devise.rb +255 -0
  21. data/config/locales/devise.en.yml +59 -0
  22. data/config/routes.rb +13 -0
  23. data/db/migrate/20140204173749_devise_create_beyond_users.rb +42 -0
  24. data/db/migrate/20140204173856_create_beyond_plugins.rb +17 -0
  25. data/db/migrate/20140204173902_create_beyond_tenants.rb +10 -0
  26. data/lib/beyond/engine.rb +16 -0
  27. data/lib/beyond/version.rb +3 -0
  28. data/lib/beyond.rb +5 -0
  29. data/lib/tasks/beyond_tasks.rake +4 -0
  30. data/test/beyond_test.rb +7 -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 +13 -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/application.yml +3 -0
  43. data/test/dummy/config/boot.rb +5 -0
  44. data/test/dummy/config/database.yml +25 -0
  45. data/test/dummy/config/environment.rb +5 -0
  46. data/test/dummy/config/environments/development.rb +29 -0
  47. data/test/dummy/config/environments/production.rb +80 -0
  48. data/test/dummy/config/environments/test.rb +36 -0
  49. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  50. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  51. data/test/dummy/config/initializers/inflections.rb +16 -0
  52. data/test/dummy/config/initializers/mime_types.rb +5 -0
  53. data/test/dummy/config/initializers/secret_token.rb +12 -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 +4 -0
  58. data/test/dummy/config.ru +4 -0
  59. data/test/dummy/db/development.sqlite3 +0 -0
  60. data/test/dummy/db/schema.rb +55 -0
  61. data/test/dummy/log/development.log +6931 -0
  62. data/test/dummy/public/404.html +58 -0
  63. data/test/dummy/public/422.html +58 -0
  64. data/test/dummy/public/500.html +57 -0
  65. data/test/dummy/public/favicon.ico +0 -0
  66. data/test/dummy/tmp/cache/assets/development/sprockets/329c8e74ee84b2fbddd8695906f28ca4 +0 -0
  67. data/test/dummy/tmp/cache/assets/development/sprockets/43d3076c25d714cbb447da5a78c73911 +0 -0
  68. data/test/dummy/tmp/cache/assets/development/sprockets/8fb0c7e5315821c90e3641f1b22d0947 +0 -0
  69. data/test/dummy/tmp/cache/assets/development/sprockets/a6ad7cf3aadcbe2d521f45adc1432fa8 +0 -0
  70. data/test/dummy/tmp/cache/assets/development/sprockets/a778481f9e2ae19e9b47c1a12a5f36f1 +0 -0
  71. data/test/dummy/tmp/cache/assets/development/sprockets/ae14fa652db78218572bb9d1bf21b675 +0 -0
  72. data/test/fixtures/beyond/plugins.yml +11 -0
  73. data/test/fixtures/beyond/tenants.yml +11 -0
  74. data/test/fixtures/beyond/users.yml +11 -0
  75. data/test/integration/navigation_test.rb +10 -0
  76. data/test/models/beyond/plugin_test.rb +9 -0
  77. data/test/models/beyond/tenant_test.rb +9 -0
  78. data/test/models/beyond/user_test.rb +9 -0
  79. data/test/test_helper.rb +15 -0
  80. metadata +270 -0
@@ -0,0 +1,255 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ config.secret_key = '2efbdcab81ee25a5a11f4a8a2d6ac2f2f3de12fbf4b86f40bb2c8675dabac1bed798892667392c95ee63991c6b2162575485f565f14377078533170a53492e4a'
8
+ config.parent_controller = 'Beyond::ApplicationController'
9
+
10
+ # ==> Mailer Configuration
11
+ # Configure the e-mail address which will be shown in Devise::Mailer,
12
+ # note that it will be overwritten if you use your own mailer class
13
+ # with default "from" parameter.
14
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
15
+
16
+ # Configure the class responsible to send e-mails.
17
+ # config.mailer = 'Devise::Mailer'
18
+
19
+ # ==> ORM configuration
20
+ # Load and configure the ORM. Supports :active_record (default) and
21
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
22
+ # available as additional gems.
23
+ require 'devise/orm/active_record'
24
+
25
+ # ==> Configuration for any authentication mechanism
26
+ # Configure which keys are used when authenticating a user. The default is
27
+ # just :email. You can configure it to use [:username, :subdomain], so for
28
+ # authenticating a user, both parameters are required. Remember that those
29
+ # parameters are used only when authenticating and not when retrieving from
30
+ # session. If you need permissions, you should implement that in a before filter.
31
+ # You can also supply a hash where the value is a boolean determining whether
32
+ # or not authentication should be aborted when the value is not present.
33
+ # config.authentication_keys = [ :email ]
34
+
35
+ # Configure parameters from the request object used for authentication. Each entry
36
+ # given should be a request method and it will automatically be passed to the
37
+ # find_for_authentication method and considered in your model lookup. For instance,
38
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
39
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
40
+ # config.request_keys = []
41
+
42
+ # Configure which authentication keys should be case-insensitive.
43
+ # These keys will be downcased upon creating or modifying a user and when used
44
+ # to authenticate or find a user. Default is :email.
45
+ config.case_insensitive_keys = [ :email ]
46
+
47
+ # Configure which authentication keys should have whitespace stripped.
48
+ # These keys will have whitespace before and after removed upon creating or
49
+ # modifying a user and when used to authenticate or find a user. Default is :email.
50
+ config.strip_whitespace_keys = [ :email ]
51
+
52
+ # Tell if authentication through request.params is enabled. True by default.
53
+ # It can be set to an array that will enable params authentication only for the
54
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
55
+ # enable it only for database (email + password) authentication.
56
+ # config.params_authenticatable = true
57
+
58
+ # Tell if authentication through HTTP Auth is enabled. False by default.
59
+ # It can be set to an array that will enable http authentication only for the
60
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
61
+ # enable it only for database authentication. The supported strategies are:
62
+ # :database = Support basic authentication with authentication key + password
63
+ # config.http_authenticatable = false
64
+
65
+ # If http headers should be returned for AJAX requests. True by default.
66
+ # config.http_authenticatable_on_xhr = true
67
+
68
+ # The realm used in Http Basic Authentication. 'Application' by default.
69
+ # config.http_authentication_realm = 'Application'
70
+
71
+ # It will change confirmation, password recovery and other workflows
72
+ # to behave the same regardless if the e-mail provided was right or wrong.
73
+ # Does not affect registerable.
74
+ # config.paranoid = true
75
+
76
+ # By default Devise will store the user in session. You can skip storage for
77
+ # particular strategies by setting this option.
78
+ # Notice that if you are skipping storage for all authentication paths, you
79
+ # may want to disable generating routes to Devise's sessions controller by
80
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
81
+ config.skip_session_storage = [:http_auth]
82
+
83
+ # By default, Devise cleans up the CSRF token on authentication to
84
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
85
+ # requests for sign in and sign up, you need to get a new CSRF token
86
+ # from the server. You can disable this option at your own risk.
87
+ # config.clean_up_csrf_token_on_authentication = true
88
+
89
+ # ==> Configuration for :database_authenticatable
90
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
91
+ # using other encryptors, it sets how many times you want the password re-encrypted.
92
+ #
93
+ # Limiting the stretches to just one in testing will increase the performance of
94
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
95
+ # a value less than 10 in other environments.
96
+ config.stretches = Rails.env.test? ? 1 : 10
97
+
98
+ # Setup a pepper to generate the encrypted password.
99
+ # config.pepper = '7ce0c8730229c9806057d9ea91dbcc6496504cf5cd08dfe3673134ce722aaf7e6cd0928ca2520ddcde6db657a5e090ba2b9b7f6e34743712d5f70985c54271b6'
100
+
101
+ # ==> Configuration for :confirmable
102
+ # A period that the user is allowed to access the website even without
103
+ # confirming his account. For instance, if set to 2.days, the user will be
104
+ # able to access the website for two days without confirming his account,
105
+ # access will be blocked just in the third day. Default is 0.days, meaning
106
+ # the user cannot access the website without confirming his account.
107
+ # config.allow_unconfirmed_access_for = 2.days
108
+
109
+ # A period that the user is allowed to confirm their account before their
110
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
111
+ # their account within 3 days after the mail was sent, but on the fourth day
112
+ # their account can't be confirmed with the token any more.
113
+ # Default is nil, meaning there is no restriction on how long a user can take
114
+ # before confirming their account.
115
+ # config.confirm_within = 3.days
116
+
117
+ # If true, requires any email changes to be confirmed (exactly the same way as
118
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
119
+ # db field (see migrations). Until confirmed new email is stored in
120
+ # unconfirmed email column, and copied to email column on successful confirmation.
121
+ config.reconfirmable = true
122
+
123
+ # Defines which key will be used when confirming an account
124
+ # config.confirmation_keys = [ :email ]
125
+
126
+ # ==> Configuration for :rememberable
127
+ # The time the user will be remembered without asking for credentials again.
128
+ # config.remember_for = 2.weeks
129
+
130
+ # If true, extends the user's remember period when remembered via cookie.
131
+ # config.extend_remember_period = false
132
+
133
+ # Options to be passed to the created cookie. For instance, you can set
134
+ # :secure => true in order to force SSL only cookies.
135
+ # config.rememberable_options = {}
136
+
137
+ # ==> Configuration for :validatable
138
+ # Range for password length. Default is 8..128.
139
+ config.password_length = 8..128
140
+
141
+ # Email regex used to validate email formats. It simply asserts that
142
+ # one (and only one) @ exists in the given string. This is mainly
143
+ # to give user feedback and not to assert the e-mail validity.
144
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
145
+
146
+ # ==> Configuration for :timeoutable
147
+ # The time you want to timeout the user session without activity. After this
148
+ # time the user will be asked for credentials again. Default is 30 minutes.
149
+ # config.timeout_in = 30.minutes
150
+
151
+ # If true, expires auth token on session timeout.
152
+ # config.expire_auth_token_on_timeout = false
153
+
154
+ # ==> Configuration for :lockable
155
+ # Defines which strategy will be used to lock an account.
156
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
157
+ # :none = No lock strategy. You should handle locking by yourself.
158
+ # config.lock_strategy = :failed_attempts
159
+
160
+ # Defines which key will be used when locking and unlocking an account
161
+ # config.unlock_keys = [ :email ]
162
+
163
+ # Defines which strategy will be used to unlock an account.
164
+ # :email = Sends an unlock link to the user email
165
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
166
+ # :both = Enables both strategies
167
+ # :none = No unlock strategy. You should handle unlocking by yourself.
168
+ # config.unlock_strategy = :both
169
+
170
+ # Number of authentication tries before locking an account if lock_strategy
171
+ # is failed attempts.
172
+ # config.maximum_attempts = 20
173
+
174
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
175
+ # config.unlock_in = 1.hour
176
+
177
+ # Warn on the last attempt before the account is locked.
178
+ # config.last_attempt_warning = false
179
+
180
+ # ==> Configuration for :recoverable
181
+ #
182
+ # Defines which key will be used when recovering the password for an account
183
+ # config.reset_password_keys = [ :email ]
184
+
185
+ # Time interval you can reset your password with a reset password key.
186
+ # Don't put a too small interval or your users won't have the time to
187
+ # change their passwords.
188
+ config.reset_password_within = 6.hours
189
+
190
+ # ==> Configuration for :encryptable
191
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
192
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
193
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
194
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
195
+ # REST_AUTH_SITE_KEY to pepper).
196
+ #
197
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
198
+ # config.encryptor = :sha512
199
+
200
+ # ==> Scopes configuration
201
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
202
+ # "users/sessions/new". It's turned off by default because it's slower if you
203
+ # are using only default views.
204
+ # config.scoped_views = false
205
+
206
+ # Configure the default scope given to Warden. By default it's the first
207
+ # devise role declared in your routes (usually :user).
208
+ # config.default_scope = :user
209
+
210
+ # Set this configuration to false if you want /users/sign_out to sign out
211
+ # only the current scope. By default, Devise signs out all scopes.
212
+ # config.sign_out_all_scopes = true
213
+
214
+ # ==> Navigation configuration
215
+ # Lists the formats that should be treated as navigational. Formats like
216
+ # :html, should redirect to the sign in page when the user does not have
217
+ # access, but formats like :xml or :json, should return 401.
218
+ #
219
+ # If you have any extra navigational formats, like :iphone or :mobile, you
220
+ # should add them to the navigational formats lists.
221
+ #
222
+ # The "*/*" below is required to match Internet Explorer requests.
223
+ # config.navigational_formats = ['*/*', :html]
224
+
225
+ # The default HTTP method used to sign out a resource. Default is :delete.
226
+ config.sign_out_via = :delete
227
+
228
+ # ==> OmniAuth
229
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
230
+ # up on your models and hooks.
231
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
232
+
233
+ # ==> Warden configuration
234
+ # If you want to use other strategies, that are not supported by Devise, or
235
+ # change the failure app, you can configure them inside the config.warden block.
236
+ #
237
+ # config.warden do |manager|
238
+ # manager.intercept_401 = false
239
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
240
+ # end
241
+
242
+ # ==> Mountable engine configurations
243
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
244
+ # is mountable, there are some extra configurations to be taken into account.
245
+ # The following options are available, assuming the engine is mounted as:
246
+ #
247
+ # mount MyEngine, at: '/my_engine'
248
+ #
249
+ # The router that invoked `devise_for`, in the example above, would be:
250
+ config.router_name = :beyond
251
+ #
252
+ # When using omniauth, Devise cannot automatically set Omniauth path,
253
+ # so you need to do it manually. For the users scope, it would be:
254
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
255
+ end
@@ -0,0 +1,59 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your account was successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid email or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account will be locked."
15
+ not_found_in_database: "Invalid email or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your account before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock Instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password was changed successfully. You are now signed in."
34
+ updated_not_active: "Your password was changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
42
+ updated: "You updated your account successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ unlocks:
47
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
48
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
49
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
50
+ errors:
51
+ messages:
52
+ already_confirmed: "was already confirmed, please try signing in"
53
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
54
+ expired: "has expired, please request a new one"
55
+ not_found: "not found"
56
+ not_locked: "was not locked"
57
+ not_saved:
58
+ one: "1 error prohibited this %{resource} from being saved:"
59
+ other: "%{count} errors prohibited this %{resource} from being saved:"
data/config/routes.rb ADDED
@@ -0,0 +1,13 @@
1
+ Beyond::Engine.routes.draw do
2
+ devise_for :users, :class_name => "Beyond::User", module: :devise
3
+ root :to => "tenants#new"
4
+
5
+ resources :plugins, only: [:new, :create]
6
+
7
+ resources :tenants, only: [:new, :create, :edit, :update, :show]
8
+ post '/tenants/:id/stop', to: 'tenants#stop'
9
+ post '/tenants/:id/start', to: 'tenants#start'
10
+ resources :plugins, only: [:new, :create]
11
+ post '/plugins/:id/stop', to: 'plugins#stop', as: 'plugin_stop'
12
+ post '/plugins/:id/start', to: 'plugins#start', as: 'plugin_start'
13
+ end
@@ -0,0 +1,42 @@
1
+ class DeviseCreateBeyondUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:beyond_users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0, :null => false
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ # t.string :confirmation_token
24
+ # t.datetime :confirmed_at
25
+ # t.datetime :confirmation_sent_at
26
+ # t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+
34
+ t.timestamps
35
+ end
36
+
37
+ add_index :beyond_users, :email, :unique => true
38
+ add_index :beyond_users, :reset_password_token, :unique => true
39
+ # add_index :beyond_users, :confirmation_token, :unique => true
40
+ # add_index :beyond_users, :unlock_token, :unique => true
41
+ end
42
+ end
@@ -0,0 +1,17 @@
1
+ class CreateBeyondPlugins < ActiveRecord::Migration
2
+ def change
3
+ create_table :beyond_plugins do |t|
4
+ t.string "name"
5
+ t.text "description"
6
+ t.boolean "public"
7
+ t.integer "tenant_id"
8
+ t.boolean "activated"
9
+ t.string "archive_file_name"
10
+ t.string "archive_content_type"
11
+ t.integer "archive_file_size"
12
+ t.datetime "archive_updated_at"
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,10 @@
1
+ class CreateBeyondTenants < ActiveRecord::Migration
2
+ def change
3
+ create_table :beyond_tenants do |t|
4
+ t.string "name"
5
+ t.integer "user_id"
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,16 @@
1
+ require 'haml-rails'
2
+ require 'figaro'
3
+ require 'plugman'
4
+
5
+ log = StringIO.new("")
6
+ # loads event plugins (the lambda has arg because plugman needs it for loggin)
7
+ loader = ->(a) { Dir.glob('./event_plugins/*.rb').each {|f| require f} }
8
+ # define plugins constant
9
+ PLUGINS = Plugman.new(loader: loader, logger: Logger.new(log))
10
+ PLUGINS.load_plugins
11
+
12
+ module Beyond
13
+ class Engine < ::Rails::Engine
14
+ isolate_namespace Beyond
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ module Beyond
2
+ VERSION = "0.0.1"
3
+ end
data/lib/beyond.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'devise'
2
+ require "beyond/engine"
3
+
4
+ module Beyond
5
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :beyond do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class BeyondTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Beyond
6
+ end
7
+ 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
+ Dummy::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/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,13 @@
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 top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -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 "beyond"
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,3 @@
1
+ kamino_bin: /myr/kamino/kamino
2
+ tenants_plugins_dir: /myr/plugins
3
+ tenants_configs_dir: /myr/configs
@@ -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.exists?(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
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Dummy::Application.initialize!
@@ -0,0 +1,29 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+ end