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 CHANGED
@@ -1,7 +1,8 @@
1
1
  #Changelog
2
2
 
3
- ## master
3
+ ## 0.0.2
4
4
 
5
+ * add cms generator and integrate with kuhsaft
5
6
  * Add lib/ to autoload path
6
7
  * fix MailInterceptor
7
8
 
@@ -14,8 +14,9 @@ module Shoestrap
14
14
  build :bundle
15
15
  build :configure_application
16
16
  build :setup_bdd_env
17
- build :setup_database
18
17
  build :configure_generators
18
+ build :install_kuhsaft
19
+ build :setup_database
19
20
  build :outro
20
21
  end
21
22
 
@@ -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
- # rake db:migrate
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 //= require bootstrap", :before => '//= require_tree .'
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.pre'
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"
@@ -21,6 +21,7 @@ gem 'simple_form'
21
21
  gem 'mail'
22
22
  gem 'fabrication'
23
23
  gem 'shoestrap'
24
+ gem 'kuhsaft', :git => 'git@github.com:screenconcept/kuhsaft.git', :branch => 'features/shoestrap_integration'
24
25
 
25
26
  group :development, :test do
26
27
  gem 'pry'
@@ -0,0 +1,7 @@
1
+ = link_to '<%= app_name %>', '#', :class => 'brand'
2
+ %p.navbar-text.pull-right
3
+ = link_to t('.logout'), kuhsaft.destroy_cms_admin_session_path, :method => :delete
4
+ %ul.nav
5
+ %li
6
+ = link_to Kuhsaft::Page.model_name.human(:count => 2), kuhsaft.cms_pages_path
7
+
@@ -14,7 +14,7 @@
14
14
  .navbar.navbar-fixed-top
15
15
  .navbar-inner
16
16
  .container
17
- = link_to <%= app_name %>, '#', :class => 'brand'
17
+ = link_to '<%= app_name %>', '#', :class => 'brand'
18
18
  %ul.nav
19
19
 
20
20
  .container
@@ -0,0 +1,2 @@
1
+ @import 'kuhsaft/application'
2
+
@@ -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 < ApplicationController
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.pre
5
- prerelease: 6
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-21 00:00:00.000000000 Z
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: 1.3.1
123
+ version: '0'
122
124
  requirements: []
123
125
  rubyforge_project: shoestrap
124
126
  rubygems_version: 1.8.24