tb_permalinks 1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmJiODY1YjQ5ZWYwMGQwZmM5ZWI0NjBmODQ3ZjI4OWYyNDZhNjFmZA==
5
+ data.tar.gz: !binary |-
6
+ ZWZkNTJlN2NlNzVjZmQwZDQwNzgzMGQ3YmRhNDc2ZjM5MjY2MTNjMA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ Y2YxMGU3MGI0YmUxZTZhYmRlZjMzMmY5OGM4ODgxY2MwMDlhODYxY2FkNjBm
10
+ MTZkMzMxNjE2NDM5YjM3NmY2NGQyMDU2MjdjOTQyMjNkNzY1NDcwNjdhMTQw
11
+ NmYzYTJlNWZlYzRhMjFjODVkNmUwZWNmZjk5Y2VmY2IzYWIxMTU=
12
+ data.tar.gz: !binary |-
13
+ NjUzN2NkZDQ0NTcwNTg0MzU1ZTFmNTViYmYzNTM0MjIwOGE0YzEwMmJjYjQ2
14
+ ZDRjNDAxN2E5Yzk2MDVmOGNmOWM2ZTliMDQyMTllM2ZmMTY4MDA0NzAyMmI3
15
+ MDFmMzVhYjQzYTJjZGI2MDI0YzAxNzVhZTgwYWFlYzVjMTIwODE=
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
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.
data/README.md ADDED
@@ -0,0 +1,24 @@
1
+ SpudPermalinks
2
+ ==============
3
+
4
+ This project rocks and uses MIT-LICENSE.
5
+
6
+ Testing
7
+ -----------------
8
+
9
+ Spud uses RSpec for testing. Get the tests running with a few short commands:
10
+
11
+ 1. Create and migrate the databases:
12
+
13
+ rake db:create
14
+ rake db:migrate
15
+
16
+ 2. Load the schema in to the test database:
17
+
18
+ rake app:db:test:prepare
19
+
20
+ 3. Run the tests with RSpec
21
+
22
+ rspec spec
23
+
24
+ After the tests have completed the current code coverage stats is available by opening ```/coverage/index.html``` in a browser.
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'TbPermalinks'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+ Bundler::GemHelper.install_tasks
27
+
28
+ require 'rake'
@@ -0,0 +1,11 @@
1
+ class SpudPermalink < ActiveRecord::Base
2
+ belongs_to :attachment,:polymorphic => true
3
+ validates :url_name, :presence => true
4
+ validates_uniqueness_of :url_name, :scope => :site_id
5
+ validates :attachment_type, :presence => true
6
+ validates :attachment_id, :presence => true
7
+
8
+ scope :site, lambda {|sid| where(:site_id => sid)}
9
+
10
+ attr_accessible :url_name,:attachment_type,:attachment_id,:site_id
11
+ end
@@ -0,0 +1,11 @@
1
+ class CreateSpudPermalinks < ActiveRecord::Migration
2
+ def change
3
+ create_table :spud_permalinks do |t|
4
+ t.string :url_name
5
+ t.string :attachment_type
6
+ t.integer :attachment_id
7
+ t.timestamps
8
+ end
9
+ add_index :spud_permalinks, [:attachment_type,:attachment_id], :name => "idx_permalink_attachment"
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ class AddSiteIdToSpudPermalinks < ActiveRecord::Migration
2
+ def change
3
+ add_column :spud_permalinks, :site_id, :integer
4
+ add_index :spud_permalinks, :site_id, :name => "idx_permalinks_site_id"
5
+ end
6
+ end
@@ -0,0 +1,11 @@
1
+ class ModifySiteIdForSpudPermalinks < ActiveRecord::Migration
2
+ def up
3
+ change_column :spud_permalinks, :site_id, :integer, :default => 0, :null => false
4
+ SpudPermalink.where(:site_id => nil).each {|f| f.site_id = 0 ; f.save}
5
+ end
6
+
7
+ def down
8
+ change_column :spud_permalinks, :site_id, :integer, :default => nil, :null => true
9
+ SpudPermalink.where(:site_id => 0).each {|f| f.site_id = nil ; f.save}
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ module Spud
2
+ module Permalinks
3
+ class Engine < ::Rails::Engine
4
+ engine_name "spud_permalinks"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module Spud
2
+ module Permalinks
3
+ VERSION = "1.0"
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Spud
2
+ module Permalinks
3
+ require "spud_permalinks/engine"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tb_permalinks
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - Greg Woods
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: mysql2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.3.11
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.3.11
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 2.8.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 2.8.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.8.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.8.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: shoulda
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 3.0.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 3.0.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: factory_girl
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 2.5.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 2.5.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: mocha
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.10.3
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 0.10.3
111
+ - !ruby/object:Gem::Dependency
112
+ name: database_cleaner
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 0.7.1
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '='
123
+ - !ruby/object:Gem::Version
124
+ version: 0.7.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: 0.6.4
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: 0.6.4
139
+ description: This gem creates a polymorphic attachable model that can be used to store
140
+ historical information on page urls for 301 redirecting.
141
+ email:
142
+ - greg@westlakedesign.com
143
+ executables: []
144
+ extensions: []
145
+ extra_rdoc_files: []
146
+ files:
147
+ - app/models/spud_permalink.rb
148
+ - db/migrate/20120306195503_create_spud_permalinks.rb
149
+ - db/migrate/20120329135522_add_site_id_to_spud_permalinks.rb
150
+ - db/migrate/20120912123700_modify_site_id_for_spud_permalinks.rb
151
+ - lib/spud_permalinks/engine.rb
152
+ - lib/spud_permalinks/version.rb
153
+ - lib/tb_permalinks.rb
154
+ - MIT-LICENSE
155
+ - Rakefile
156
+ - README.md
157
+ homepage: http://bitbucket.org/westlakedesign/tb_permalinks
158
+ licenses: []
159
+ metadata: {}
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ! '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubyforge_project:
176
+ rubygems_version: 2.0.3
177
+ signing_key:
178
+ specification_version: 4
179
+ summary: Twice Baked Permalinks
180
+ test_files: []