thesilverspoon 0.0.18 → 0.0.19
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/lib/thesilverspoon.rb
CHANGED
@@ -70,7 +70,7 @@ module Everything
|
|
70
70
|
"namespace(:#{namespace}){ #{acc} }"
|
71
71
|
}
|
72
72
|
|
73
|
-
|
73
|
+
s=%{match "#{resource}_integrated_view"=>"#{resource}#integrated_view"\n}
|
74
74
|
|
75
75
|
inject_into_file "config/routes.rb", s, :after=>"resources :#{resource}\n"
|
76
76
|
|
@@ -228,12 +228,24 @@ module Thesilverspoon
|
|
228
228
|
Rails::Generators.invoke('devise', ["user"])
|
229
229
|
Rails::Generators.invoke('devise:views')
|
230
230
|
Rails::Generators.invoke('cancan:ability')
|
231
|
-
Rails::Generators.invoke('
|
232
|
-
|
231
|
+
Rails::Generators.invoke('migration', ["add_role_to_user", ["admin:boolean"]])
|
232
|
+
Rails::Generators.invoke('controller',["welcome",["index"]])
|
233
233
|
end
|
234
|
-
|
234
|
+
|
235
|
+
def create_new_user
|
235
236
|
s="\nUser.create!(:email=>'admin@tss.com',:password=>'secret',:password_confirmation=>'secret',:admin=>true)"
|
236
|
-
append_to_file "db/seeds.rb",s
|
237
|
+
append_to_file "db/seeds.rb", s
|
238
|
+
|
239
|
+
end
|
240
|
+
|
241
|
+
def create_root_route
|
242
|
+
|
243
|
+
s="root"
|
244
|
+
s=s+":to=>"
|
245
|
+
s=s+"'welcome#index'\n"
|
246
|
+
|
247
|
+
# append_to_file "config/routes.rb",s
|
248
|
+
inject_into_file "config/routes.rb",s,:after=>"GemTest3::Application.routes.draw do\n"
|
237
249
|
|
238
250
|
end
|
239
251
|
|
@@ -314,18 +326,38 @@ def create_new_user
|
|
314
326
|
end
|
315
327
|
|
316
328
|
def insert_devise_code
|
317
|
-
|
329
|
+
inject_into_file "config/application.rb", 'require "devise"', :after=>"require File.expand_path('../boot', __FILE__)\n"
|
318
330
|
inject_into_file "config/application.rb", "require 'bootstrap-sass'\n", :after=>"require File.expand_path('../boot', __FILE__)\n"
|
319
|
-
|
331
|
+
inject_into_file "config/application.rb", "require 'bootstrapped'\n", :after=>"require 'rails/all'\n"
|
320
332
|
inject_into_file "config/application.rb", "require 'gritter'\n", :after=>"require 'rails/all'\n"
|
321
|
-
|
322
|
-
|
333
|
+
|
334
|
+
|
335
|
+
inject_into_file "app/assets/stylesheets/application.css", '*=require_directory', :before=>"*/"
|
336
|
+
|
323
337
|
append_to_file "app/assets/javascripts/application.js", '//= require bootstrap'
|
324
338
|
inject_into_file "app/controllers/application_controller.rb", "before_filter :authenticate_user!\n", :after=>" protect_from_forgery\n"
|
325
339
|
|
326
340
|
|
327
|
-
|
341
|
+
end
|
328
342
|
|
329
343
|
|
344
|
+
end
|
330
345
|
end
|
346
|
+
|
347
|
+
|
348
|
+
module Revert
|
349
|
+
# If you use the NamedBase inheritance, a 'name' parameter has to follow the 'rails g integratedscaffold'. Won't work otherwise. If you don't want this, use ::Base
|
350
|
+
class Layout < Rails::Generators::Base
|
351
|
+
|
352
|
+
def self.source_root
|
353
|
+
File.expand_path("../templates", __FILE__)
|
354
|
+
end
|
355
|
+
def initialize(*args, &block)
|
356
|
+
super
|
357
|
+
remove_file "app/views/layouts/application.html.erb"
|
358
|
+
template "#{Layout.source_root}/layouts/general_layout.html.erb",'app/views/layouts/application.html.erb'
|
359
|
+
|
360
|
+
end
|
361
|
+
end
|
331
362
|
end
|
363
|
+
|
data/lib/thesilverspoon.rb~
CHANGED
@@ -70,7 +70,7 @@ module Everything
|
|
70
70
|
"namespace(:#{namespace}){ #{acc} }"
|
71
71
|
}
|
72
72
|
|
73
|
-
|
73
|
+
s=%{match "#{resource}_integrated_view"=>"#{resource}#integrated_view"\n}
|
74
74
|
|
75
75
|
inject_into_file "config/routes.rb", s, :after=>"resources :#{resource}\n"
|
76
76
|
|
@@ -228,12 +228,24 @@ module Thesilverspoon
|
|
228
228
|
Rails::Generators.invoke('devise', ["user"])
|
229
229
|
Rails::Generators.invoke('devise:views')
|
230
230
|
Rails::Generators.invoke('cancan:ability')
|
231
|
-
Rails::Generators.invoke('
|
232
|
-
|
231
|
+
Rails::Generators.invoke('migration', ["add_role_to_user", ["admin:boolean"]])
|
232
|
+
Rails::Generators.invoke('controller',["welcome",["index"]])
|
233
233
|
end
|
234
|
-
|
234
|
+
|
235
|
+
def create_new_user
|
235
236
|
s="\nUser.create!(:email=>'admin@tss.com',:password=>'secret',:password_confirmation=>'secret',:admin=>true)"
|
236
|
-
append_to_file "db/seeds.rb",s
|
237
|
+
append_to_file "db/seeds.rb", s
|
238
|
+
|
239
|
+
end
|
240
|
+
|
241
|
+
def create_root_route
|
242
|
+
|
243
|
+
s="root"
|
244
|
+
s=s+":to=>"
|
245
|
+
s=s+"'welcome#index'\n"
|
246
|
+
|
247
|
+
# append_to_file "config/routes.rb",s
|
248
|
+
inject_into_file "config/routes.rb",s,:after=>"GemTest3::Application.routes.draw do\n"
|
237
249
|
|
238
250
|
end
|
239
251
|
|
@@ -314,18 +326,38 @@ def create_new_user
|
|
314
326
|
end
|
315
327
|
|
316
328
|
def insert_devise_code
|
317
|
-
|
329
|
+
inject_into_file "config/application.rb", 'require "devise"', :after=>"require File.expand_path('../boot', __FILE__)\n"
|
318
330
|
inject_into_file "config/application.rb", "require 'bootstrap-sass'\n", :after=>"require File.expand_path('../boot', __FILE__)\n"
|
319
|
-
|
331
|
+
inject_into_file "config/application.rb", "require 'bootstrapped'\n", :after=>"require 'rails/all'\n"
|
320
332
|
inject_into_file "config/application.rb", "require 'gritter'\n", :after=>"require 'rails/all'\n"
|
321
|
-
|
322
|
-
|
333
|
+
|
334
|
+
|
335
|
+
inject_into_file "app/assets/stylesheets/application.css", '*=require_directory', :before=>"*/"
|
336
|
+
|
323
337
|
append_to_file "app/assets/javascripts/application.js", '//= require bootstrap'
|
324
338
|
inject_into_file "app/controllers/application_controller.rb", "before_filter :authenticate_user!\n", :after=>" protect_from_forgery\n"
|
325
339
|
|
326
340
|
|
327
|
-
|
341
|
+
end
|
328
342
|
|
329
343
|
|
344
|
+
end
|
330
345
|
end
|
346
|
+
|
347
|
+
|
348
|
+
module Revert
|
349
|
+
# If you use the NamedBase inheritance, a 'name' parameter has to follow the 'rails g integratedscaffold'. Won't work otherwise. If you don't want this, use ::Base
|
350
|
+
class Layout < Rails::Generators::Base
|
351
|
+
|
352
|
+
def self.source_root
|
353
|
+
File.expand_path("../templates", __FILE__)
|
354
|
+
end
|
355
|
+
def initialize(*args, &block)
|
356
|
+
super
|
357
|
+
remove_file "app/views/layouts/application.html.erb"
|
358
|
+
template "#{Layout.source_root}/layouts/general_layout.html.erb",'app/views/layouts/application.html.erb'
|
359
|
+
|
360
|
+
end
|
361
|
+
end
|
331
362
|
end
|
363
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thesilverspoon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-03 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &80395380 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *80395380
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bootstrapped
|
27
|
-
requirement: &
|
27
|
+
requirement: &80394960 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *80394960
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: gritter
|
38
|
-
requirement: &
|
38
|
+
requirement: &80394260 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *80394260
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: spreadsheet
|
49
|
-
requirement: &
|
49
|
+
requirement: &80393880 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *80393880
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: carrierwave
|
60
|
-
requirement: &
|
60
|
+
requirement: &80393530 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *80393530
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: devise
|
71
|
-
requirement: &
|
71
|
+
requirement: &80393000 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *80393000
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: cancan
|
82
|
-
requirement: &
|
82
|
+
requirement: &80383530 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *80383530
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: nifty-generators
|
93
|
-
requirement: &
|
93
|
+
requirement: &80382590 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *80382590
|
102
102
|
description: This gem preps a new Rails app with some of the best Rails gems and Jquery
|
103
103
|
sweetness available( Twitter-Bootstrap, Devise, CanCan, Rails Admin, Spreadsheet,
|
104
104
|
) Not only does it takes care of the installation of these gems, it also extends
|
@@ -251,6 +251,8 @@ files:
|
|
251
251
|
- lib/templates/layouts/application.html.erb~
|
252
252
|
- lib/templates/layouts/dummy_data.html.erb
|
253
253
|
- lib/templates/layouts/dummy_data.html.erb~
|
254
|
+
- lib/templates/layouts/general_layout.html.erb
|
255
|
+
- lib/templates/layouts/general_layout.html.erb~
|
254
256
|
- lib/templates/layouts/information_page.html.erb
|
255
257
|
- lib/templates/layouts/pageslide_form_at.html.erb
|
256
258
|
- lib/templates/layouts/welcome.html.erb
|