shoestrap 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ spec/dummy/db/*.sqlite3
5
+ spec/dummy/log/*.log
6
+ spec/dummy/tmp/
7
+ spec/dummy/db/migrate/*.rb
8
+ spec/dummy/db/schema.rb
9
+ spec/dummy/public/stylesheets/*
10
+ spec/dummy/public/uploads/tmp/*
11
+ spec/dummy/public/uploads/kuhsaft/*
12
+ spec/dummy/public/uploads/*
13
+ spec/dummy/public/images/**/*
14
+ spec/dummy/public/javascripts/**/*
15
+ Gemfile.lock
16
+ .DS_Store
17
+ .sass-cache
18
+ tags
19
+ .idea
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format nested
data/.rvmrc ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
+ # development environment upon cd'ing into the directory
5
+
6
+ # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
7
+ # Only full ruby name is supported here, for short names use:
8
+ # echo "rvm use 1.9.3" > .rvmrc
9
+ environment_id="ruby-1.9.3-p194@shoestrap"
10
+
11
+ # Uncomment the following lines if you want to verify rvm version per project
12
+ # rvmrc_rvm_version="1.14.10 (stable)" # 1.10.1 seams as a safe start
13
+ # eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
14
+ # echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
15
+ # return 1
16
+ # }
17
+
18
+ # First we attempt to load the desired environment directly from the environment
19
+ # file. This is very fast and efficient compared to running through the entire
20
+ # CLI and selector. If you want feedback on which environment was used then
21
+ # insert the word 'use' after --create as this triggers verbose mode.
22
+ if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
23
+ && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
24
+ then
25
+ \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
26
+ [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
27
+ \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
28
+ else
29
+ # If the environment file has not yet been created, use the RVM CLI to select.
30
+ rvm --create "$environment_id" || {
31
+ echo "Failed to create RVM environment '${environment_id}'."
32
+ return 1
33
+ }
34
+ fi
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ - jruby-18mode # JRuby in 1.8 mode
7
+ - jruby-19mode # JRuby in 1.9 mode
8
+ - rbx-18mode
9
+ - rbx-19mode
10
+ # uncomment this line if your project needs to run something other than `rake`:
11
+ # script: bundle exec rspec spec
@@ -0,0 +1,4 @@
1
+ #Changelog
2
+
3
+ ## v0.0.1 - 2013-01-14
4
+ First Release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2011 Screen Concept©
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ # Screen Concept Rails App Bootstrapper
2
+
3
+ TBD
4
+
5
+ More Docs:
6
+
7
+ http://guides.rubyonrails.org/rails_application_templates.html
8
+ http://guides.rubyonrails.org/generators.html#application-templates
9
+
10
+ # LICENSE
11
+
12
+ See the file LICENSE.
@@ -0,0 +1,17 @@
1
+ require 'bundler'
2
+ require 'rake/clean'
3
+ #require 'rdoc/task'
4
+ require 'rspec/core/rake_task'
5
+
6
+ include Rake::DSL
7
+
8
+ Bundler::GemHelper.install_tasks
9
+
10
+ desc "Run specs"
11
+ RSpec::Core::RakeTask.new do |t|
12
+ # t.rspec_opts = %w(--colour --fail-fast --format nested)
13
+ t.rspec_opts = %w(--colour --format nested)
14
+ t.ruby_opts = %w(-w)
15
+ end
16
+
17
+ task :default => [:spec]
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(File.join('..', 'generators', 'app_generator'), File.dirname(__FILE__))
4
+ require File.expand_path(File.join('..', 'lib', 'shoestrap', 'app_builder'), File.dirname(__FILE__))
5
+
6
+ templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
7
+
8
+ Shoestrap::AppGenerator.source_root templates_root
9
+ Shoestrap::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root
10
+
11
+ Shoestrap::AppGenerator.start
12
+
@@ -0,0 +1,32 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/rails/app/app_generator'
3
+
4
+ module Shoestrap
5
+ class AppGenerator < Rails::Generators::AppGenerator
6
+ def finish_template
7
+ invoke :custom_generators
8
+ super
9
+ end
10
+
11
+ def custom_generators
12
+ # TODO: rvm! (generate rvmrc from currently used ruby/gemset)
13
+ build :remove_files_we_dont_need
14
+ build :bundle
15
+ build :setup_bdd_env
16
+ build :setup_database
17
+ build :configure_generators
18
+ build :outro
19
+ end
20
+
21
+ def run_bundle
22
+ # Don't run bundle now. First add gems etc.
23
+ end
24
+
25
+ protected
26
+
27
+ def get_builder_class
28
+ Shoestrap::AppBuilder
29
+ end
30
+ end
31
+ end
32
+
@@ -0,0 +1,82 @@
1
+ module Shoestrap
2
+ class AppBuilder < Rails::AppBuilder
3
+ def readme
4
+ config = {
5
+ app_name: app_name,
6
+ maintainer: ask('Who is the maintainer of the App?'),
7
+ consultant: ask('Who is the primary consultant for the App?')
8
+ }
9
+
10
+ template 'README.md.erb', 'README.md', config
11
+ end
12
+
13
+ def gemfile
14
+ template 'Gemfile.erb', 'Gemfile'
15
+ end
16
+
17
+ def bundle
18
+ bundle_command 'install'
19
+ bundle_command 'show rspec'
20
+ end
21
+
22
+ def setup_bdd_env
23
+ setup_rspec
24
+ setup_cucumber
25
+ setup_guard
26
+ setup_mail_interceptor
27
+ end
28
+
29
+ def setup_database
30
+ # TODO: implement
31
+ # use pg db sample
32
+ # rake db:create
33
+ # rake db:migrate
34
+ end
35
+
36
+ def configure_generators
37
+ # TODO: implement
38
+ # use haml, sass, rspec
39
+ end
40
+
41
+ def remove_files_we_dont_need
42
+ remove_rails_logo_image
43
+ remove_public_index
44
+ end
45
+
46
+ def outro
47
+ say 'Application is ready!'
48
+ end
49
+
50
+ private
51
+
52
+ def setup_mail_interceptor
53
+ # depends on mail gem
54
+ template 'mail_interceptor.rb', 'lib/mail_interceptor.rb'
55
+ template 'setup_mail.rb', 'config/initializers/setup_mail.rb'
56
+ end
57
+
58
+ def setup_rspec
59
+ # depends on rspec-rails gem
60
+ generate 'rspec:install'
61
+ end
62
+
63
+ def setup_cucumber
64
+ # depends on cucumber gem
65
+ generate 'cucumber:install'
66
+ end
67
+
68
+ def setup_guard
69
+ # depends on guard, guard-rspec, guard-cucumber
70
+ template 'Guardfile'
71
+ end
72
+
73
+ def remove_public_index
74
+ remove_file 'public/index.html'
75
+ end
76
+
77
+ def remove_rails_logo_image
78
+ remove_file 'app/assets/images/rails.png'
79
+ end
80
+ end
81
+ end
82
+
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "shoestrap"
6
+ s.version = '0.0.1'
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Immanuel Häussermann", "Felipe Kaufmann", "Phil Schilter", "Noëlle Rosenberg"]
9
+ s.email = "info@screenconcept.ch"
10
+ s.homepage = "http://github.com/screenconcept/shoestrap"
11
+ s.summary = %q{A tool that helps you bootstrap your rails projects}
12
+ s.description = %q{shoestrap is a rails app bootstrapper}
13
+
14
+ s.rubyforge_project = "shoestrap"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_development_dependency 'rspec'
22
+ s.add_development_dependency 'pry'
23
+ s.add_dependency 'rails'
24
+ end
@@ -0,0 +1,38 @@
1
+ source 'https://rubygems.org'
2
+
3
+ <%= rails_gemfile_entry -%>
4
+
5
+ <%= database_gemfile_entry -%>
6
+
7
+ <%= "gem 'jruby-openssl'\n" if defined?(JRUBY_VERSION) -%>
8
+
9
+ <%= assets_gemfile_entry %>
10
+ <%= javascript_gemfile_entry -%>
11
+
12
+ gem 'bcrypt-ruby', '~> 3.0.0'
13
+ gem 'simple_form'
14
+ gem 'jbuilder'
15
+ gem 'unicorn'
16
+ gem 'blazing'
17
+ gem 'haml'
18
+ gem 'simple_form'
19
+ gem 'mail'
20
+ gem 'fabrication'
21
+
22
+ group :development, :test do
23
+ gem 'pry'
24
+ gem 'rspec-rails'
25
+ end
26
+
27
+ group :test do
28
+ gem 'database_cleaner'
29
+ gem 'cucumber-rails'
30
+ end
31
+
32
+ group :development do
33
+ gem 'guard-rspec'
34
+ gem 'guard-cucumber'
35
+ gem 'rb-fsevent'
36
+ gem 'ruby_gntp'
37
+ end
38
+
@@ -0,0 +1,33 @@
1
+ guard 'rspec', :command_prefix => 'zeus', :bundler => false do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { "spec" }
5
+
6
+ # Rails example
7
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
8
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
9
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
10
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
11
+ watch('config/routes.rb') { "spec/routing" }
12
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
13
+
14
+ # Capybara features specs
15
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
16
+
17
+ # Turnip features and steps
18
+ watch(%r{^spec/acceptance/(.+)\.feature$})
19
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
20
+
21
+ callback(:run_all_end) do
22
+ unless Guard.guards(:rspec).last_failed
23
+ Guard.run_all({ :guard => Guard.guards(:cucumber) })
24
+ end
25
+ end
26
+ end
27
+
28
+
29
+ guard 'cucumber', :command_prefix => 'zeus', :bundler => false do
30
+ watch(%r{^features/.+\.feature$})
31
+ watch(%r{^features/support/.+$}) { 'features' }
32
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
33
+ end
@@ -0,0 +1,34 @@
1
+ # <%= config[:app_name] %>
2
+
3
+ Maintainer: <%= config[:maintainer] %>
4
+ Consultant: <%= config[:consultant] %>
5
+
6
+ ## IMPORTANT REMARKS
7
+
8
+ ## SETUP
9
+
10
+ ## COMPONENTS
11
+
12
+ ## ENVIRONMENTS
13
+
14
+ ### Staging
15
+ The app runs on the <server> server
16
+
17
+ * Home:
18
+ * Web:
19
+ * External:
20
+
21
+ ### Production
22
+ * The app runs on the <server> server
23
+ * Home:
24
+ * Web:
25
+ * External:
26
+
27
+ Deploy this application with blazing.
28
+
29
+ ## PITFALLS
30
+ ### Problems with solutions
31
+ ### Problems without solutions
32
+
33
+ ## HOWTO
34
+
@@ -0,0 +1,7 @@
1
+ class MailInterceptor
2
+ def self.delivering_email(message)
3
+ message.subject = "DIES-IST-EIN-TEST: #{message.to} #{message.subject}"
4
+ message.to = "support@screenconcept.ch"
5
+ end
6
+ end
7
+
@@ -0,0 +1 @@
1
+ Mail.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shoestrap
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Immanuel Häussermann
9
+ - Felipe Kaufmann
10
+ - Phil Schilter
11
+ - Noëlle Rosenberg
12
+ autorequire:
13
+ bindir: bin
14
+ cert_chain: []
15
+ date: 2013-01-14 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: rspec
19
+ requirement: !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ! '>='
23
+ - !ruby/object:Gem::Version
24
+ version: '0'
25
+ type: :development
26
+ prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: pry
35
+ requirement: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ type: :development
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ - !ruby/object:Gem::Dependency
50
+ name: rails
51
+ requirement: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ description: shoestrap is a rails app bootstrapper
66
+ email: info@screenconcept.ch
67
+ executables:
68
+ - shoestrap
69
+ extensions: []
70
+ extra_rdoc_files: []
71
+ files:
72
+ - .gitignore
73
+ - .rspec
74
+ - .rvmrc
75
+ - .travis.yml
76
+ - CHANGELOG.md
77
+ - Gemfile
78
+ - LICENSE
79
+ - README.md
80
+ - Rakefile
81
+ - bin/shoestrap
82
+ - generators/app_generator.rb
83
+ - lib/shoestrap/app_builder.rb
84
+ - shoestrap.gemspec
85
+ - templates/Gemfile.erb
86
+ - templates/Guardfile
87
+ - templates/README.md.erb
88
+ - templates/mail_interceptor.rb
89
+ - templates/setup_mail.rb
90
+ homepage: http://github.com/screenconcept/shoestrap
91
+ licenses: []
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ segments:
103
+ - 0
104
+ hash: -786510774943773429
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ segments:
112
+ - 0
113
+ hash: -786510774943773429
114
+ requirements: []
115
+ rubyforge_project: shoestrap
116
+ rubygems_version: 1.8.24
117
+ signing_key:
118
+ specification_version: 3
119
+ summary: A tool that helps you bootstrap your rails projects
120
+ test_files: []