comfy_gallery 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/assets/images/{sofa_gallery → comfy_gallery}/jcrop.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/orbit/bullets.jpg +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/orbit/left-arrow.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/orbit/loading.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/orbit/mask-black.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/orbit/pause-black.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/orbit/right-arrow.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/orbit/rotator-black.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/orbit/timer-black.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/btnNext.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/btnPrevious.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/contentPattern.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/default_thumbnail.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/loader.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/sprite.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/btnNext.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/btnPrevious.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/contentPattern.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/default_thumbnail.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/loader.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/sprite.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/default/default_thumb.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/default/loader.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/default/sprite.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/default/sprite_next.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/default/sprite_prev.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/default/sprite_x.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/default/sprite_y.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/btnNext.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/btnPrevious.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/contentPatternBottom.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/contentPatternLeft.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/contentPatternRight.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/contentPatternTop.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/default_thumbnail.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/loader.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/sprite.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_rounded/btnNext.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_rounded/btnPrevious.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_rounded/default_thumbnail.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_rounded/loader.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_rounded/sprite.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_square/btnNext.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_square/btnPrevious.png +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_square/default_thumbnail.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_square/loader.gif +0 -0
- data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_square/sprite.png +0 -0
- data/app/assets/javascripts/{sofa_gallery → comfy_gallery}/admin.js +0 -0
- data/app/assets/javascripts/{sofa_gallery → comfy_gallery}/application.js +0 -0
- data/app/assets/javascripts/{sofa_gallery → comfy_gallery}/jquery.jcrop.js +0 -0
- data/app/assets/javascripts/{sofa_gallery → comfy_gallery}/jquery.orbit-1.2.3.min.js +0 -0
- data/app/assets/javascripts/{sofa_gallery → comfy_gallery}/thumbnails.js +0 -0
- data/app/assets/stylesheets/comfy_gallery/jquery.jcrop.css +1 -1
- data/app/controllers/admin/gallery/photos_controller.rb +1 -7
- data/app/models/gallery/gallery.rb +1 -1
- data/app/models/gallery/photo.rb +0 -4
- data/app/views/admin/gallery/_html_head.html.erb +1 -1
- data/app/views/admin/gallery/_navigation.html.erb +1 -1
- data/app/views/admin/gallery/galleries/_form.html.erb +2 -6
- data/app/views/admin/gallery/galleries/index.html.erb +1 -1
- data/app/views/admin/gallery/photos/_form.html.erb +3 -7
- data/app/views/admin/gallery/photos/index.html.erb +0 -1
- data/comfy_gallery.gemspec +56 -56
- data/db/migrate/01_create_comfy_gallery.rb +5 -7
- data/lib/generators/{README → comfy/gallery/README} +0 -0
- data/lib/generators/comfy/gallery/gallery_generator.rb +37 -0
- data/test/fixtures/gallery/galleries.yml +1 -1
- data/test/fixtures/gallery/photos.yml +0 -1
- data/test/functional/admin/gallery/galleries_controller_test.rb +1 -1
- data/test/functional/admin/gallery/photos_controller_test.rb +3 -13
- data/test/unit/gallery_test.rb +4 -4
- data/test/unit/photo_test.rb +0 -2
- metadata +67 -67
- data/lib/generators/comfy_gallery_generator.rb +0 -33
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/btnPrevious.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/contentPattern.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_rounded/default_thumbnail.gif
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/btnPrevious.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/contentPattern.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/dark_square/default_thumbnail.gif
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/contentPatternBottom.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/contentPatternLeft.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/contentPatternRight.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/contentPatternTop.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/facebook/default_thumbnail.gif
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_rounded/btnPrevious.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_square/btnPrevious.png
RENAMED
File without changes
|
data/app/assets/images/{sofa_gallery → comfy_gallery}/prettyPhoto/light_square/default_thumbnail.gif
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,7 +4,7 @@
|
|
4
4
|
.jcrop-vline, .jcrop-hline {
|
5
5
|
font-size: 0px;
|
6
6
|
position: absolute;
|
7
|
-
background: white url('/assets/
|
7
|
+
background: white url('/assets/comfy_gallery/jcrop.gif') top left repeat;
|
8
8
|
}
|
9
9
|
.jcrop-vline { height: 100%; width: 1px !important; }
|
10
10
|
.jcrop-hline { width: 100%; height: 1px !important; }
|
@@ -24,13 +24,7 @@ class Admin::Gallery::PhotosController < Admin::Gallery::BaseController
|
|
24
24
|
)
|
25
25
|
title = title + " #{i + 1}" if file_params[:title] == title && file_array.size > 1
|
26
26
|
|
27
|
-
|
28
|
-
file_params[:image].original_filename.parameterize :
|
29
|
-
file_params[:slug]
|
30
|
-
)
|
31
|
-
slug = (slug + "-#{i + 1}") if file_params[:slug] == slug && file_array.size > 1
|
32
|
-
|
33
|
-
@photo = Gallery::Photo.new({:gallery => @gallery}.merge(file_params.merge(:title => title, :slug => slug) || {}))
|
27
|
+
@photo = Gallery::Photo.new({:gallery => @gallery}.merge(file_params.merge(:title => title) || {}))
|
34
28
|
@photo.save!
|
35
29
|
end
|
36
30
|
|
data/app/models/gallery/photo.rb
CHANGED
@@ -30,10 +30,6 @@ class Gallery::Photo < ActiveRecord::Base
|
|
30
30
|
# -- Validations ----------------------------------------------------------
|
31
31
|
validates :gallery_id,
|
32
32
|
:presence => true
|
33
|
-
validates :slug,
|
34
|
-
:presence => true,
|
35
|
-
:uniqueness => true,
|
36
|
-
:format => { :with => /^\w[a-z0-9_-]*$/i }
|
37
33
|
validates_attachment_presence :image,
|
38
34
|
:message => 'There was no file uploaded!'
|
39
35
|
validates_attachment_content_type :image,
|
@@ -1 +1 @@
|
|
1
|
-
<%= stylesheet_link_tag '
|
1
|
+
<%= stylesheet_link_tag 'comfy_gallery/admin' %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= form.text_field :title, :id => (@gallery.new_record?? 'slugify' : nil)%>
|
2
|
-
<%= form.text_field :
|
2
|
+
<%= form.text_field :identifier, :id => 'slug' %>
|
3
3
|
<%= form.text_area :description%>
|
4
4
|
|
5
5
|
<%= form.text_field :full_width %>
|
@@ -11,8 +11,4 @@
|
|
11
11
|
|
12
12
|
<%= render :partial => 'cms_admin/categories/form', :object => form if defined?(ComfortableMexicanSofa) %>
|
13
13
|
|
14
|
-
<%= form.
|
15
|
-
<%= link_to "Cancel", admin_gallery_galleries_path, :id => 'cancel_btn' %>
|
16
|
-
<span>or</span>
|
17
|
-
<%= form.submit "Save", :disable_builder => true%>
|
18
|
-
<% end %>
|
14
|
+
<%= form.submit 'Save' %>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<%= link_to gallery_path(gallery), gallery_path(gallery), :target => '_blank' %>
|
29
29
|
</td>
|
30
30
|
<td class='embed'>
|
31
|
-
{{ cms:helper:render_gallery:<%= gallery.
|
31
|
+
{{ cms:helper:render_gallery:<%= gallery.identifier %> }}
|
32
32
|
</td>
|
33
33
|
<td class='action_links'>
|
34
34
|
<%= link_to 'Show Photos', admin_gallery_gallery_photos_path(gallery) %>
|
@@ -1,5 +1,4 @@
|
|
1
|
-
<%= form.text_field :title
|
2
|
-
<%= form.text_field :slug, :id => 'slug' %>
|
1
|
+
<%= form.text_field :title %>
|
3
2
|
<% if @photo.image? && @photo.id.present? %>
|
4
3
|
<%= form.simple_field 'Current Image' do %>
|
5
4
|
<%= image_tag(@photo.image.url(:thumb)) %>
|
@@ -9,8 +8,5 @@
|
|
9
8
|
<% end %>
|
10
9
|
<%= form.file_field :image, :multiple => true %>
|
11
10
|
<%= form.text_area :description %>
|
12
|
-
|
13
|
-
|
14
|
-
<span>or</span>
|
15
|
-
<%= form.submit "Save", :disable_builder => true%>
|
16
|
-
<% end %>
|
11
|
+
|
12
|
+
<%= form.submit 'Save' %>
|
@@ -11,7 +11,6 @@
|
|
11
11
|
</td>
|
12
12
|
<td class='main'>
|
13
13
|
<div class='title'><%= photo.title %></div>
|
14
|
-
<div class='sublabel'><%= photo.slug %></div>
|
15
14
|
</td>
|
16
15
|
<td class='action_links'>
|
17
16
|
<%= link_to 'Crop', crop_admin_gallery_gallery_photo_path(@gallery, photo) if photo.force_aspect? %>
|
data/comfy_gallery.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "comfy_gallery"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Oleg Khabarov", "Stephen McLeod", "The Working Group Inc."]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-02-10"
|
13
13
|
s.description = ""
|
14
14
|
s.email = "oleg@twg.ca"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -24,58 +24,58 @@ Gem::Specification.new do |s|
|
|
24
24
|
"README.md",
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
|
-
"app/assets/images/
|
28
|
-
"app/assets/images/
|
29
|
-
"app/assets/images/
|
30
|
-
"app/assets/images/
|
31
|
-
"app/assets/images/
|
32
|
-
"app/assets/images/
|
33
|
-
"app/assets/images/
|
34
|
-
"app/assets/images/
|
35
|
-
"app/assets/images/
|
36
|
-
"app/assets/images/
|
37
|
-
"app/assets/images/
|
38
|
-
"app/assets/images/
|
39
|
-
"app/assets/images/
|
40
|
-
"app/assets/images/
|
41
|
-
"app/assets/images/
|
42
|
-
"app/assets/images/
|
43
|
-
"app/assets/images/
|
44
|
-
"app/assets/images/
|
45
|
-
"app/assets/images/
|
46
|
-
"app/assets/images/
|
47
|
-
"app/assets/images/
|
48
|
-
"app/assets/images/
|
49
|
-
"app/assets/images/
|
50
|
-
"app/assets/images/
|
51
|
-
"app/assets/images/
|
52
|
-
"app/assets/images/
|
53
|
-
"app/assets/images/
|
54
|
-
"app/assets/images/
|
55
|
-
"app/assets/images/
|
56
|
-
"app/assets/images/
|
57
|
-
"app/assets/images/
|
58
|
-
"app/assets/images/
|
59
|
-
"app/assets/images/
|
60
|
-
"app/assets/images/
|
61
|
-
"app/assets/images/
|
62
|
-
"app/assets/images/
|
63
|
-
"app/assets/images/
|
64
|
-
"app/assets/images/
|
65
|
-
"app/assets/images/
|
66
|
-
"app/assets/images/
|
67
|
-
"app/assets/images/
|
68
|
-
"app/assets/images/
|
69
|
-
"app/assets/images/
|
70
|
-
"app/assets/images/
|
71
|
-
"app/assets/images/
|
72
|
-
"app/assets/images/
|
73
|
-
"app/assets/images/
|
74
|
-
"app/assets/javascripts/
|
75
|
-
"app/assets/javascripts/
|
76
|
-
"app/assets/javascripts/
|
77
|
-
"app/assets/javascripts/
|
78
|
-
"app/assets/javascripts/
|
27
|
+
"app/assets/images/comfy_gallery/jcrop.gif",
|
28
|
+
"app/assets/images/comfy_gallery/orbit/bullets.jpg",
|
29
|
+
"app/assets/images/comfy_gallery/orbit/left-arrow.png",
|
30
|
+
"app/assets/images/comfy_gallery/orbit/loading.gif",
|
31
|
+
"app/assets/images/comfy_gallery/orbit/mask-black.png",
|
32
|
+
"app/assets/images/comfy_gallery/orbit/pause-black.png",
|
33
|
+
"app/assets/images/comfy_gallery/orbit/right-arrow.png",
|
34
|
+
"app/assets/images/comfy_gallery/orbit/rotator-black.png",
|
35
|
+
"app/assets/images/comfy_gallery/orbit/timer-black.png",
|
36
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/btnNext.png",
|
37
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/btnPrevious.png",
|
38
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/contentPattern.png",
|
39
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/default_thumbnail.gif",
|
40
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/loader.gif",
|
41
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/sprite.png",
|
42
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_square/btnNext.png",
|
43
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_square/btnPrevious.png",
|
44
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_square/contentPattern.png",
|
45
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_square/default_thumbnail.gif",
|
46
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_square/loader.gif",
|
47
|
+
"app/assets/images/comfy_gallery/prettyPhoto/dark_square/sprite.png",
|
48
|
+
"app/assets/images/comfy_gallery/prettyPhoto/default/default_thumb.png",
|
49
|
+
"app/assets/images/comfy_gallery/prettyPhoto/default/loader.gif",
|
50
|
+
"app/assets/images/comfy_gallery/prettyPhoto/default/sprite.png",
|
51
|
+
"app/assets/images/comfy_gallery/prettyPhoto/default/sprite_next.png",
|
52
|
+
"app/assets/images/comfy_gallery/prettyPhoto/default/sprite_prev.png",
|
53
|
+
"app/assets/images/comfy_gallery/prettyPhoto/default/sprite_x.png",
|
54
|
+
"app/assets/images/comfy_gallery/prettyPhoto/default/sprite_y.png",
|
55
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/btnNext.png",
|
56
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/btnPrevious.png",
|
57
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/contentPatternBottom.png",
|
58
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/contentPatternLeft.png",
|
59
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/contentPatternRight.png",
|
60
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/contentPatternTop.png",
|
61
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/default_thumbnail.gif",
|
62
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/loader.gif",
|
63
|
+
"app/assets/images/comfy_gallery/prettyPhoto/facebook/sprite.png",
|
64
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_rounded/btnNext.png",
|
65
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_rounded/btnPrevious.png",
|
66
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_rounded/default_thumbnail.gif",
|
67
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_rounded/loader.gif",
|
68
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_rounded/sprite.png",
|
69
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_square/btnNext.png",
|
70
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_square/btnPrevious.png",
|
71
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_square/default_thumbnail.gif",
|
72
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_square/loader.gif",
|
73
|
+
"app/assets/images/comfy_gallery/prettyPhoto/light_square/sprite.png",
|
74
|
+
"app/assets/javascripts/comfy_gallery/admin.js",
|
75
|
+
"app/assets/javascripts/comfy_gallery/application.js",
|
76
|
+
"app/assets/javascripts/comfy_gallery/jquery.jcrop.js",
|
77
|
+
"app/assets/javascripts/comfy_gallery/jquery.orbit-1.2.3.min.js",
|
78
|
+
"app/assets/javascripts/comfy_gallery/thumbnails.js",
|
79
79
|
"app/assets/stylesheets/comfy_gallery/admin.css",
|
80
80
|
"app/assets/stylesheets/comfy_gallery/application.css",
|
81
81
|
"app/assets/stylesheets/comfy_gallery/carousel.css.erb",
|
@@ -125,8 +125,8 @@ Gem::Specification.new do |s|
|
|
125
125
|
"lib/comfy_gallery/configuration.rb",
|
126
126
|
"lib/comfy_gallery/engine.rb",
|
127
127
|
"lib/comfy_gallery/form_builder.rb",
|
128
|
-
"lib/generators/README",
|
129
|
-
"lib/generators/
|
128
|
+
"lib/generators/comfy/gallery/README",
|
129
|
+
"lib/generators/comfy/gallery/gallery_generator.rb",
|
130
130
|
"lib/paperclip_processors/cropper.rb",
|
131
131
|
"lib/tasks/comfy_gallery.rake",
|
132
132
|
"script/rails",
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateComfyGallery < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
create_table :gallery_galleries do |t|
|
4
|
-
t.string :title
|
5
|
-
t.string :
|
4
|
+
t.string :title, :null => false
|
5
|
+
t.string :identifier, :null => false
|
6
6
|
t.text :description
|
7
7
|
t.integer :full_width, :null => false, :default => 640
|
8
8
|
t.integer :full_height, :null => false, :default => 480
|
@@ -12,12 +12,11 @@ class CreateComfyGallery < ActiveRecord::Migration
|
|
12
12
|
t.boolean :force_ratio_thumb, :null => false, :default => true
|
13
13
|
t.timestamps
|
14
14
|
end
|
15
|
-
add_index :gallery_galleries, :
|
15
|
+
add_index :gallery_galleries, :identifier, :uniq => true
|
16
16
|
|
17
17
|
create_table :gallery_photos do |t|
|
18
|
-
t.integer :gallery_id
|
18
|
+
t.integer :gallery_id, :null => false
|
19
19
|
t.string :title
|
20
|
-
t.string :slug
|
21
20
|
t.text :description
|
22
21
|
t.string :image_file_name
|
23
22
|
t.string :image_content_type
|
@@ -26,9 +25,8 @@ class CreateComfyGallery < ActiveRecord::Migration
|
|
26
25
|
t.timestamps
|
27
26
|
end
|
28
27
|
add_index :gallery_photos, [ :gallery_id, :position ]
|
29
|
-
add_index :gallery_photos, :slug
|
30
28
|
end
|
31
|
-
|
29
|
+
|
32
30
|
def self.down
|
33
31
|
drop_table :gallery_photos
|
34
32
|
drop_table :gallery_galleries
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Comfy
|
2
|
+
module Generators
|
3
|
+
class GalleryGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
require 'rails/generators/active_record'
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
source_root File.expand_path('../../../../..', __FILE__)
|
10
|
+
|
11
|
+
def generate_migration
|
12
|
+
destination = File.expand_path('db/migrate/01_create_comfy_gallery.rb', self.destination_root)
|
13
|
+
migration_dir = File.dirname(destination)
|
14
|
+
destination = self.class.migration_exists?(migration_dir, 'create_comfy_gallery')
|
15
|
+
|
16
|
+
if destination
|
17
|
+
puts "\e[0m\e[31mFound existing create_comfy_gallery.rb migration. Remove it if you want to regenerate.\e[0m"
|
18
|
+
else
|
19
|
+
migration_template 'db/migrate/01_create_comfy_gallery.rb', 'db/migrate/create_comfy_gallery.rb'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def generate_initialization
|
24
|
+
copy_file 'config/initializers/comfy_gallery.rb', 'config/initializers/comfy_gallery.rb'
|
25
|
+
end
|
26
|
+
|
27
|
+
def show_readme
|
28
|
+
readme 'lib/generators/comfy/gallery/README'
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.next_migration_number(dirname)
|
32
|
+
ActiveRecord::Generators::Base.next_migration_number(dirname)
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -20,7 +20,7 @@ class Admin::Gallery::GalleriesControllerTest < ActionController::TestCase
|
|
20
20
|
assert_difference 'Gallery::Gallery.count', 1 do
|
21
21
|
post :create, :gallery => {
|
22
22
|
:title => 'Test Gallery',
|
23
|
-
:
|
23
|
+
:identifier => 'test-gallery',
|
24
24
|
:description => 'Test Description'
|
25
25
|
}
|
26
26
|
end
|
@@ -29,7 +29,6 @@ class Admin::Gallery::PhotosControllerTest < ActionController::TestCase
|
|
29
29
|
assert_difference 'Gallery::Photo.count' do
|
30
30
|
post :create, :gallery_id => gallery_galleries(:default), :gallery_photo => {
|
31
31
|
:title => 'Test Photo',
|
32
|
-
:slug => 'test-photo',
|
33
32
|
:image => [fixture_file_upload('/files/default.jpg', 'image/jpeg')]
|
34
33
|
}
|
35
34
|
assert_response :redirect
|
@@ -38,11 +37,10 @@ class Admin::Gallery::PhotosControllerTest < ActionController::TestCase
|
|
38
37
|
|
39
38
|
photo = Gallery::Photo.last
|
40
39
|
assert_equal 'Test Photo', photo.title
|
41
|
-
assert_equal 'test-photo', photo.slug
|
42
40
|
end
|
43
41
|
end
|
44
42
|
|
45
|
-
def
|
43
|
+
def test_create_without_title
|
46
44
|
assert_difference 'Gallery::Photo.count', 2 do
|
47
45
|
post :create, :gallery_id => gallery_galleries(:default), :gallery_photo => {
|
48
46
|
:image => [fixture_file_upload('/files/default.jpg', 'image/jpeg')]
|
@@ -53,16 +51,13 @@ class Admin::Gallery::PhotosControllerTest < ActionController::TestCase
|
|
53
51
|
|
54
52
|
photo = Gallery::Photo.last
|
55
53
|
assert_equal 'default.jpg', photo.title
|
56
|
-
assert_equal 'default-jpg', photo.slug
|
57
54
|
|
58
55
|
post :create, :gallery_id => gallery_galleries(:default), :gallery_photo => {
|
59
|
-
:slug => 'Testrrr',
|
60
56
|
:image => [fixture_file_upload('/files/default.jpg', 'image/jpeg')]
|
61
57
|
}
|
62
58
|
|
63
59
|
photo = Gallery::Photo.last
|
64
60
|
assert_equal 'default.jpg', photo.title
|
65
|
-
assert_equal 'Testrrr', photo.slug
|
66
61
|
end
|
67
62
|
end
|
68
63
|
|
@@ -82,7 +77,6 @@ class Admin::Gallery::PhotosControllerTest < ActionController::TestCase
|
|
82
77
|
assert_difference 'Gallery::Photo.count', 2 do
|
83
78
|
post :create, :gallery_id => gallery_galleries(:default), :gallery_photo => {
|
84
79
|
:title => 'Test Photo',
|
85
|
-
:slug => 'test-photo',
|
86
80
|
:image => [
|
87
81
|
fixture_file_upload('/files/default.jpg', 'image/jpeg'),
|
88
82
|
fixture_file_upload('/files/default.jpg', 'image/jpeg')
|
@@ -97,8 +91,6 @@ class Admin::Gallery::PhotosControllerTest < ActionController::TestCase
|
|
97
91
|
assert_equal 'default.jpg', photo_b.image_file_name
|
98
92
|
assert_equal 'Test Photo 1', photo_a.title
|
99
93
|
assert_equal 'Test Photo 2', photo_b.title
|
100
|
-
assert_equal 'test-photo-1', photo_a.slug
|
101
|
-
assert_equal 'test-photo-2', photo_b.slug
|
102
94
|
assert_equal 'Photo created', flash[:notice]
|
103
95
|
end
|
104
96
|
end
|
@@ -162,7 +154,6 @@ class Admin::Gallery::PhotosControllerTest < ActionController::TestCase
|
|
162
154
|
photo_two = Gallery::Photo.create!(
|
163
155
|
:gallery => gallery,
|
164
156
|
:title => 'Test Photo',
|
165
|
-
:slug => 'test-photo',
|
166
157
|
:image => fixture_file_upload('/files/default.jpg', 'image/jpeg')
|
167
158
|
)
|
168
159
|
assert_equal 0, photo_one.position
|
@@ -205,14 +196,13 @@ class Admin::Gallery::PhotosControllerTest < ActionController::TestCase
|
|
205
196
|
|
206
197
|
def test_crop_thumbnail_and_full
|
207
198
|
gallery = Gallery::Gallery.create!(
|
208
|
-
:title =>
|
209
|
-
:
|
199
|
+
:title => 'test',
|
200
|
+
:identifier => 'test',
|
210
201
|
:force_ratio_full => true
|
211
202
|
)
|
212
203
|
photo = Gallery::Photo.create!(
|
213
204
|
:gallery => gallery,
|
214
205
|
:title => 'Test Photo',
|
215
|
-
:slug => 'test-photo',
|
216
206
|
:image => fixture_file_upload('/files/default.jpg', 'image/jpeg')
|
217
207
|
)
|
218
208
|
put :update, :gallery_id => gallery, :id => photo, :photo => {
|
data/test/unit/gallery_test.rb
CHANGED
@@ -11,19 +11,19 @@ class GalleryTest < ActiveSupport::TestCase
|
|
11
11
|
def test_validations
|
12
12
|
gallery = Gallery::Gallery.new
|
13
13
|
assert gallery.invalid?
|
14
|
-
assert_has_errors_on gallery, [:title, :
|
14
|
+
assert_has_errors_on gallery, [:title, :identifier]
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_creation
|
18
18
|
assert_difference 'Gallery::Gallery.count' do
|
19
19
|
Gallery::Gallery.create!(
|
20
|
-
:title
|
21
|
-
:
|
20
|
+
:title => 'Test Gallery',
|
21
|
+
:identifier => 'test-gallery'
|
22
22
|
)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
26
|
+
def test_destroy
|
27
27
|
gallery = gallery_galleries(:default)
|
28
28
|
assert_difference ['Gallery::Gallery.count', 'Gallery::Photo.count'], -1 do
|
29
29
|
gallery.destroy
|
data/test/unit/photo_test.rb
CHANGED
@@ -13,7 +13,6 @@ class PhotoTest < ActiveSupport::TestCase
|
|
13
13
|
assert photo.invalid?
|
14
14
|
assert_has_errors_on photo, {
|
15
15
|
:gallery_id => ["can't be blank"],
|
16
|
-
:slug => ["can't be blank", "is invalid"],
|
17
16
|
:image_file_name => ["There was no file uploaded!"]
|
18
17
|
}
|
19
18
|
end
|
@@ -24,7 +23,6 @@ class PhotoTest < ActiveSupport::TestCase
|
|
24
23
|
Gallery::Photo.create!(
|
25
24
|
:gallery => gallery,
|
26
25
|
:title => 'Test Photo',
|
27
|
-
:slug => 'test-photo',
|
28
26
|
:image => fixture_file_upload('/files/default.jpg', 'image/jpeg')
|
29
27
|
)
|
30
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfy_gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-02-10 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
18
|
-
requirement: &
|
18
|
+
requirement: &70321662930880 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: 3.1.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70321662930880
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: paperclip
|
29
|
-
requirement: &
|
29
|
+
requirement: &70321662930060 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 2.3.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70321662930060
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: jquery-rails
|
40
|
-
requirement: &
|
40
|
+
requirement: &70321662929320 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: 1.0.14
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70321662929320
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: sqlite3
|
51
|
-
requirement: &
|
51
|
+
requirement: &70321662849200 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: '0'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70321662849200
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: jeweler
|
62
|
-
requirement: &
|
62
|
+
requirement: &70321662848460 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *70321662848460
|
71
71
|
description: ''
|
72
72
|
email: oleg@twg.ca
|
73
73
|
executables: []
|
@@ -83,58 +83,58 @@ files:
|
|
83
83
|
- README.md
|
84
84
|
- Rakefile
|
85
85
|
- VERSION
|
86
|
-
- app/assets/images/
|
87
|
-
- app/assets/images/
|
88
|
-
- app/assets/images/
|
89
|
-
- app/assets/images/
|
90
|
-
- app/assets/images/
|
91
|
-
- app/assets/images/
|
92
|
-
- app/assets/images/
|
93
|
-
- app/assets/images/
|
94
|
-
- app/assets/images/
|
95
|
-
- app/assets/images/
|
96
|
-
- app/assets/images/
|
97
|
-
- app/assets/images/
|
98
|
-
- app/assets/images/
|
99
|
-
- app/assets/images/
|
100
|
-
- app/assets/images/
|
101
|
-
- app/assets/images/
|
102
|
-
- app/assets/images/
|
103
|
-
- app/assets/images/
|
104
|
-
- app/assets/images/
|
105
|
-
- app/assets/images/
|
106
|
-
- app/assets/images/
|
107
|
-
- app/assets/images/
|
108
|
-
- app/assets/images/
|
109
|
-
- app/assets/images/
|
110
|
-
- app/assets/images/
|
111
|
-
- app/assets/images/
|
112
|
-
- app/assets/images/
|
113
|
-
- app/assets/images/
|
114
|
-
- app/assets/images/
|
115
|
-
- app/assets/images/
|
116
|
-
- app/assets/images/
|
117
|
-
- app/assets/images/
|
118
|
-
- app/assets/images/
|
119
|
-
- app/assets/images/
|
120
|
-
- app/assets/images/
|
121
|
-
- app/assets/images/
|
122
|
-
- app/assets/images/
|
123
|
-
- app/assets/images/
|
124
|
-
- app/assets/images/
|
125
|
-
- app/assets/images/
|
126
|
-
- app/assets/images/
|
127
|
-
- app/assets/images/
|
128
|
-
- app/assets/images/
|
129
|
-
- app/assets/images/
|
130
|
-
- app/assets/images/
|
131
|
-
- app/assets/images/
|
132
|
-
- app/assets/images/
|
133
|
-
- app/assets/javascripts/
|
134
|
-
- app/assets/javascripts/
|
135
|
-
- app/assets/javascripts/
|
136
|
-
- app/assets/javascripts/
|
137
|
-
- app/assets/javascripts/
|
86
|
+
- app/assets/images/comfy_gallery/jcrop.gif
|
87
|
+
- app/assets/images/comfy_gallery/orbit/bullets.jpg
|
88
|
+
- app/assets/images/comfy_gallery/orbit/left-arrow.png
|
89
|
+
- app/assets/images/comfy_gallery/orbit/loading.gif
|
90
|
+
- app/assets/images/comfy_gallery/orbit/mask-black.png
|
91
|
+
- app/assets/images/comfy_gallery/orbit/pause-black.png
|
92
|
+
- app/assets/images/comfy_gallery/orbit/right-arrow.png
|
93
|
+
- app/assets/images/comfy_gallery/orbit/rotator-black.png
|
94
|
+
- app/assets/images/comfy_gallery/orbit/timer-black.png
|
95
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/btnNext.png
|
96
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/btnPrevious.png
|
97
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/contentPattern.png
|
98
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/default_thumbnail.gif
|
99
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/loader.gif
|
100
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_rounded/sprite.png
|
101
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_square/btnNext.png
|
102
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_square/btnPrevious.png
|
103
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_square/contentPattern.png
|
104
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_square/default_thumbnail.gif
|
105
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_square/loader.gif
|
106
|
+
- app/assets/images/comfy_gallery/prettyPhoto/dark_square/sprite.png
|
107
|
+
- app/assets/images/comfy_gallery/prettyPhoto/default/default_thumb.png
|
108
|
+
- app/assets/images/comfy_gallery/prettyPhoto/default/loader.gif
|
109
|
+
- app/assets/images/comfy_gallery/prettyPhoto/default/sprite.png
|
110
|
+
- app/assets/images/comfy_gallery/prettyPhoto/default/sprite_next.png
|
111
|
+
- app/assets/images/comfy_gallery/prettyPhoto/default/sprite_prev.png
|
112
|
+
- app/assets/images/comfy_gallery/prettyPhoto/default/sprite_x.png
|
113
|
+
- app/assets/images/comfy_gallery/prettyPhoto/default/sprite_y.png
|
114
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/btnNext.png
|
115
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/btnPrevious.png
|
116
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/contentPatternBottom.png
|
117
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/contentPatternLeft.png
|
118
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/contentPatternRight.png
|
119
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/contentPatternTop.png
|
120
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/default_thumbnail.gif
|
121
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/loader.gif
|
122
|
+
- app/assets/images/comfy_gallery/prettyPhoto/facebook/sprite.png
|
123
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_rounded/btnNext.png
|
124
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_rounded/btnPrevious.png
|
125
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_rounded/default_thumbnail.gif
|
126
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_rounded/loader.gif
|
127
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_rounded/sprite.png
|
128
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_square/btnNext.png
|
129
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_square/btnPrevious.png
|
130
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_square/default_thumbnail.gif
|
131
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_square/loader.gif
|
132
|
+
- app/assets/images/comfy_gallery/prettyPhoto/light_square/sprite.png
|
133
|
+
- app/assets/javascripts/comfy_gallery/admin.js
|
134
|
+
- app/assets/javascripts/comfy_gallery/application.js
|
135
|
+
- app/assets/javascripts/comfy_gallery/jquery.jcrop.js
|
136
|
+
- app/assets/javascripts/comfy_gallery/jquery.orbit-1.2.3.min.js
|
137
|
+
- app/assets/javascripts/comfy_gallery/thumbnails.js
|
138
138
|
- app/assets/stylesheets/comfy_gallery/admin.css
|
139
139
|
- app/assets/stylesheets/comfy_gallery/application.css
|
140
140
|
- app/assets/stylesheets/comfy_gallery/carousel.css.erb
|
@@ -184,8 +184,8 @@ files:
|
|
184
184
|
- lib/comfy_gallery/configuration.rb
|
185
185
|
- lib/comfy_gallery/engine.rb
|
186
186
|
- lib/comfy_gallery/form_builder.rb
|
187
|
-
- lib/generators/README
|
188
|
-
- lib/generators/
|
187
|
+
- lib/generators/comfy/gallery/README
|
188
|
+
- lib/generators/comfy/gallery/gallery_generator.rb
|
189
189
|
- lib/paperclip_processors/cropper.rb
|
190
190
|
- lib/tasks/comfy_gallery.rake
|
191
191
|
- script/rails
|
@@ -217,7 +217,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
segments:
|
219
219
|
- 0
|
220
|
-
hash:
|
220
|
+
hash: -686661673297130780
|
221
221
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
222
|
none: false
|
223
223
|
requirements:
|
@@ -1,33 +0,0 @@
|
|
1
|
-
class ComfyGalleryGenerator < Rails::Generators::Base
|
2
|
-
|
3
|
-
require 'rails/generators/active_record'
|
4
|
-
include Rails::Generators::Migration
|
5
|
-
include Thor::Actions
|
6
|
-
|
7
|
-
source_root File.expand_path('../../..', __FILE__)
|
8
|
-
|
9
|
-
def generate_migration
|
10
|
-
destination = File.expand_path('db/migrate/01_create_comfy_gallery.rb', self.destination_root)
|
11
|
-
migration_dir = File.dirname(destination)
|
12
|
-
destination = self.class.migration_exists?(migration_dir, 'create_comfy_gallery')
|
13
|
-
|
14
|
-
if destination
|
15
|
-
puts "\e[0m\e[31mFound existing create_comfy_gallery.rb migration. Remove it if you want to regenerate.\e[0m"
|
16
|
-
else
|
17
|
-
migration_template 'db/migrate/01_create_comfy_gallery.rb', 'db/migrate/create_comfy_gallery.rb'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def generate_initialization
|
22
|
-
copy_file 'config/initializers/comfy_gallery.rb', 'config/initializers/comfy_gallery.rb'
|
23
|
-
end
|
24
|
-
|
25
|
-
def show_readme
|
26
|
-
readme 'lib/generators/README'
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.next_migration_number(dirname)
|
30
|
-
ActiveRecord::Generators::Base.next_migration_number(dirname)
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|