tirantes 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +8 -0
  4. data/CONTRIBUTING.md +38 -0
  5. data/Gemfile +3 -0
  6. data/Gemfile.lock +140 -0
  7. data/LICENSE +21 -0
  8. data/NEWS.md +125 -0
  9. data/README.md +160 -0
  10. data/Rakefile +8 -0
  11. data/bin/tirantes +16 -0
  12. data/features/github_repo.feature +8 -0
  13. data/features/heroku_true.feature +9 -0
  14. data/features/rake_clean.feature +15 -0
  15. data/features/step_definitions/tirantes_steps.rb +68 -0
  16. data/features/support/bin/heroku +5 -0
  17. data/features/support/bin/hub +5 -0
  18. data/features/support/env.rb +10 -0
  19. data/features/support/fake_github.rb +21 -0
  20. data/features/support/fake_heroku.rb +21 -0
  21. data/lib/tirantes/actions.rb +40 -0
  22. data/lib/tirantes/app_builder.rb +322 -0
  23. data/lib/tirantes/generators/app_generator.rb +203 -0
  24. data/lib/tirantes/version.rb +3 -0
  25. data/templates/Gemfile_clean +50 -0
  26. data/templates/Procfile +2 -0
  27. data/templates/README.md.erb +11 -0
  28. data/templates/_flashes.html.erb +5 -0
  29. data/templates/_javascript.html.erb +10 -0
  30. data/templates/application.css.scss +14 -0
  31. data/templates/background_jobs_minitest.rb +19 -0
  32. data/templates/bin_setup +18 -0
  33. data/templates/config_locales_en.yml +11 -0
  34. data/templates/database_cleaner_minitest.rb +15 -0
  35. data/templates/disable_xml_params.rb +3 -0
  36. data/templates/errors.rb +28 -0
  37. data/templates/exception_notification.rb +8 -0
  38. data/templates/javascripts/prefilled_input.js +59 -0
  39. data/templates/postgresql_database.yml.erb +12 -0
  40. data/templates/puma.rb +13 -0
  41. data/templates/rack_timeout.rb +1 -0
  42. data/templates/sample.env +14 -0
  43. data/templates/secret_token.rb.erb +5 -0
  44. data/templates/simple_form_purecss.rb +13 -0
  45. data/templates/smtp.rb +10 -0
  46. data/templates/test_helper.rb +39 -0
  47. data/templates/tirantes_gitignore +17 -0
  48. data/templates/tirantes_layout.html.erb.erb +15 -0
  49. data/tirantes.gemspec +33 -0
  50. metadata +163 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3e264e3fb75f1f4051e075d3b89ca5d89d4f3025
4
+ data.tar.gz: 89db2786fee16e3b4dd74a7dd2b059c0aaaddd74
5
+ SHA512:
6
+ metadata.gz: 374598afede69313beb063dcde416115372bcf52925e651c1274568026921548c8186e0a047859f8852a27161e5fedefc6e8cef71353e08fbee7fa2796de6d0d
7
+ data.tar.gz: 1e8f914b172ff325af5cfdc42f35fe2e6feae0978191274470b8218e8e2bcdc40bcaaa1feccaf12b2787ca21bcbe9349ea1d9f8ca43b98d69519e1e888f31f71
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ *.gem
2
+ *.swp
3
+ .bundle
4
+ .rake_tasks
5
+ /bin/*
6
+ !bin/suspenders
7
+ pkg
8
+ test_project
9
+ tmp/aruba
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ install:
6
+ - bundle install
7
+ notifications:
8
+ email: false
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,38 @@
1
+ We love pull requests. Here's a quick guide:
2
+
3
+ 1. Fork the repo.
4
+
5
+ 2. Run the tests. We only take pull requests with passing tests, and it's great
6
+ to know that you have a clean slate: `bundle && rake`
7
+
8
+ 3. Add a test for your change. Only refactoring and documentation changes
9
+ require no new tests. If you are adding functionality or fixing a bug, we need
10
+ a test!
11
+
12
+ 4. Make the test pass.
13
+
14
+ 5. Push to your fork and submit a pull request.
15
+
16
+
17
+ At this point you're waiting on us. We like to at least comment on, if not
18
+ accept, pull requests within three business days (and, typically, one business
19
+ day). We may suggest some changes or improvements or alternatives.
20
+
21
+ Some things that will increase the chance that your pull request is accepted,
22
+ taken straight from the Ruby on Rails guide:
23
+
24
+ * Use Rails idioms and helpers
25
+ * Include tests that fail without your code, and pass with it
26
+ * Update the documentation, the surrounding one, examples elsewhere, guides,
27
+ whatever is affected by your contribution
28
+
29
+ Syntax:
30
+
31
+ * Two spaces, no tabs.
32
+ * No trailing whitespace. Blank lines should not have any space.
33
+ * Prefer &&/|| over and/or.
34
+ * my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
35
+ * a = b and not a=b.
36
+ * Follow the conventions you see used in the source already.
37
+
38
+ And in case we didn't emphasize it enough: we love tests!
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,140 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ tirantes (1.0.7)
5
+ bundler (~> 1.7.0)
6
+ rails (~> 4.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (4.2.0)
12
+ actionpack (= 4.2.0)
13
+ actionview (= 4.2.0)
14
+ activejob (= 4.2.0)
15
+ mail (~> 2.5, >= 2.5.4)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ actionpack (4.2.0)
18
+ actionview (= 4.2.0)
19
+ activesupport (= 4.2.0)
20
+ rack (~> 1.6.0)
21
+ rack-test (~> 0.6.2)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
24
+ actionview (4.2.0)
25
+ activesupport (= 4.2.0)
26
+ builder (~> 3.1)
27
+ erubis (~> 2.7.0)
28
+ rails-dom-testing (~> 1.0, >= 1.0.5)
29
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
30
+ activejob (4.2.0)
31
+ activesupport (= 4.2.0)
32
+ globalid (>= 0.3.0)
33
+ activemodel (4.2.0)
34
+ activesupport (= 4.2.0)
35
+ builder (~> 3.1)
36
+ activerecord (4.2.0)
37
+ activemodel (= 4.2.0)
38
+ activesupport (= 4.2.0)
39
+ arel (~> 6.0)
40
+ activesupport (4.2.0)
41
+ i18n (~> 0.7)
42
+ json (~> 1.7, >= 1.7.7)
43
+ minitest (~> 5.1)
44
+ thread_safe (~> 0.3, >= 0.3.4)
45
+ tzinfo (~> 1.1)
46
+ arel (6.0.0)
47
+ aruba (0.5.4)
48
+ childprocess (>= 0.3.6)
49
+ cucumber (>= 1.1.1)
50
+ rspec-expectations (>= 2.7.0)
51
+ builder (3.2.2)
52
+ childprocess (0.5.5)
53
+ ffi (~> 1.0, >= 1.0.11)
54
+ cucumber (1.3.18)
55
+ builder (>= 2.1.2)
56
+ diff-lcs (>= 1.1.3)
57
+ gherkin (~> 2.12)
58
+ multi_json (>= 1.7.5, < 2.0)
59
+ multi_test (>= 0.1.1)
60
+ diff-lcs (1.2.5)
61
+ erubis (2.7.0)
62
+ ffi (1.9.6)
63
+ ffi (1.9.6-x86-mingw32)
64
+ gherkin (2.12.2)
65
+ multi_json (~> 1.3)
66
+ gherkin (2.12.2-x86-mingw32)
67
+ multi_json (~> 1.3)
68
+ globalid (0.3.0)
69
+ activesupport (>= 4.1.0)
70
+ hike (1.2.3)
71
+ i18n (0.7.0)
72
+ json (1.8.1)
73
+ loofah (2.0.1)
74
+ nokogiri (>= 1.5.9)
75
+ mail (2.6.3)
76
+ mime-types (>= 1.16, < 3)
77
+ mime-types (2.4.3)
78
+ mini_portile (0.6.2)
79
+ minitest (5.5.0)
80
+ multi_json (1.10.1)
81
+ multi_test (0.1.1)
82
+ nokogiri (1.6.5)
83
+ mini_portile (~> 0.6.0)
84
+ nokogiri (1.6.5-x86-mingw32)
85
+ mini_portile (~> 0.6.0)
86
+ rack (1.6.0)
87
+ rack-test (0.6.2)
88
+ rack (>= 1.0)
89
+ rails (4.2.0)
90
+ actionmailer (= 4.2.0)
91
+ actionpack (= 4.2.0)
92
+ actionview (= 4.2.0)
93
+ activejob (= 4.2.0)
94
+ activemodel (= 4.2.0)
95
+ activerecord (= 4.2.0)
96
+ activesupport (= 4.2.0)
97
+ bundler (>= 1.3.0, < 2.0)
98
+ railties (= 4.2.0)
99
+ sprockets-rails
100
+ rails-deprecated_sanitizer (1.0.3)
101
+ activesupport (>= 4.2.0.alpha)
102
+ rails-dom-testing (1.0.5)
103
+ activesupport (>= 4.2.0.beta, < 5.0)
104
+ nokogiri (~> 1.6.0)
105
+ rails-deprecated_sanitizer (>= 1.0.1)
106
+ rails-html-sanitizer (1.0.1)
107
+ loofah (~> 2.0)
108
+ railties (4.2.0)
109
+ actionpack (= 4.2.0)
110
+ activesupport (= 4.2.0)
111
+ rake (>= 0.8.7)
112
+ thor (>= 0.18.1, < 2.0)
113
+ rake (10.4.2)
114
+ rspec-expectations (3.1.2)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.1.0)
117
+ rspec-support (3.1.2)
118
+ sprockets (2.12.3)
119
+ hike (~> 1.2)
120
+ multi_json (~> 1.0)
121
+ rack (~> 1.0)
122
+ tilt (~> 1.1, != 1.3.0)
123
+ sprockets-rails (2.2.2)
124
+ actionpack (>= 3.0)
125
+ activesupport (>= 3.0)
126
+ sprockets (>= 2.8, < 4.0)
127
+ thor (0.19.1)
128
+ thread_safe (0.3.4)
129
+ tilt (1.4.1)
130
+ tzinfo (1.2.2)
131
+ thread_safe (~> 0.1)
132
+
133
+ PLATFORMS
134
+ ruby
135
+ x86-mingw32
136
+
137
+ DEPENDENCIES
138
+ aruba (~> 0.5.2)
139
+ cucumber (~> 1.2)
140
+ tirantes!
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2010-2012 Mike Burns and thoughtbot, inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/NEWS.md ADDED
@@ -0,0 +1,125 @@
1
+ 1.5.1 (September 10, 2013)
2
+
3
+ * Remove Turbolinks.
4
+ * Don't use Bundler's binstubs in `bin/setup`.
5
+ * Remove `--drb` now that we aren't using Spork.
6
+ * Set up DNS via Pow for development.
7
+ * Update gem versions.
8
+
9
+ 1.5.0 (August 3, 2013)
10
+
11
+ * Add Neat.
12
+ * Replace Bourne with RSpec Mocks.
13
+ * Replace Sham Rack with WebMock.
14
+ * Remove dependency on `hub` gem.
15
+ * Clean up leftover Rails 3 conventions.
16
+
17
+ 1.4.0 (July 21, 2013)
18
+
19
+ * Support Rails 4.
20
+ * Support Ruby 2.
21
+ * Remove jQuery UI.
22
+ * Factories spec works for non-ActiveRecord objects.
23
+ * Use New Relic RPM gem >= 3.5.7 for Heroku request queue accuracy.
24
+ * Abort RSpec runs on first failure.
25
+ * Replace custom email validator with gem.
26
+
27
+ 1.3.0 (May 13, 2013)
28
+
29
+ * Switch web server from Thin to Unicorn
30
+ * Set up database before setting up RSpec so that the rspec:install task works
31
+ * Add Delayed::Job
32
+ * Clean up cruft from ActionMailer delivery configuration
33
+ * strong_parameters now raises an error in development
34
+ * Enforce Ruby 1.9.2+ in the gemspec
35
+
36
+ 1.2.2 (March 14, 2013)
37
+
38
+ * Fix Syntax error in staging/production environment config files.
39
+ * Make Factory Girl available to development environment for generators and
40
+ `rails console`.
41
+
42
+ 1.2.1 (February 28, 2013)
43
+
44
+ * Use Ruby 1.9.3 and 2.0
45
+ * Update staging and production email delivery
46
+ * Remove Spork and Guard
47
+ * Add better_errors and binding_of_caller gems
48
+ * Fix ActiveRecord attributes' blacklist
49
+ * Add Flutie to Gemfile
50
+
51
+ 1.2.0 (February 13, 2013)
52
+
53
+ * Upgrade Rails from 3.2.8 to 3.2.12 to keep pace with security patches.
54
+ * Improve staging environment on Heroku with staging `ENV` variables and
55
+ overriding the recipient in staging email delivery.
56
+ * Remove Flutie, use Bourbon.
57
+ * Wrap all HTTP requests in a 5 second timeout.
58
+ * Don't use `attr_accessible` whitelists. Instead, configure Strong Parameters.
59
+ * Provide a `bin/setup` script.
60
+ * Force RSpec's `expect` syntax.
61
+ * Remove remaining references to Cucumber, complete RSpec + Capybara conversion.
62
+ * Improve Foreman/`.env`/`Procfile` interactions.
63
+
64
+ 1.1.5 (October 22, 2012)
65
+
66
+ * Ignore `.env`.
67
+ * Link to thoughtbot/guides in generated README.
68
+ * Remove Cucumber in favor of RSpec + Capybara.
69
+ * Deliver emails in staging environment to an overriden email or set of emails.
70
+ * Encode database as UTF8.
71
+ * Bundle with binstubs using 37signals' directory convention.
72
+ * Configure time formats using localization.
73
+ * Add Ruby version to Gemfile.
74
+ * Add fast-failing spec that tests validity of factories.
75
+ * Use SimpleCov for C0 coverage.
76
+ * Configure RSpec with `--profile` flag to find slow-running specs.
77
+
78
+ 1.1.4 (September 4, 2012)
79
+
80
+ * Always store UTC in the DB.
81
+ * Use Rails 3.2.8.
82
+
83
+ 1.1.3 (August 7, 2012)
84
+
85
+ * Fix broken Gemfile additions where capybara stole cucumber's `require: false`
86
+
87
+ 1.1.2 (August 6, 2012)
88
+
89
+ * Fix broken rake.
90
+ * Use Heroku-compliant asset pipeline settings.
91
+
92
+ 1.1.1 (August 3, 2012)
93
+
94
+ * Fix broken newline interpolation
95
+
96
+ 1.1.0 (August 3, 2012)
97
+
98
+ * Add --github option.
99
+ * Add --webkit option.
100
+ * Remove cruft when generating controllers.
101
+ * Add Spork and Guard.
102
+
103
+ 1.0.1 (August 2, 2012)
104
+
105
+ * Fix broken install on Ruby 1.8.
106
+ * Remove db/schema.rb from .gitignore.
107
+ * Remove Factory Girl step definitions.
108
+
109
+ 1.0.0 (June 29, 2012)
110
+
111
+ * Ignore `bin/`, `.rake_tasks`, `.bundle/`, and `.gem/`.
112
+ * Create a root route only with `--clearance`.
113
+ * Do not autocommit after generate.
114
+ * Style static error pages.
115
+ * Cucumber requires everything under `features/`, regardless of pwd.
116
+ * Added gems:
117
+ * `foreman`
118
+ * `therubyracer`
119
+ * Removed gems:
120
+ * `copycopter_client`
121
+ * `heroku`
122
+ * `ruby-debug`
123
+ * `sass`
124
+ * `sprockets-redirect`
125
+ * `email_spec`
data/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # Suspenders [![Build Status](https://secure.travis-ci.org/thoughtbot/suspenders.png?branch=master)](http://travis-ci.org/thoughtbot/suspenders)
2
+
3
+ Suspenders is the base Rails application used at [thoughtbot](http://thoughtbot.com/community).
4
+
5
+ ![Suspenders boy](http://media.tumblr.com/1TEAMALpseh5xzf0Jt6bcwSMo1_400.png)
6
+
7
+ Installation
8
+ ------------
9
+
10
+ First install the suspenders gem:
11
+
12
+ gem install suspenders
13
+
14
+ Then run:
15
+
16
+ suspenders projectname
17
+
18
+ This will create a Rails 4.0 app in `projectname`.
19
+
20
+ By default this script creates a new git repository. See below if you
21
+ want to use it against an existing repo.
22
+
23
+ Gemfile
24
+ -------
25
+
26
+ To see the latest and greatest gems, look at Suspenders'
27
+ [templates/Gemfile_clean](templates/Gemfile_clean),
28
+ which will be appended to the default generated projectname/Gemfile.
29
+
30
+ It includes application gems like:
31
+
32
+ * [Airbrake](https://github.com/airbrake/airbrake) for exception notification
33
+ * [Bourbon](https://github.com/thoughtbot/bourbon) for Sass mixins
34
+ * [Delayed Job](https://github.com/collectiveidea/delayed_job) for background
35
+ processing
36
+ * [Email Validator](https://github.com/balexand/email_validator) for email
37
+ validation
38
+ * [Flutie](https://github.com/thoughtbot/flutie) for `page_title` and
39
+ `body_class` view helpers
40
+ * [High Voltage](https://github.com/thoughtbot/high_voltage) for static pages
41
+ * [jQuery Rails](https://github.com/rails/jquery-rails) for jQuery
42
+ * [Neat](https://github.com/thoughtbot/neat) for semantic grids
43
+ * [Postgres](https://github.com/ged/ruby-pg) for access to the Postgres database
44
+ * [Rack Timeout](https://github.com/kch/rack-timeout) to abort requests that are
45
+ taking too long
46
+ * [Recipient Interceptor](https://github.com/croaky/recipient_interceptor) to
47
+ avoid accidentally sending emails to real people from staging
48
+ * [Simple Form](https://github.com/plataformatec/simple_form) for form markup
49
+ and style
50
+ * [Unicorn](https://github.com/defunkt/unicorn) to serve HTTP requests
51
+
52
+ And gems only for staging and production like:
53
+
54
+ * [New Relic RPM](https://github.com/newrelic/rpm) for monitoring performance
55
+ * [Rails 12 Factor](https://github.com/heroku/rails_12factor) to making running
56
+ Rails 4 apps easier on Heroku
57
+
58
+ And testing gems like:
59
+
60
+ * [Capybara](https://github.com/jnicklas/capybara) and
61
+ [Capybara Webkit](https://github.com/thoughtbot/capybara-webkit) for
62
+ integration testing
63
+ * [Factory Girl](https://github.com/thoughtbot/factory_girl) for test data
64
+ * [RSpec](https://github.com/rspec/rspec) for unit testing
65
+ * [RSpec Mocks](https://github.com/rspec/rspec-mocks) for stubbing and spying
66
+ * [Shoulda Matchers](https://github.com/thoughtbot/shoulda-matchers) for common
67
+ RSpec matchers
68
+ * [Timecop](https://github.com/jtrupiano/timecop-console) for testing time
69
+
70
+ Other goodies
71
+ -------------
72
+
73
+ Suspenders also comes with:
74
+
75
+ * Override recipient emails in staging environment.
76
+ * Rails' flashes set up and in application layout.
77
+ * A few nice time formats set up for localization.
78
+ * [Heroku-recommended
79
+ settings](https://devcenter.heroku.com/articles/rails4-getting-started).
80
+
81
+ Heroku
82
+ ------
83
+
84
+ You can optionally create Heroku staging and production apps:
85
+
86
+ suspenders app --heroku true
87
+
88
+ This has the same effect as running:
89
+
90
+ heroku create app-staging --remote staging
91
+ heroku create app-production --remote production
92
+
93
+ Git
94
+ ---
95
+
96
+ This will initialize a new git repository for your Rails app. You can
97
+ bypass this with the `--skip-git` option:
98
+
99
+ suspenders app --skip-git true
100
+
101
+ Github
102
+ ------
103
+
104
+ You can optionally create a Github repository for the suspended Rails app. It
105
+ requires that you have [Hub](https://github.com/github/hub) on your system:
106
+
107
+ curl http://hub.github.com/standalone -sLo ~/bin/hub && chmod +x ~/bin/hub
108
+ suspenders app --github organization/project
109
+
110
+ This has the same effect as running:
111
+
112
+ hub create organization/project
113
+
114
+ Dependencies
115
+ ------------
116
+
117
+ Suspenders requires Ruby 1.9.2 or greater.
118
+
119
+ Some gems included in Suspenders have native extensions. You should have GCC
120
+ installed on your machine before generating an app with Suspenders.
121
+
122
+ Use [OS X GCC Installer](https://github.com/kennethreitz/osx-gcc-installer/) for
123
+ Snow Leopard (OS X 10.6).
124
+
125
+ Use [Command Line Tools for XCode](https://developer.apple.com/downloads/index.action)
126
+ for Lion (OS X 10.7) or Mountain Lion (OS X 10.8).
127
+
128
+ We use [Capybara Webkit](https://github.com/thoughtbot/capybara-webkit) for
129
+ full-stack Javascript integration testing. It requires QT. Instructions for
130
+ installing QT are
131
+ [here](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit).
132
+
133
+ PostgreSQL needs to be installed and running for the `db:create` rake task.
134
+
135
+ Issues
136
+ ------
137
+
138
+ If you have problems, please create a
139
+ [Github Issue](https://github.com/thoughtbot/suspenders/issues).
140
+
141
+ Contributing
142
+ ------------
143
+
144
+ Please see CONTRIBUTING.md for details.
145
+
146
+ Credits
147
+ -------
148
+
149
+ ![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
150
+
151
+ Suspenders is maintained and funded by
152
+ [thoughtbot, inc](http://thoughtbot.com/community).
153
+
154
+ The names and logos for thoughtbot are trademarks of thoughtbot, inc.
155
+
156
+ License
157
+ -------
158
+
159
+ Suspenders is Copyright © 2008-2013 thoughtbot. It is free software, and may be
160
+ redistributed under the terms specified in the LICENSE file.
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'bundler/setup'
2
+ require 'bundler/gem_tasks'
3
+ require 'cucumber/rake/task'
4
+
5
+ Cucumber::Rake::Task.new
6
+
7
+ desc 'Run the test suite'
8
+ task :default => ['cucumber']
data/bin/tirantes ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(File.join('..', 'lib', 'tirantes', 'generators', 'app_generator'), File.dirname(__FILE__))
4
+ require File.expand_path(File.join('..', 'lib', 'tirantes', 'actions'), File.dirname(__FILE__))
5
+ require File.expand_path(File.join('..', 'lib', 'tirantes', 'app_builder'), File.dirname(__FILE__))
6
+
7
+ if ['create', '--create'].include? ARGV[0]
8
+ ARGV.shift
9
+ puts "[WARNING] the tirantes create argument is deprecated. Just use `tirantes #{ARGV.join}` instead"
10
+ end
11
+
12
+ templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
13
+ Tirantes::AppGenerator.source_root templates_root
14
+ Tirantes::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root
15
+
16
+ Tirantes::AppGenerator.start
@@ -0,0 +1,8 @@
1
+ @disable-bundler
2
+ Feature: Creating a Github repo
3
+
4
+ Scenario: --github=organization/project
5
+ When I create a project called "test_project" with:
6
+ | argument | value |
7
+ | --github | organization/project |
8
+ Then the "organization/project" Github repo should exist
@@ -0,0 +1,9 @@
1
+ @disable-bundler
2
+ Feature: Creating a Heroku app
3
+
4
+ Scenario: --heroku=true
5
+ When I create a project called "test_project" with:
6
+ | argument | value |
7
+ | --heroku | true |
8
+ Then the "test_project-staging" Heroku app should exist
9
+ And the "test_project-production" Heroku app should exist
@@ -0,0 +1,15 @@
1
+ @disable-bundler
2
+ Feature: Rake works in the tirantes project
3
+ Background:
4
+ Given I ensure no databases exist for "test_project"
5
+
6
+ Scenario: Running rake in the tirantes project
7
+ When I create a project called "test_project"
8
+ And I cd to the "test_project" root
9
+ Then I can cleanly rake the project
10
+
11
+ Scenario: Making a spec then running rake
12
+ When I create a project called "test_project"
13
+ And I cd to the "test_project" root
14
+ And I generate "model post title:string"
15
+ Then I can cleanly rake the project
@@ -0,0 +1,68 @@
1
+ require 'aruba/cucumber'
2
+
3
+ When 'I run rake' do
4
+ in_current_dir do
5
+ run_simple 'bundle exec rake'
6
+ end
7
+ end
8
+
9
+ When 'I run the rake task "$task_name"' do |task_name|
10
+ in_current_dir do
11
+ run_simple "bundle exec rake #{task_name}"
12
+ end
13
+ end
14
+
15
+ When 'I generate "$generator_with_args"' do |generator_with_args|
16
+ in_current_dir do
17
+ run_simple "bundle exec rails generate #{generator_with_args}"
18
+ end
19
+ end
20
+
21
+ When 'I ensure no databases exist for "$project_name"' do |project_name|
22
+ run "dropdb #{project_name}_development"
23
+ run "dropdb #{project_name}_test"
24
+ end
25
+
26
+ When 'I create a project called "$project_name"' do |project_name|
27
+ tirantes_bin = File.expand_path(File.join('..', '..', 'bin', 'tirantes'), File.dirname(__FILE__))
28
+ run_simple "#{tirantes_bin} #{project_name}"
29
+ end
30
+
31
+ When %r{I create a project called "([^"]*)" with:} do |project_name, arguments_table|
32
+ tirantes_bin = File.expand_path(File.join('..', '..', 'bin', 'tirantes'), File.dirname(__FILE__))
33
+ arguments = arguments_table.hashes.inject([]) do |accum, argument|
34
+ accum << "#{argument['argument']}=#{argument['value']}"
35
+ end.join
36
+ run_simple "#{tirantes_bin} #{project_name} #{arguments}"
37
+ end
38
+
39
+ When 'I cd to the "$test_project" root' do |dirname|
40
+ cd dirname
41
+ end
42
+
43
+ Then 'I can cleanly rake the project' do
44
+ steps %{
45
+ And I run the rake task "db:create"
46
+ And I run the rake task "db:migrate"
47
+ And I run the rake task "db:test:prepare"
48
+ And I run rake
49
+ }
50
+ end
51
+
52
+ Then %r{"(.*)" should not be installed} do |gem_name|
53
+ in_current_dir do
54
+ system("bundle show #{gem_name} 2>&1 > /dev/null").should be_false
55
+ end
56
+ end
57
+
58
+ Then %r{"(.*)" should not be included in "(.*)"} do |content, file_path|
59
+ check_file_content file_path, content, false
60
+ end
61
+
62
+ Then %r{the "([^"]*)" Heroku app should exist} do |app_name|
63
+ FakeHeroku.should have_created_app(app_name)
64
+ end
65
+
66
+ Then %r{the "([^"]*)" Github repo should exist} do |repo_name|
67
+ FakeGithub.should have_created_repo(repo_name)
68
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(File.join('..', '..', 'support', 'fake_heroku'), File.dirname(__FILE__))
4
+
5
+ FakeHeroku.new(ARGV).run!
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(File.join('..', '..', 'support', 'fake_github'), File.dirname(__FILE__))
4
+
5
+ FakeGithub.new(ARGV).run!
@@ -0,0 +1,10 @@
1
+ Before do
2
+ ENV['TESTING'] = 'true'
3
+ @aruba_timeout_seconds = 560
4
+ end
5
+
6
+ After do
7
+ FakeHeroku.clear!
8
+ FakeGithub.clear!
9
+ FileUtils.rm_rf 'test_project'
10
+ end