scottmotte-merb-auth-slice-multisite 1.0.7.1 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008 Scott Motte
1
+ Copyright (c) 2009 scottmotte
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
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.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.textile CHANGED
@@ -4,12 +4,12 @@ This slice setups multisite capabilities in your merb application with an authen
4
4
 
5
5
  It works for subdomains (i.e. coolcars.yourapp.com) or for domains routed to your application via your server (i.e. coolcars.com).
6
6
 
7
- It a check to make match a user to the site he's trying to login to.
8
-
9
- <object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=2844037&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=2844037&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><br /><a href="http://vimeo.com/">merb-auth-slice-multisite installation</a> from <a href="http://vimeo.com/user1166117">Scott Motte</a> on <a href="http://vimeo.com">Vimeo</a>.
7
+ It has a check to make a user to the site he's trying to login to. If the user does not match than authentication fails.
10
8
 
11
9
  h2. Instructions for installation:
12
10
 
11
+ 0. Check out the video. <a href="http://scottmotte.github.com/merb-auth-slice-multisite/">How to install merb-auth-slice-multisite in your application.</a>
12
+
13
13
  1. Download the gem and install.
14
14
  <pre><code># from your terminal
15
15
  cd ~
@@ -21,7 +21,7 @@ sudo rake install
21
21
  </code></pre>
22
22
 
23
23
  2. Setup your application to use the gem.* Add the following to the end of dependencies.rb.
24
- <pre><code>dependency "merb-auth-slice-multisite", "1.0.7.1"</code></pre>
24
+ <pre><code>dependency "merb-auth-slice-multisite", "0.2"</code></pre>
25
25
 
26
26
  3. Add in mixin. In your user model or in merb/merb-auth/setup.rb add the mixin
27
27
  include Merb::Authentication::Mixins::UserBelongsToSite and then migrate your database.
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :major: 1
3
+ :minor: 0
4
+ :patch: 10
@@ -26,7 +26,7 @@ if defined?(Merb::Plugins)
26
26
 
27
27
  # Slice metadata
28
28
  self.description = "Merb Slice that adds basic multisite functionality to merb-auth."
29
- self.version = "1.0.7.1"
29
+ self.version = "0.2"
30
30
  self.author = "Scott Motte"
31
31
 
32
32
  # Stub classes loaded hook - runs before LoadClasses BootLoader
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class MerbAuthSliceMultisiteTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'merb_auth_slice_multisite'
8
+
9
+ class Test::Unit::TestCase
10
+ end
metadata CHANGED
@@ -1,45 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scottmotte-merb-auth-slice-multisite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7.1
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
- - Scott Motte
7
+ - scottmotte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-15 00:00:00 -08:00
12
+ date: 2009-03-27 00:00:00 -07:00
13
13
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: merb-slices
17
- version_requirement:
18
- version_requirements: !ruby/object:Gem::Requirement
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: "1.0"
23
- version:
24
- - !ruby/object:Gem::Dependency
25
- name: merb-auth-core
26
- version_requirement:
27
- version_requirements: !ruby/object:Gem::Requirement
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: "1.0"
32
- version:
33
- - !ruby/object:Gem::Dependency
34
- name: merb-auth-more
35
- version_requirement:
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: "1.0"
41
- version:
42
- description: Merb Slice that adds basic multisite functionality to merb-auth.
14
+ dependencies: []
15
+
16
+ description:
43
17
  email: scott@scottmotte.com
44
18
  executables: []
45
19
 
@@ -48,21 +22,9 @@ extensions: []
48
22
  extra_rdoc_files:
49
23
  - README.textile
50
24
  - LICENSE
51
- - TODO
52
25
  files:
53
- - LICENSE
54
26
  - README.textile
55
- - Rakefile
56
- - TODO
57
- - app/controllers
58
- - app/controllers/application.rb
59
- - app/helpers
60
- - app/helpers/application_helper.rb
61
- - app/models
62
- - app/models/site.rb
63
- - app/views
64
- - app/views/layout
65
- - app/views/layout/merb-auth-slice-multisite.html.erb
27
+ - VERSION.yml
66
28
  - lib/merb-auth-slice-multisite
67
29
  - lib/merb-auth-slice-multisite/merbtasks.rb
68
30
  - lib/merb-auth-slice-multisite/mixins
@@ -72,20 +34,18 @@ files:
72
34
  - lib/merb-auth-slice-multisite/slicetasks.rb
73
35
  - lib/merb-auth-slice-multisite/spectasks.rb
74
36
  - lib/merb-auth-slice-multisite.rb
75
- - public/javascripts
76
- - public/javascripts/master.js
77
- - public/stylesheets
78
- - public/stylesheets/master.css
37
+ - lib/merb_auth_slice_multisite.rb
38
+ - test/merb_auth_slice_multisite_test.rb
39
+ - test/test_helper.rb
79
40
  - spec/merb-auth-slice-multisite_spec.rb
80
41
  - spec/spec_helper.rb
81
- - stubs/app
82
- - stubs/app/controllers
83
- - stubs/app/controllers/application.rb
42
+ - LICENSE
84
43
  has_rdoc: true
85
- homepage: http://scottmotte.com/
44
+ homepage: http://github.com/scottmotte/merb-auth-slice-multisite
86
45
  post_install_message:
87
- rdoc_options: []
88
-
46
+ rdoc_options:
47
+ - --inline-source
48
+ - --charset=UTF-8
89
49
  require_paths:
90
50
  - lib
91
51
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -102,10 +62,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
62
  version:
103
63
  requirements: []
104
64
 
105
- rubyforge_project: merb
65
+ rubyforge_project:
106
66
  rubygems_version: 1.2.0
107
67
  signing_key:
108
68
  specification_version: 2
109
- summary: Merb Slice that adds basic multi-site functionality to merb-auth.
69
+ summary: Merb Slice that adds basic multisite functionality to merb-auth.
110
70
  test_files: []
111
71
 
data/Rakefile DELETED
@@ -1,56 +0,0 @@
1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
- require 'merb-core'
4
- require 'merb-core/tasks/merb'
5
-
6
- GEM_NAME = "merb-auth-slice-multisite"
7
- AUTHOR = "Scott Motte"
8
- EMAIL = "scott@scottmotte.com"
9
- HOMEPAGE = "http://scottmotte.com/"
10
- SUMMARY = "Merb Slice that adds basic multisite functionality to merb-auth."
11
- GEM_VERSION = "1.0.7.1"
12
-
13
- spec = Gem::Specification.new do |s|
14
- s.rubyforge_project = 'merb'
15
- s.name = GEM_NAME
16
- s.version = GEM_VERSION
17
- s.platform = Gem::Platform::RUBY
18
- s.has_rdoc = true
19
- s.extra_rdoc_files = ["README.textile", "LICENSE"]
20
- s.summary = SUMMARY
21
- s.description = s.summary
22
- s.author = AUTHOR
23
- s.email = EMAIL
24
- s.homepage = HOMEPAGE
25
- s.add_dependency('merb-slices', '>= 1.0')
26
- s.add_dependency('merb-auth-core', '>= 1.0')
27
- s.add_dependency('merb-auth-more', '>= 1.0')
28
- s.require_path = 'lib'
29
- s.files = %w(LICENSE README.textile Rakefile) + Dir.glob("{lib,spec,app,public,stubs}/**/*")
30
- end
31
-
32
- Rake::GemPackageTask.new(spec) do |pkg|
33
- pkg.gem_spec = spec
34
- end
35
-
36
- desc "Install the gem"
37
- task :install do
38
- Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
39
- end
40
-
41
- desc "Uninstall the gem"
42
- task :uninstall do
43
- Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
44
- end
45
-
46
- desc "Create a gemspec file"
47
- task :gemspec do
48
- File.open("#{GEM_NAME}.gemspec", "w") do |file|
49
- file.puts spec.to_ruby
50
- end
51
- end
52
-
53
- require 'spec/rake/spectask'
54
- require 'merb-core/test/tasks/spectasks'
55
- desc 'Default: run spec examples'
56
- task :default => 'spec'
data/TODO DELETED
@@ -1,3 +0,0 @@
1
- TODO:
2
-
3
- - coming soon
@@ -1,5 +0,0 @@
1
- class MerbAuthSliceMultisite::Application < Merb::Controller
2
-
3
- controller_for_slice
4
-
5
- end
@@ -1,64 +0,0 @@
1
- module Merb
2
- module MerbAuthSliceMultisite
3
- module ApplicationHelper
4
-
5
- # @param *segments<Array[#to_s]> Path segments to append.
6
- #
7
- # @return <String>
8
- # A path relative to the public directory, with added segments.
9
- def image_path(*segments)
10
- public_path_for(:image, *segments)
11
- end
12
-
13
- # @param *segments<Array[#to_s]> Path segments to append.
14
- #
15
- # @return <String>
16
- # A path relative to the public directory, with added segments.
17
- def javascript_path(*segments)
18
- public_path_for(:javascript, *segments)
19
- end
20
-
21
- # @param *segments<Array[#to_s]> Path segments to append.
22
- #
23
- # @return <String>
24
- # A path relative to the public directory, with added segments.
25
- def stylesheet_path(*segments)
26
- public_path_for(:stylesheet, *segments)
27
- end
28
-
29
- # Construct a path relative to the public directory
30
- #
31
- # @param <Symbol> The type of component.
32
- # @param *segments<Array[#to_s]> Path segments to append.
33
- #
34
- # @return <String>
35
- # A path relative to the public directory, with added segments.
36
- def public_path_for(type, *segments)
37
- ::MerbAuthSliceMultisite.public_path_for(type, *segments)
38
- end
39
-
40
- # Construct an app-level path.
41
- #
42
- # @param <Symbol> The type of component.
43
- # @param *segments<Array[#to_s]> Path segments to append.
44
- #
45
- # @return <String>
46
- # A path within the host application, with added segments.
47
- def app_path_for(type, *segments)
48
- ::MerbAuthSliceMultisite.app_path_for(type, *segments)
49
- end
50
-
51
- # Construct a slice-level path.
52
- #
53
- # @param <Symbol> The type of component.
54
- # @param *segments<Array[#to_s]> Path segments to append.
55
- #
56
- # @return <String>
57
- # A path within the slice source (Gem), with added segments.
58
- def slice_path_for(type, *segments)
59
- ::MerbAuthSliceMultisite.slice_path_for(type, *segments)
60
- end
61
-
62
- end
63
- end
64
- end
data/app/models/site.rb DELETED
@@ -1,37 +0,0 @@
1
- class Site
2
- include DataMapper::Resource
3
-
4
- # Schema
5
- property :id, Serial
6
- property :domain, String, :nullable => :false, :length => (1..40), :unique => true, :format => /(\.[a-z]{2,4})$/
7
- property :folder, String, :nullable => :false, :length => (1..40), :unique => true
8
- property :subdomain, String, :nullable => :false, :length => (1..40), :unique => true, :format => /^[a-zA-Z0-9\-]*?$/
9
-
10
- # Relationships/Associates
11
- has n, :users, :order => [:login.asc]
12
-
13
- # Validations
14
- validates_with_method :check_subdomain
15
-
16
- ReservedSubdomains = %w[backstage admin blog dev ftp mail email pop pop3 imap smtp stage stats status www]
17
- def check_subdomain
18
- if ReservedSubdomains.include?(self.subdomain)
19
- [false, "Subdomain '#{self.subdomain}' is reserved."]
20
- else
21
- true
22
- end
23
- end
24
-
25
- # Hooks
26
- before :valid?, :remove_http_and_www
27
- def remove_http_and_www
28
- domain.gsub!('http://', '')
29
- domain.gsub!('www.', '')
30
- end
31
-
32
- before :save, :generate_folder
33
- def generate_folder
34
- self.folder = domain.gsub('.', '')
35
- end
36
-
37
- end
@@ -1,16 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
3
- <head>
4
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
- <title>Fresh MerbAuthSliceMultisite Slice</title>
6
- <link href="<%= public_path_for :stylesheet, 'master.css' %>" type="text/css" charset="utf-8" rel="stylesheet" media="all" />
7
- <script src="<%= public_path_for :javascript, 'master.js' %>" type="text/javascript" charset="utf-8"></script>
8
- </head>
9
- <!-- you can override this layout at slices/merb-auth-slice-multisite/app/views/layout/merb-auth-slice-multisite.html.erb -->
10
- <body class="merb-auth-slice-multisite-slice">
11
- <div id="container">
12
- <h1>MerbAuthSliceMultisite Slice</h1>
13
- <div id="main"><%= catch_content :for_layout %></div>
14
- </div>
15
- </body>
16
- </html>
@@ -1,2 +0,0 @@
1
- html, body { margin: 0; padding: 0; }
2
- #container { width: 800px; margin: 4em auto; padding: 4em 4em 6em 4em; background: #DDDDDD; }
@@ -1,2 +0,0 @@
1
- class MerbAuthSliceMultisite::Application < Merb::Controller
2
- end