site_framework 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8fc968672524bb1803ff7864afa25d0c0073b91
4
- data.tar.gz: ca646c16fdac1b6d86ade486f4b190731e46644f
3
+ metadata.gz: f8e95a16b23e98de803f2c46040dc05e53575bee
4
+ data.tar.gz: d79408b41041f185b019cee2be65b80c803de057
5
5
  SHA512:
6
- metadata.gz: d3364066d1c9fbea40b4d9c3f9dc37f915e5ce45d8cd8304953a2f8de6ad4104b072c00997a4591376d08420a51c5a97060d8089501a6b2e1c843763cc0285a8
7
- data.tar.gz: ec0f66d5a2796f639949a6b5d4623382e5ced2dd7710c7e686d78c7e5957b88d53bdd638102d2ad55946d4ffe78b587d4355a40f5127ffaf95f37d5e08ae3be0
6
+ metadata.gz: 90b9d6a9aba0421b2a450442608cb552f39522ac2d6894fac8e04b9bc031bbd094b01c4fa01bafa7ff7a51afe36be401151c31c1372543863dacca701889847f
7
+ data.tar.gz: 8730e12142001896affe4905e166cf7cb196cd49f4074d976b0b58781213e24ea700faa7041040bd6323270d3bd79a6db47eb7db2a4a6ee9e19f7d2f5a493448
data/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # SiteFramework
1
+ # SiteFramework - [![Gem Version](https://badge.fury.io/rb/site_framework.png)](http://badge.fury.io/rb/site_framework)
2
2
 
3
- A site framework for Ruby on Rails web framework inspired by Django site fremework. The idea of this gem to transparently make Rails facilities to work with different domains.
3
+ A site framework for Ruby on Rails web framework inspired by Django site fremework. The idea of this gem to transparently make Rails facilities to work with different domains.
@@ -1,4 +1,9 @@
1
1
  module SiteFramework
2
2
  class Domain < ActiveRecord::Base
3
+ belongs_to :site
4
+
5
+ validates_associated :site
6
+ validates :name, :presence => true,
7
+ :format => { :with => /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix }
3
8
  end
4
9
  end
@@ -0,0 +1,14 @@
1
+ module SiteFramework
2
+ class Site < ActiveRecord::Base
3
+ has_many :domains
4
+
5
+ def slug
6
+ if title
7
+ title
8
+ else
9
+ # TODO: generate a sha1 hash base on time
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -2,7 +2,7 @@ class CreateSiteFrameworkDomains < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :site_framework_domains do |t|
4
4
  t.string :name
5
- t.string :alias
5
+ t.integer :site_id
6
6
 
7
7
  t.timestamps
8
8
  end
@@ -0,0 +1,10 @@
1
+ class CreateSiteFrameworkSites < ActiveRecord::Migration
2
+ def change
3
+ create_table :site_framework_sites do |t|
4
+ t.string :title
5
+ t.string :description
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module SiteFramework
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ module SiteFramework
4
+ describe Site do
5
+ pending "add some examples to (or delete) #{__FILE__}"
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sameer Rahmani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-20 00:00:00.000000000 Z
11
+ date: 2014-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -48,7 +48,9 @@ extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
50
  - app/models/site_framework/domain.rb
51
+ - app/models/site_framework/site.rb
51
52
  - config/routes.rb
53
+ - db/migrate/20140303141448_create_site_framework_sites.rb
52
54
  - db/migrate/20140118200201_create_site_framework_domains.rb
53
55
  - lib/site_framework/active_record/migration.rb
54
56
  - lib/site_framework/active_record/concerns.rb
@@ -62,6 +64,7 @@ files:
62
64
  - Rakefile
63
65
  - README.md
64
66
  - spec/spec_helper.rb
67
+ - spec/models/site_framework/site_spec.rb
65
68
  - spec/models/site_framework/domain_spec.rb
66
69
  - spec/dummy/public/500.html
67
70
  - spec/dummy/public/404.html
@@ -121,6 +124,7 @@ summary: A site framework for Ruby on Rails web framework inspired by Django sit
121
124
  fremework
122
125
  test_files:
123
126
  - spec/spec_helper.rb
127
+ - spec/models/site_framework/site_spec.rb
124
128
  - spec/models/site_framework/domain_spec.rb
125
129
  - spec/dummy/public/500.html
126
130
  - spec/dummy/public/404.html