tanraya-playmo 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
data/lib/tanraya-playmo.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#require "tanraya_playmo/version"
|
2
1
|
require "playmo"
|
3
2
|
|
4
3
|
module TanrayaPlaymo
|
@@ -9,5 +8,9 @@ module TanrayaPlaymo
|
|
9
8
|
#cookbook.delete_all
|
10
9
|
|
11
10
|
# Load custom recipes
|
12
|
-
|
11
|
+
$:.unshift File.expand_path('../../recipes', __FILE__)
|
12
|
+
|
13
|
+
Dir[File.expand_path('../../recipes/*_recipe.rb', __FILE__).to_s].each do |f|
|
14
|
+
require f
|
15
|
+
end
|
13
16
|
end
|
data/recipes/appgems_recipe.rb
CHANGED
@@ -2,7 +2,7 @@ recipe :appgems do
|
|
2
2
|
description 'This will add necessary gems into your app'
|
3
3
|
after :dragonfly
|
4
4
|
|
5
|
-
|
5
|
+
silently do
|
6
6
|
# see https://github.com/sj26/mailcatcher
|
7
7
|
gem 'mailcatcher', '0.5.1', :group => :development
|
8
8
|
|
@@ -29,5 +29,4 @@ recipe :appgems do
|
|
29
29
|
gsub_file 'Gemfile', /^\s{2}gem 'sass-rails'.+$/, ''
|
30
30
|
gem 'sass-rails', '3.1.5'
|
31
31
|
end
|
32
|
-
end
|
33
|
-
|
32
|
+
end
|
data/recipes/dragonfly_recipe.rb
CHANGED
@@ -7,16 +7,19 @@ recipe :dragonfly do
|
|
7
7
|
gem 'rack-cache', :require => 'rack/cache'
|
8
8
|
|
9
9
|
# Create initializer
|
10
|
-
create_file 'config/initializers/dragonfly.rb'
|
11
|
-
|
12
|
-
|
10
|
+
create_file 'config/initializers/dragonfly.rb' do
|
11
|
+
<<-CONTENT.gsub(/^ {6}/, '')
|
12
|
+
require 'dragonfly/rails/images'
|
13
|
+
CONTENT
|
14
|
+
end
|
13
15
|
|
14
16
|
# Create Image model?
|
15
17
|
#ask "Create polymorphic Image model?" do
|
16
18
|
# Create migration
|
17
19
|
filename = "db/migrate/#{(Time.now).strftime("%Y%m%d%H%M%S")}_create_images.rb"
|
18
20
|
|
19
|
-
create_file filename
|
21
|
+
create_file filename do
|
22
|
+
<<-CONTENT.gsub(/^ {8}/, '')
|
20
23
|
class CreateImages < ActiveRecord::Migration
|
21
24
|
def change
|
22
25
|
create_table :images do |t|
|
@@ -33,9 +36,11 @@ recipe :dragonfly do
|
|
33
36
|
end
|
34
37
|
end
|
35
38
|
CONTENT
|
39
|
+
end
|
36
40
|
|
37
41
|
# Create polymorphic Image model
|
38
|
-
create_file 'app/models/image.rb'
|
42
|
+
create_file 'app/models/image.rb' do
|
43
|
+
<<-CONTENT.gsub(/^ {8}/, '')
|
39
44
|
# Polymorphic Image model that works with Dragonfly gem.
|
40
45
|
#
|
41
46
|
# = How to associate this model with another?
|
@@ -77,6 +82,7 @@ recipe :dragonfly do
|
|
77
82
|
default_scope order(:updated_at)
|
78
83
|
end
|
79
84
|
CONTENT
|
85
|
+
end
|
80
86
|
|
81
87
|
# TODO Add this into deploy.rb
|
82
88
|
install do
|
@@ -93,26 +99,25 @@ recipe :dragonfly do
|
|
93
99
|
|
94
100
|
after 'deploy:update_code', 'dragonfly:symlink'
|
95
101
|
CONTENT
|
102
|
+
end
|
96
103
|
|
97
|
-
|
98
|
-
|
104
|
+
append_file 'db/seebs.rb' do
|
105
|
+
<<-CONTENT.gsub(/^ {12}/, '')
|
99
106
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
107
|
+
# Example of how to add images to imageable model:
|
108
|
+
# def read_photo(photo)
|
109
|
+
# return File.open(File.join(File.dirname(__FILE__), "seeds", "photos", photo), "rb")
|
110
|
+
# end
|
104
111
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
112
|
+
# u = Consultor.create!({:email => 'ohlobystin@example.com', :password => 'secret', :password_confirmation => 'secret'})
|
113
|
+
# u.build_profile({:name => 'Ivan Ohlobystin', :image_attributes => { :image => read_photo('ohlobystin.jpg')}})
|
114
|
+
# u.roles << consultor_role
|
115
|
+
# u.save!
|
116
|
+
|
117
|
+
CONTENT
|
112
118
|
end
|
113
119
|
|
114
120
|
end
|
115
121
|
|
116
|
-
#end
|
117
122
|
end
|
118
123
|
end
|
data/recipes/tableless_recipe.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tanraya-playmo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: playmo
|
16
|
-
requirement: &
|
16
|
+
requirement: &10137300 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10137300
|
25
25
|
description: This just only for my purposes
|
26
26
|
email:
|
27
27
|
- andrew@tanraya.com
|