milia 1.2.1 → 1.3.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/confirmations_controller.rb +7 -7
  3. data/app/controllers/registrations_controller.rb +13 -19
  4. data/app/views/devise/registrations/new.html.haml +53 -0
  5. data/lib/generators/milia/install_generator.rb +44 -41
  6. data/lib/generators/milia/templates/devise_permitted_parameters.rb +18 -0
  7. data/lib/generators/milia/templates/initializer.rb +3 -9
  8. data/lib/milia.rb +3 -22
  9. data/lib/milia/base.rb +88 -109
  10. data/lib/milia/control.rb +25 -25
  11. data/lib/milia/invite_member.rb +6 -6
  12. data/lib/milia/version.rb +1 -1
  13. metadata +16 -184
  14. data/.document +0 -5
  15. data/.gitignore +0 -94
  16. data/.ruby-gemset +0 -1
  17. data/.ruby-version +0 -1
  18. data/.slugignore +0 -2
  19. data/.travis.yml +0 -4
  20. data/Gemfile +0 -4
  21. data/LICENSE.txt +0 -20
  22. data/README.md +0 -1207
  23. data/Rakefile +0 -1
  24. data/doc/gemfile_addition.txt +0 -28
  25. data/doc/manual_sample.sh +0 -816
  26. data/doc/ref_notes.txt +0 -155
  27. data/doc/sample.sh +0 -276
  28. data/markdown.rb +0 -38
  29. data/milia.gemspec +0 -29
  30. data/test/.ruby-gemset +0 -1
  31. data/test/.ruby-version +0 -1
  32. data/test/Gemfile +0 -81
  33. data/test/Gemfile.lock +0 -223
  34. data/test/README.md +0 -83
  35. data/test/Rakefile +0 -6
  36. data/test/app/assets/javascripts/application.js +0 -16
  37. data/test/app/assets/stylesheets/application.css +0 -13
  38. data/test/app/controllers/application_controller.rb +0 -13
  39. data/test/app/controllers/home_controller.rb +0 -10
  40. data/test/app/helpers/application_helper.rb +0 -2
  41. data/test/app/models/member.rb +0 -34
  42. data/test/app/models/post.rb +0 -14
  43. data/test/app/models/team.rb +0 -9
  44. data/test/app/models/team_asset.rb +0 -6
  45. data/test/app/models/tenant.rb +0 -54
  46. data/test/app/models/user.rb +0 -14
  47. data/test/app/models/zine.rb +0 -8
  48. data/test/app/views/home/index.html.erb +0 -2
  49. data/test/app/views/home/show.html.erb +0 -2
  50. data/test/app/views/layouts/application.html.erb +0 -14
  51. data/test/bin/bundle +0 -3
  52. data/test/bin/rails +0 -4
  53. data/test/bin/rake +0 -4
  54. data/test/config/application.rb +0 -36
  55. data/test/config/boot.rb +0 -4
  56. data/test/config/database.yml +0 -25
  57. data/test/config/environment.rb +0 -5
  58. data/test/config/environments/development.rb +0 -48
  59. data/test/config/environments/production.rb +0 -95
  60. data/test/config/environments/test.rb +0 -42
  61. data/test/config/initializers/backtrace_silencers.rb +0 -7
  62. data/test/config/initializers/devise.rb +0 -254
  63. data/test/config/initializers/filter_parameter_logging.rb +0 -4
  64. data/test/config/initializers/inflections.rb +0 -16
  65. data/test/config/initializers/milia.rb +0 -51
  66. data/test/config/initializers/mime_types.rb +0 -5
  67. data/test/config/initializers/secret_token.rb +0 -12
  68. data/test/config/initializers/session_store.rb +0 -3
  69. data/test/config/initializers/wrap_parameters.rb +0 -14
  70. data/test/config/locales/en.yml +0 -23
  71. data/test/config/routes.rb +0 -77
  72. data/test/db/migrate/20111012050200_add_sessions_table.rb +0 -12
  73. data/test/db/migrate/20111012050340_devise_create_users.rb +0 -48
  74. data/test/db/migrate/20111012050532_create_tenants.rb +0 -11
  75. data/test/db/migrate/20111012050600_create_tenants_users_join_table.rb +0 -8
  76. data/test/db/migrate/20111012050650_create_members.rb +0 -12
  77. data/test/db/migrate/20111012231923_create_posts.rb +0 -12
  78. data/test/db/migrate/20111013050657_create_zines.rb +0 -10
  79. data/test/db/migrate/20111013050753_create_teams.rb +0 -10
  80. data/test/db/migrate/20111013050837_create_team_assets.rb +0 -11
  81. data/test/db/schema.rb +0 -126
  82. data/test/db/seeds.rb +0 -7
  83. data/test/test/controllers/home_controller_test.rb +0 -132
  84. data/test/test/ctlr_test_helper.rb +0 -11
  85. data/test/test/fixtures/members.yml +0 -35
  86. data/test/test/fixtures/posts.yml +0 -96
  87. data/test/test/fixtures/team_assets.yml +0 -30
  88. data/test/test/fixtures/teams.yml +0 -17
  89. data/test/test/fixtures/tenants.yml +0 -12
  90. data/test/test/fixtures/tenants_users.yml +0 -15
  91. data/test/test/fixtures/users.yml +0 -33
  92. data/test/test/fixtures/zines.yml +0 -25
  93. data/test/test/models/member_test.rb +0 -75
  94. data/test/test/models/post_test.rb +0 -66
  95. data/test/test/models/team_test.rb +0 -49
  96. data/test/test/models/tenant_test.rb +0 -228
  97. data/test/test/models/user_test.rb +0 -182
  98. data/test/test/models/zine_test.rb +0 -40
  99. data/test/test/test_helper.rb +0 -31
@@ -1,29 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'milia/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "milia"
8
- spec.version = Milia::VERSION
9
- spec.authors = ["daudi amani"]
10
- spec.email = ["dsaronin@gmail.com"]
11
- spec.description = %q{Multi-tenanting gem for hosted Rails/Ruby/devise applications}
12
- spec.summary = %q{Transparent multi-tenanting for hosted rails/ruby/devise web applications}
13
- spec.homepage = ""
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_dependency 'rails', '~> 4.2'
22
- spec.add_dependency 'devise', '~> 3.4'
23
-
24
- spec.add_development_dependency "bundler", "~> 1.7"
25
- spec.add_development_dependency "rake"
26
- spec.add_development_dependency "sqlite3"
27
- spec.add_development_dependency "shoulda"
28
- spec.add_development_dependency "turn"
29
- end
@@ -1 +0,0 @@
1
- miliatest
@@ -1 +0,0 @@
1
- 2.1.3
@@ -1,81 +0,0 @@
1
- source 'https://rubygems.org'
2
- ruby "2.1.3" # heroku likes this at the head, as line 2
3
-
4
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
- gem 'rails', '~> 4.2'
6
-
7
- # Use sqlite3 as the database for Active Record
8
- gem 'sqlite3'
9
-
10
- # Use SCSS for stylesheets
11
- gem 'sass-rails' # , '~> 4.0.0'
12
-
13
- # Use Uglifier as compressor for JavaScript assets
14
- gem 'uglifier' # , '>= 1.3.0'
15
-
16
- # Use CoffeeScript for .js.coffee assets and views
17
- gem 'coffee-rails' # , '~> 4.0.0'
18
-
19
- # See https://github.com/sstephenson/execjs#readme for more supported runtimes
20
- gem 'therubyracer', platforms: :ruby
21
-
22
- # Use jquery as the JavaScript library
23
- gem 'jquery-rails'
24
-
25
- # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
26
- # gem 'turbolinks'
27
-
28
- # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
29
- gem 'jbuilder' # , '~> 1.2'
30
-
31
- group :doc do
32
- # bundle exec rake doc:rails generates the API under doc/api.
33
- gem 'sdoc', require: false
34
- end
35
-
36
- # Use ActiveModel has_secure_password
37
- # gem 'bcrypt-ruby' # , '~> 3.1.2'
38
-
39
- # Use unicorn as the app server
40
- # gem 'unicorn'
41
-
42
- # Use Capistrano for deployment
43
- # gem 'capistrano', group: :development
44
-
45
- # Use debugger
46
- # gem 'debugger', group: [:development, :test]
47
-
48
- # =========================================================
49
- # sample-milia-app specific stuff
50
- # =========================================================
51
- # Bundle the extra gems:
52
-
53
- gem 'haml-rails'
54
- gem 'html2haml' # , :git => 'git://github.com/haml/html2haml.git' # "2.0.0.beta.2",
55
-
56
- # stuff that heroku likes to have
57
- gem 'puma'
58
- gem "SystemTimer", :require => "system_timer", :platforms => :ruby_18
59
- gem "rack-timeout"
60
- gem 'rails_12factor'
61
-
62
- gem 'devise' # , '~>3.2'
63
-
64
- # airbrake is optional and configured by config.use_airbrake in milia initializer
65
- # default is false; if you change it to true, uncomment out the line below
66
- # gem 'airbrake' # uncomment this if you will use airbrake for exception notifications
67
-
68
- # recaptcha is optional and configured by config.use_recaptcha in milia initializer
69
- # default is true; if you change it to false, comment out the line below
70
- # gem 'recaptcha', :require => "recaptcha/rails"
71
-
72
- gem "recaptcha", require: "recaptcha/rails"
73
- gem "activerecord-session_store", github: "rails/activerecord-session_store"
74
-
75
- group :test do
76
- gem "shoulda" # , "3.5.0"
77
- gem "shoulda-matchers" # , "~>2.1.0"
78
- gem "shoulda-context" # , "~>1.1.2"
79
- end
80
-
81
- gem 'milia', :path => "../../milia"
@@ -1,223 +0,0 @@
1
- GIT
2
- remote: git://github.com/rails/activerecord-session_store.git
3
- revision: a30ec3117d189bfe67261e3c80364627107d76ea
4
- specs:
5
- activerecord-session_store (0.1.0)
6
- actionpack (>= 4.0.0, < 5)
7
- activerecord (>= 4.0.0, < 5)
8
- railties (>= 4.0.0, < 5)
9
-
10
- PATH
11
- remote: ../../milia
12
- specs:
13
- milia (1.2.1)
14
- devise (~> 3.4)
15
- rails (~> 4.2)
16
-
17
- GEM
18
- remote: https://rubygems.org/
19
- specs:
20
- SystemTimer (1.2.3)
21
- actionmailer (4.2.0)
22
- actionpack (= 4.2.0)
23
- actionview (= 4.2.0)
24
- activejob (= 4.2.0)
25
- mail (~> 2.5, >= 2.5.4)
26
- rails-dom-testing (~> 1.0, >= 1.0.5)
27
- actionpack (4.2.0)
28
- actionview (= 4.2.0)
29
- activesupport (= 4.2.0)
30
- rack (~> 1.6.0)
31
- rack-test (~> 0.6.2)
32
- rails-dom-testing (~> 1.0, >= 1.0.5)
33
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
34
- actionview (4.2.0)
35
- activesupport (= 4.2.0)
36
- builder (~> 3.1)
37
- erubis (~> 2.7.0)
38
- rails-dom-testing (~> 1.0, >= 1.0.5)
39
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
40
- activejob (4.2.0)
41
- activesupport (= 4.2.0)
42
- globalid (>= 0.3.0)
43
- activemodel (4.2.0)
44
- activesupport (= 4.2.0)
45
- builder (~> 3.1)
46
- activerecord (4.2.0)
47
- activemodel (= 4.2.0)
48
- activesupport (= 4.2.0)
49
- arel (~> 6.0)
50
- activesupport (4.2.0)
51
- i18n (~> 0.7)
52
- json (~> 1.7, >= 1.7.7)
53
- minitest (~> 5.1)
54
- thread_safe (~> 0.3, >= 0.3.4)
55
- tzinfo (~> 1.1)
56
- arel (6.0.0)
57
- bcrypt (3.1.9)
58
- builder (3.2.2)
59
- coffee-rails (4.1.0)
60
- coffee-script (>= 2.2.0)
61
- railties (>= 4.0.0, < 5.0)
62
- coffee-script (2.3.0)
63
- coffee-script-source
64
- execjs
65
- coffee-script-source (1.8.0)
66
- devise (3.4.1)
67
- bcrypt (~> 3.0)
68
- orm_adapter (~> 0.1)
69
- railties (>= 3.2.6, < 5)
70
- responders
71
- thread_safe (~> 0.1)
72
- warden (~> 1.2.3)
73
- erubis (2.7.0)
74
- execjs (2.2.2)
75
- globalid (0.3.0)
76
- activesupport (>= 4.1.0)
77
- haml (4.1.0.beta.1)
78
- tilt
79
- haml-rails (0.7.0)
80
- actionpack (>= 4.0.1)
81
- activesupport (>= 4.0.1)
82
- haml (>= 3.1, < 5.0)
83
- html2haml (>= 1.0.1)
84
- railties (>= 4.0.1)
85
- hike (1.2.3)
86
- hpricot (0.8.6)
87
- html2haml (1.0.1)
88
- erubis (~> 2.7.0)
89
- haml (>= 4.0.0.rc.1)
90
- hpricot (~> 0.8.6)
91
- ruby_parser (~> 3.1.1)
92
- i18n (0.7.0)
93
- jbuilder (2.2.6)
94
- activesupport (>= 3.0.0, < 5)
95
- multi_json (~> 1.2)
96
- jquery-rails (4.0.3)
97
- rails-dom-testing (~> 1.0)
98
- railties (>= 4.2.0)
99
- thor (>= 0.14, < 2.0)
100
- json (1.8.2)
101
- libv8 (3.16.14.7)
102
- loofah (2.0.1)
103
- nokogiri (>= 1.5.9)
104
- mail (2.6.3)
105
- mime-types (>= 1.16, < 3)
106
- mime-types (2.4.3)
107
- mini_portile (0.6.2)
108
- minitest (5.5.1)
109
- multi_json (1.10.1)
110
- nokogiri (1.6.5)
111
- mini_portile (~> 0.6.0)
112
- orm_adapter (0.5.0)
113
- puma (2.10.2)
114
- rack (>= 1.1, < 2.0)
115
- rack (1.6.0)
116
- rack-test (0.6.3)
117
- rack (>= 1.0)
118
- rack-timeout (0.1.1)
119
- rails (4.2.0)
120
- actionmailer (= 4.2.0)
121
- actionpack (= 4.2.0)
122
- actionview (= 4.2.0)
123
- activejob (= 4.2.0)
124
- activemodel (= 4.2.0)
125
- activerecord (= 4.2.0)
126
- activesupport (= 4.2.0)
127
- bundler (>= 1.3.0, < 2.0)
128
- railties (= 4.2.0)
129
- sprockets-rails
130
- rails-deprecated_sanitizer (1.0.3)
131
- activesupport (>= 4.2.0.alpha)
132
- rails-dom-testing (1.0.5)
133
- activesupport (>= 4.2.0.beta, < 5.0)
134
- nokogiri (~> 1.6.0)
135
- rails-deprecated_sanitizer (>= 1.0.1)
136
- rails-html-sanitizer (1.0.1)
137
- loofah (~> 2.0)
138
- rails_12factor (0.0.3)
139
- rails_serve_static_assets
140
- rails_stdout_logging
141
- rails_serve_static_assets (0.0.3)
142
- rails_stdout_logging (0.0.3)
143
- railties (4.2.0)
144
- actionpack (= 4.2.0)
145
- activesupport (= 4.2.0)
146
- rake (>= 0.8.7)
147
- thor (>= 0.18.1, < 2.0)
148
- rake (10.4.2)
149
- rdoc (4.2.0)
150
- json (~> 1.4)
151
- recaptcha (0.3.6)
152
- ref (1.0.5)
153
- responders (2.0.2)
154
- railties (>= 4.2.0.alpha, < 5)
155
- ruby_parser (3.1.3)
156
- sexp_processor (~> 4.1)
157
- sass (3.4.9)
158
- sass-rails (5.0.1)
159
- railties (>= 4.0.0, < 5.0)
160
- sass (~> 3.1)
161
- sprockets (>= 2.8, < 4.0)
162
- sprockets-rails (>= 2.0, < 4.0)
163
- tilt (~> 1.1)
164
- sdoc (0.4.1)
165
- json (~> 1.7, >= 1.7.7)
166
- rdoc (~> 4.0)
167
- sexp_processor (4.4.4)
168
- shoulda (3.5.0)
169
- shoulda-context (~> 1.0, >= 1.0.1)
170
- shoulda-matchers (>= 1.4.1, < 3.0)
171
- shoulda-context (1.2.1)
172
- shoulda-matchers (2.7.0)
173
- activesupport (>= 3.0.0)
174
- sprockets (2.12.3)
175
- hike (~> 1.2)
176
- multi_json (~> 1.0)
177
- rack (~> 1.0)
178
- tilt (~> 1.1, != 1.3.0)
179
- sprockets-rails (2.2.2)
180
- actionpack (>= 3.0)
181
- activesupport (>= 3.0)
182
- sprockets (>= 2.8, < 4.0)
183
- sqlite3 (1.3.10)
184
- therubyracer (0.12.1)
185
- libv8 (~> 3.16.14.0)
186
- ref
187
- thor (0.19.1)
188
- thread_safe (0.3.4)
189
- tilt (1.4.1)
190
- tzinfo (1.2.2)
191
- thread_safe (~> 0.1)
192
- uglifier (2.7.0)
193
- execjs (>= 0.3.0)
194
- json (>= 1.8.0)
195
- warden (1.2.3)
196
- rack (>= 1.0)
197
-
198
- PLATFORMS
199
- ruby
200
-
201
- DEPENDENCIES
202
- SystemTimer
203
- activerecord-session_store!
204
- coffee-rails
205
- devise
206
- haml-rails
207
- html2haml
208
- jbuilder
209
- jquery-rails
210
- milia!
211
- puma
212
- rack-timeout
213
- rails (~> 4.2)
214
- rails_12factor
215
- recaptcha
216
- sass-rails
217
- sdoc
218
- shoulda
219
- shoulda-context
220
- shoulda-matchers
221
- sqlite3
222
- therubyracer
223
- uglifier
@@ -1,83 +0,0 @@
1
- # Milia unit & functional testing
2
-
3
- This documents the unit testing for Milia: structure of models, things
4
- being tested, and work-arounds used. The reason for this document is
5
- to aid future upgrade efforts.
6
-
7
- ## fixture vs factories?
8
-
9
- Milia v0.3 used factory_girl to generate test fixtures, but there
10
- were difficulties dealing with both the dynamic nature of creating
11
- objects which had to have an existing current_tenant established. In
12
- between v0.3 and v1.0, factory_girl upgraded significantly and meant
13
- all the test code would have to be reworked.
14
-
15
- Rather than relearning FactoryGirl and the extensive changes to
16
- make it work, I've decided to just use static fixtures as being
17
- the easiest way to have the test data fixtures.
18
-
19
- ## Model structure
20
-
21
- ### Required by Milia/Devise
22
-
23
- Universal (non-tenanted)
24
- ```
25
- User
26
- has_one: member
27
- habtm: tenants
28
-
29
- Tenant
30
- has_many: members
31
- habtm: users
32
-
33
- tenants_users HABTM join table
34
- ```
35
-
36
- ### models added for typical app complexity
37
-
38
- Tenanted
39
- <i>Means they all have an implicit: belongs_to: tenant</i>
40
-
41
- ```
42
- Member
43
- belongs_to: user
44
- has_many :team_assets
45
- has_many :teams, :through => :team_assets, :source => 'team'
46
- has_many :posts
47
- has_many :zines, :through => :posts, :source => 'zine'
48
-
49
- Team
50
- has_many :team_assets
51
- has_many :team_members, :through => :team_assets, :source => 'member'
52
- has_many :posts, :through => :zines
53
- has_many :zines
54
-
55
- TeamAsset
56
- belongs_to :member
57
- belongs_to :team
58
-
59
- Post
60
- belongs_to :member
61
- belongs_to :zine
62
- has_one :team, :through => :zine
63
-
64
- Zine
65
- belongs_to :team
66
- has_many :posts
67
- has_many :members, :through => :posts, :source => 'member'
68
- ```
69
-
70
- ## running tests
71
-
72
- You must cd into the milia/test directory.
73
- Then run test:units, test:functionals seperately.
74
-
75
- ```ruby
76
- $ cd test
77
- $ rake db:create
78
- $ rake db:migrate
79
- $ rake db:test:prepare
80
- $ rake test:units
81
- $ rake test:functionals
82
- ```
83
-
@@ -1,6 +0,0 @@
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
- Miliatest::Application.load_tasks
@@ -1,16 +0,0 @@
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 jquery
14
- //= require jquery_ujs
15
- // require turbolinks
16
- //= require_tree .