shoestrap 0.0.2.pre → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +2 -1
- data/lib/generators/shoestrap/app_generator.rb +2 -1
- data/lib/generators/shoestrap/cms_generator.rb +6 -0
- data/lib/shoestrap/app_builder.rb +14 -3
- data/shoestrap.gemspec +1 -1
- data/templates/Gemfile.erb +1 -0
- data/templates/_main_navigation.html.haml.erb +7 -0
- data/templates/application.html.haml +1 -1
- data/templates/kuhsaft.css.sass +2 -0
- data/templates/rails/scaffold_controller/controller.rb +3 -3
- metadata +7 -5
data/CHANGELOG.md
CHANGED
@@ -29,6 +29,12 @@ module Shoestrap
|
|
29
29
|
generate 'resource_route', name
|
30
30
|
end
|
31
31
|
|
32
|
+
def generate_nav_link
|
33
|
+
inject_into_file 'app/views/kuhsaft/cms/admin/_main_navigation.html.haml', :after => 'kuhsaft.cms_pages_path' do
|
34
|
+
"\n %li\n = link_to t(\'cms.#{real_table_name}\'), #{plural_table_name}_path"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
32
38
|
def generate_translations
|
33
39
|
template 'model.yml.erb', "config/locales/de/#{real_table_name}.yml"
|
34
40
|
end
|
@@ -29,8 +29,9 @@ module Shoestrap
|
|
29
29
|
def setup_database
|
30
30
|
# TODO: implement
|
31
31
|
# use pg db sample
|
32
|
-
# rake db:create
|
33
|
-
|
32
|
+
# rake db:create?
|
33
|
+
rake 'db:migrate'
|
34
|
+
rake 'db:seed'
|
34
35
|
end
|
35
36
|
|
36
37
|
def configure_generators
|
@@ -54,7 +55,7 @@ module Shoestrap
|
|
54
55
|
eos
|
55
56
|
end
|
56
57
|
|
57
|
-
inject_into_file 'app/assets/javascripts/application.js', "\n
|
58
|
+
inject_into_file 'app/assets/javascripts/application.js', "\n//= require bootstrap\n", :before => '//= require_tree .'
|
58
59
|
end
|
59
60
|
|
60
61
|
def configure_application
|
@@ -83,6 +84,16 @@ module Shoestrap
|
|
83
84
|
remove_public_index
|
84
85
|
end
|
85
86
|
|
87
|
+
def install_kuhsaft
|
88
|
+
# depends on kuhsaft
|
89
|
+
rake 'kuhsaft:install:migrations'
|
90
|
+
route 'mount Kuhsaft::Engine => "/"'
|
91
|
+
copy_file 'kuhsaft.css.sass', 'app/assets/stylesheets/kuhsaft.css.sass'
|
92
|
+
inject_into_file 'app/assets/javascripts/application.js', "\n//= require 'kuhsaft/application'\n", :before => '//= require_tree .'
|
93
|
+
empty_directory 'app/views/kuhsaft/cms/admin/'
|
94
|
+
template '_main_navigation.html.haml.erb', 'app/views/kuhsaft/cms/admin/_main_navigation.html.haml'
|
95
|
+
end
|
96
|
+
|
86
97
|
def outro
|
87
98
|
say 'Application is ready!'
|
88
99
|
end
|
data/shoestrap.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "shoestrap"
|
6
|
-
s.version = '0.0.2
|
6
|
+
s.version = '0.0.2'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Immanuel Häussermann", "Felipe Kaufmann", "Phil Schilter", "Noëlle Rosenberg"]
|
9
9
|
s.email = "info@screenconcept.ch"
|
data/templates/Gemfile.erb
CHANGED
@@ -3,7 +3,7 @@ require_dependency "<%= namespaced_file_path %>/application_controller"
|
|
3
3
|
|
4
4
|
<% end -%>
|
5
5
|
<% module_namespacing do -%>
|
6
|
-
class <%= controller_class_name %>Controller <
|
6
|
+
class <%= controller_class_name %>Controller < Kuhsaft::Cms::AdminController
|
7
7
|
# GET <%= route_url %>
|
8
8
|
# GET <%= route_url %>.json
|
9
9
|
def index
|
@@ -45,7 +45,7 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
45
45
|
# POST <%= route_url %>
|
46
46
|
# POST <%= route_url %>.json
|
47
47
|
def create
|
48
|
-
@<%= singular_table_name %> = <%= orm_class.build(class_name.gsub('Cms::',''), "params[:#{singular_table_name}]") %>
|
48
|
+
@<%= singular_table_name %> = <%= orm_class.build(class_name.gsub('Cms::',''), "params[:#{singular_table_name.gsub('_cms','')}]") %>
|
49
49
|
|
50
50
|
respond_to do |format|
|
51
51
|
if @<%= orm_instance.save %>
|
@@ -64,7 +64,7 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
64
64
|
@<%= singular_table_name %> = <%= orm_class.find(class_name.gsub('Cms::',''), "params[:id]") %>
|
65
65
|
|
66
66
|
respond_to do |format|
|
67
|
-
if @<%= orm_instance.update_attributes("params[:#{singular_table_name}]") %>
|
67
|
+
if @<%= orm_instance.update_attributes("params[:#{singular_table_name.gsub('_cms','')}]") %>
|
68
68
|
format.html { redirect_to <%= singular_table_name %>_path(@<%= singular_table_name %>), <%= key_value :notice, "'#{human_name} was successfully updated.'" %> }
|
69
69
|
format.json { head :no_content }
|
70
70
|
else
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoestrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.2
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Immanuel Häussermann
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-01-
|
15
|
+
date: 2013-01-23 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rspec
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- templates/Gemfile.erb
|
91
91
|
- templates/Guardfile
|
92
92
|
- templates/README.md.erb
|
93
|
+
- templates/_main_navigation.html.haml.erb
|
93
94
|
- templates/application.html.haml
|
94
95
|
- templates/bootstrap_and_overrides.css.sass
|
95
96
|
- templates/development_mail_interceptor.rb
|
@@ -98,6 +99,7 @@ files:
|
|
98
99
|
- templates/haml/scaffold/index.html.haml
|
99
100
|
- templates/haml/scaffold/new.html.haml
|
100
101
|
- templates/index.html.haml
|
102
|
+
- templates/kuhsaft.css.sass
|
101
103
|
- templates/rails/scaffold_controller/controller.rb
|
102
104
|
- templates/setup_mail.rb
|
103
105
|
- templates/shoestrap.yml
|
@@ -116,9 +118,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
119
|
none: false
|
118
120
|
requirements:
|
119
|
-
- - ! '
|
121
|
+
- - ! '>='
|
120
122
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
123
|
+
version: '0'
|
122
124
|
requirements: []
|
123
125
|
rubyforge_project: shoestrap
|
124
126
|
rubygems_version: 1.8.24
|