geordi 0.18.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +13 -5
  2. data/.ruby-version +1 -0
  3. data/README.md +199 -110
  4. data/Rakefile +40 -0
  5. data/bin/apache-site +1 -19
  6. data/bin/cap-all +1 -27
  7. data/bin/cleanup-directory +1 -11
  8. data/bin/console-for +1 -12
  9. data/bin/cuc +1 -2
  10. data/bin/cuc-show +1 -2
  11. data/bin/cuc-vnc-setup +1 -114
  12. data/bin/deploy-to-production +1 -91
  13. data/bin/dump-for +4 -32
  14. data/bin/dumple +2 -4
  15. data/bin/geordi +10 -0
  16. data/bin/gitpt +1 -2
  17. data/bin/launchy_browser +9 -3
  18. data/bin/load-dump +1 -4
  19. data/bin/migrate-all +1 -13
  20. data/bin/optimize-png +1 -118
  21. data/bin/power-rake +1 -7
  22. data/bin/remove-executable-flags +1 -6
  23. data/bin/rs +1 -26
  24. data/bin/run_tests +1 -2
  25. data/bin/setup-firefox-for-selenium +1 -3
  26. data/bin/shell-for +1 -8
  27. data/bin/tests +1 -5
  28. data/geordi.gemspec +19 -0
  29. data/lib/geordi/COMMAND_TEMPLATE +29 -0
  30. data/lib/geordi/capistrano.rb +9 -7
  31. data/lib/geordi/capistrano_config.rb +66 -0
  32. data/lib/geordi/cli.rb +28 -0
  33. data/lib/geordi/commands/all_targets.rb +26 -0
  34. data/lib/geordi/commands/apache_site.rb +22 -0
  35. data/lib/geordi/commands/bundle_install.rb +7 -0
  36. data/lib/geordi/commands/cleanup_directory.rb +16 -0
  37. data/lib/geordi/commands/commit.rb +171 -0
  38. data/lib/geordi/commands/console.rb +24 -0
  39. data/lib/geordi/commands/create_database_yml.rb +18 -0
  40. data/lib/geordi/commands/create_databases.rb +16 -0
  41. data/lib/geordi/commands/cucumber.rb +20 -0
  42. data/lib/geordi/commands/deploy.rb +65 -0
  43. data/lib/geordi/commands/devserver.rb +14 -0
  44. data/lib/geordi/commands/dump.rb +63 -0
  45. data/lib/geordi/commands/migrate.rb +26 -0
  46. data/lib/geordi/commands/png_optimize.rb +92 -0
  47. data/lib/geordi/commands/rake.rb +21 -0
  48. data/lib/geordi/commands/remove_executable_flags.rb +14 -0
  49. data/lib/geordi/commands/rspec.rb +40 -0
  50. data/lib/geordi/commands/security_update.rb +56 -0
  51. data/lib/geordi/commands/setup.rb +33 -0
  52. data/lib/geordi/commands/setup_firefox_for_selenium.rb +6 -0
  53. data/lib/geordi/commands/setup_vnc.rb +84 -0
  54. data/lib/geordi/commands/shell.rb +20 -0
  55. data/lib/geordi/commands/test.rb +9 -0
  56. data/lib/geordi/commands/unit.rb +11 -0
  57. data/lib/geordi/commands/update.rb +33 -0
  58. data/lib/geordi/commands/version.rb +7 -0
  59. data/lib/geordi/commands/vnc_show.rb +6 -0
  60. data/lib/geordi/commands/with_firefox_for_selenium.rb +18 -0
  61. data/lib/geordi/commands/with_rake.rb +11 -0
  62. data/lib/geordi/{cuc.rb → cucumber.rb} +28 -39
  63. data/lib/geordi/dump_loader.rb +44 -70
  64. data/lib/geordi/firefox_for_selenium.rb +93 -74
  65. data/lib/geordi/interaction.rb +47 -0
  66. data/lib/geordi/remote.rb +66 -0
  67. data/lib/geordi/util.rb +60 -0
  68. data/lib/geordi/version.rb +1 -1
  69. data/lib/geordi.rb +1 -0
  70. metadata +50 -16
  71. data/bin/install-gems-remotely +0 -18
  72. data/bin/install-gems-remotely.sh +0 -16
  73. data/bin/power-deploy +0 -18
  74. data/bin/remotify-local-branch +0 -12
  75. data/lib/geordi/gitpt.rb +0 -175
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9f8f98de512879778e9f1213a42f74c2d787f461
4
- data.tar.gz: 0ab1a7b574cafc9c3a18d127593c72bcf1859256
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzZlZDljN2VhOThlZWI0OGJlNTYxZTE0MzU5MDQ3NmI2OGE0YjQ1ZQ==
5
+ data.tar.gz: !binary |-
6
+ NWIwNTMxMjQxOGM2MTVmY2U2YTRjNjE2NGQwOWJlNDI1MDNlMzY1Nw==
5
7
  SHA512:
6
- metadata.gz: 9f3cf82b03f852d818dacec59355734952d6cf17f397987229a4472d88e6b81168ea2d9f307916ccdb78962923de470d5ddb08025883e31f1dea75a86c882b0b
7
- data.tar.gz: 271ba533e5c71e28bcca8de85304ad16b1f9c13b96cc441c45a0ac7a0c04146420db4b39cb156cc625fccdaa547a83c9ced1aeb1e55096aa7f113e33d3644711
8
+ metadata.gz: !binary |-
9
+ MWQ4YjRiY2Q5MzY5NDE3NjNhYTA0OGI1YWM4M2I0NDhkZGMyNDI0MjVkZDhk
10
+ ZmU4NTRiZjU4NzI1MDA4ZDBiYTgyMmU5ZDZlZDBlY2NlMGE3ZWYyZDE1NTA3
11
+ OWRhNGY4ZjFhMjI4NWNlMjAwYWVlZjNmMzIyZDVlZjAyOGY4NmI=
12
+ data.tar.gz: !binary |-
13
+ YjI4OTA2YmY4NmM5MDFlZDQ2ZjYwZjIzMDk4ZDY5NzkyZTliYTg5ODliMzNk
14
+ YmVhMDc5ODczY2NjZWViNjc2OGZjZTU2NTg4N2ZkYzJlMWZiMDQxMTk1OWFj
15
+ M2ViZGZkNWZiZjcwOTA3ZDAxYWRlY2E0YmE1ZjA3ODUyMjJiOTk=
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.3
data/README.md CHANGED
@@ -1,220 +1,309 @@
1
1
  Geordi
2
2
  ======
3
3
 
4
- Geordi is a collection of command line tools we use in our daily work with Ruby, Rails and Linux at [makandra](http://makandra.com/).
4
+ Geordi is a collection of command line tools we use in our daily work with
5
+ Ruby, Rails and Linux at [makandra](http://makandra.com/).
5
6
 
6
- Installing the *geordi* gem will link all included tools into your `/usr/bin`:
7
+ Installing the `geordi` gem will install some binaries (see below):
7
8
 
8
- sudo gem install geordi
9
+ gem install geordi
9
10
 
10
- Below you can find a list of all included tools.
11
11
 
12
+ geordi
13
+ ------
12
14
 
13
- apache-site
14
- -----------
15
+ The base command line utility offering most of the commands.
15
16
 
16
- Enables the given virtual host in `/etc/apache2/sites-available` and disables all other vhosts:
17
+ You may abbreviate commands by typing only the first letter(s), e.g. `geordi
18
+ dev` will boot a development server, `geordi s -t` will setup a project and run
19
+ tests afterwards. Underscores and dashes are equivalent.
17
20
 
18
- site makandra-com
21
+ For details on commands, e.g. supported options, run `geordi help <command>`.
19
22
 
20
- More information at http://makandracards.com/makandra/807-shell-script-to-quickly-switch-apache-sites
23
+ ### geordi all-targets COMMAND
21
24
 
25
+ Run a capistrano command on all deploy targets.
22
26
 
23
- b
24
- -
27
+ Example: `geordi all-targets deploy`
25
28
 
26
- Runs the given command under `bundle exec` if a `Gemfile` is present in your working directory. If no `Gemfile` is present just runs the given command:
27
29
 
28
- b spec spec/models
30
+ ### geordi apache-site VIRTUAL_HOST
29
31
 
30
- More information at http://makandracards.com/makandra/684-automatically-run-bundle-exec-if-required
32
+ Enable the given virtual host, disabling all others.
31
33
 
32
34
 
33
- console-for
34
- -----------
35
+ ### geordi cleanup-directory
35
36
 
36
- Opens a rails console remotely:
37
+ Remove unneeded files.
37
38
 
38
- console-for staging
39
39
 
40
- More information at http://makandracards.com/makandra/1338-console-for-opens-a-rails-console-remotely-on-a-capistrano-deployment-target
40
+ ### geordi commit
41
41
 
42
+ Commit using a story title from Pivotal Tracker.
42
43
 
43
44
 
44
- cuc
45
- -----
45
+ ### geordi console [TARGET]
46
46
 
47
- Runs Cucumber with the arguments you want: bundle exec, cucumber_spinner detection, separate Firefox for Selenium, etc.:
47
+ Open a Rails console locally or on a Capistrano deploy target.
48
48
 
49
- cuc features/users.feature
49
+ Open a local Rails console: `geordi console`
50
50
 
51
- More information at http://makandracards.com/makandra/1277-a-nicer-way-to-run-rspec-and-or-cucumber
51
+ Open a Rails console on `staging`: `geordi console staging`
52
52
 
53
53
 
54
+ ### geordi cucumber [FILES]
54
55
 
55
- cleanup-directory
56
- -----------------
56
+ Run Cucumber features.
57
57
 
58
- Removes unnecessary files from your project directory:
58
+ Example: `geordi cucumber features/authentication_feature:3`
59
59
 
60
- cleanup-directory
60
+ Runs Cucumber as you want: with `bundle exec`, `cucumber_spinner` detection,
61
+ separate Firefox for Selenium, etc.
61
62
 
62
- More information at http://makandracards.com/makandra/951-shell-script-to-clean-up-a-project-directory
63
63
 
64
+ ### geordi deploy
64
65
 
65
- deploy-to-production
66
- -------------------
66
+ Guided deployment.
67
67
 
68
- Shows the commits between your `master` and `production` branch, then merges the changes and deploys to the production Capistrano stage:
69
68
 
70
- deploy-to-production
69
+ ### geordi devserver
71
70
 
72
- More information at https://makandracards.com/makandra/7971-shell-script-to-deploy-changes-to-production-and-not-shoot-yourself-in-the-foot
71
+ Start a development server.
73
72
 
74
73
 
75
- dump-for
76
- --------
74
+ ### geordi dump [TARGET]
77
75
 
78
- Dumps the database on your server for a given [Capistrano multistage](https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension) deployment target. Passing the -s option automatically sources the dump ito your development database.
76
+ Handle dumps.
79
77
 
80
- dump-for production [-s]
78
+ When called without arguments, dumps the development database with `dumple`.
81
79
 
82
- More information at http://makandracards.com/makandra/1237-script-to-create-and-copy-a-production-dump-to-your-project-root
80
+ geordi dump
83
81
 
84
-
82
+ When called with the `--load` option, sources the specified dump into the
83
+ development database.
85
84
 
86
- dumple
87
- ------
85
+ geordi dump -l tmp/staging.dump
88
86
 
89
- Stores a timestamped database dump for the given Rails environment in `~/dumps`:
87
+ When called with a capistrano deploy target (e.g. `staging`), remotely dumps
88
+ the specified target's database and downloads it to `tmp/`.
90
89
 
91
- dumple development
90
+ geordi dump staging
92
91
 
93
- More information at http://makandracards.com/makandra/1008-dump-your-database-with-dumple
92
+ When called with a capistrano deploy target and the `--load` option, sources the
93
+ dump into the development database after downloading it.
94
+
95
+ geordi dump staging -l
96
+
97
+
98
+ ### geordi help [COMMAND]
99
+
100
+ Describe available commands or one specific command.
101
+
102
+
103
+ ### geordi migrate
104
+
105
+ Migrate all databases.
106
+
107
+ Example: `geordi migrate`
108
+
109
+ If you are using `parallel_tests`, this runs migrations in your development
110
+ environment and `rake parallel:prepare` afterwards. Otherwise, invokes `geordi rake`
111
+ with `db:migrate`.
112
+
113
+
114
+ ### geordi png-optimize
115
+
116
+ Optimize .png files.
117
+
118
+ - Removes color profiles: cHRM, sRGB, gAMA, ICC, etc.
119
+ - Eliminates unused colors and reduces bit-depth (if possible)
120
+ - May reduce PNG file size lossless
121
+
122
+ Batch-optimize all `*.png` files in a directory:
123
+
124
+ geordi png-optimize directory
125
+
126
+ Batch-optimize the current directory:
127
+
128
+ geordi png-optimize .
129
+
130
+ Optimize a single file:
131
+
132
+ geordi png-optimize input.png
133
+
134
+
135
+ ### geordi rake TASK
136
+
137
+ Run a rake task in several Rails environments.
138
+
139
+ Example: `geordi rake db:migrate`
94
140
 
141
+ TASK is run in the following Rails environments (if present):
95
142
 
96
- load-dump
97
- ---------
143
+ - development
144
+ - test
145
+ - cucumber
98
146
 
99
- Loads a database dump (e.g. created with dump-for or dumple) into you database.
100
147
 
101
- load-dump [path/to/dump]
148
+ ### geordi remove-executable-flags
102
149
 
103
- More information at https://makandracards.com/makandra/8975-geordi-use-load-dump-script-to-source-a-database-dump-into-your-database
150
+ Remove executable-flags from files that should not be executable.
104
151
 
105
152
 
153
+ ### geordi rspec [FILES]
106
154
 
107
- gitpt
108
- -----
155
+ Run RSpec.
109
156
 
110
- Shell script to generate a git commit with Pivotal Tracker story ID and title. Run it from your project directory:
157
+ Example: `geordi rspec spec/models/user_spec.rb:13`
111
158
 
112
- gitpt
159
+ Runs RSpec as you want: with RSpec 1/2 detection, `bundle exec`, rspec_spinner
160
+ detection, etc.
113
161
 
114
- This lets you choose from all started, finished and rejected stories in Pivotal Tracker and commit staged changes.
115
- Requires the project's Pivotal Tracker ID(s) to be defined in a `.pt_project_id` file in the project's directory.
116
162
 
117
- More information at https://makandracards.com/makandra/1372-shell-script-to-generate-a-git-commit-with-pivotal-tracker-story-id-and-title
163
+ ### geordi security-update [step]
118
164
 
165
+ Support for performing security updates.
119
166
 
120
- install-gems-remotely
121
- ---------------------
167
+ Preparation for security update: `geordi security-update`
122
168
 
123
- Installs all gems in your `Gemfile.lock`, as well as vendored gems, to the given host:
169
+ After performing the update: `geordi security-update finish`
124
170
 
125
- install-gems-remotely my.server.com
171
+ Switches branches, pulls, pushes and deploys as required by our workflow. Tells
172
+ what it will do before it does it.
126
173
 
127
- More information at http://makandracards.com/makandra/692-install-a-local-gemfile-on-a-remote-server
128
174
 
175
+ ### geordi setup
129
176
 
130
- migrate-all
131
- ---------------------
177
+ Setup a project for the first time.
132
178
 
133
- Runs `power-rake db:migrate` if parallel_tests does not exist in your `Gemfile`. Otherwise it runs the migration
134
- in your development environment and executes `b rake parallel:prepare` after that.
179
+ Example: `geordi setup`
135
180
 
136
- migrate-all
181
+ Check out a repository, cd into its directory. Now let `setup` do the tiring
182
+ work: run `bundle install`, create `database.yml`, create databases, migrate
183
+ (all if applicable).
137
184
 
185
+ After setting up, loads a dump into the development db when called with the
186
+ `--dump` option:
138
187
 
139
- power-deploy
140
- ------------
188
+ geordi setup -d staging
141
189
 
142
- Calls the Capistrano tasks `deploy`, `deploy:migrate` and `deploy:restart` on the given [Capistrano multistage](https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension) deployment target:
190
+ After setting up, runs all tests when called with the `--test` option:
143
191
 
144
- power-deploy staging
192
+ geordi setup -t
145
193
 
146
- This script is considered legacy and will be removed eventually. You should [fix your deploy scripts](http://makandracards.com/makandra/1176-which-capistrano-hooks-to-use-for-events-to-happen-on-both-cap-deploy-and-cap-deploy-migrations) and then use [cap deploy:migrations](http://makandracards.com/makandra/1000-deploy-and-migrate-with-a-single-capistrano-command).
194
+ See `geordi help setup` for details.
147
195
 
148
196
 
149
- power-rake
150
- ----------
197
+ ### geordi setup-firefox-for-selenium VERSION
151
198
 
152
- Runs the given rake task in each Rails environment in `development`, `test`, `cucumber`, `performance`, if existing:
199
+ Install a special firefox for running Selenium tests.
153
200
 
154
- power-rake db:migrate
155
201
 
156
- More information at http://makandracards.com/makandra/737-run-a-rake-task-in-all-environments
202
+ ### geordi setup-vnc
157
203
 
204
+ Setup VNC for running Selenium tests there.
158
205
 
159
- remove-executable-flags
160
- -----------------------
161
206
 
162
- Recursively removes executable flags from files in the working directory that probably shouldn't have them (like Ruby, HTML, CSS, image, Rake and similar files).
207
+ ### geordi shell TARGET
163
208
 
164
- remove-executable-flags
165
-
166
- More information at http://makandracards.com/makandra/659-recursively-remove-unnecessary-execute-flags
209
+ Open a shell on a Capistrano deploy target.
167
210
 
211
+ Example: `geordi shell production`
168
212
 
169
- rs
170
- -----
213
+ Lets you select the server to connect to when called with `--select-server`:
171
214
 
172
- Runs RSpec with the arguments you want: RSpec 1/2 detection, bundle exec, rspec_spinner detection, etc.:
215
+ geordi shell production -s
173
216
 
174
- rs spec/models/user_spec.rb
175
217
 
176
- More information at http://makandracards.com/makandra/1277-a-nicer-way-to-run-rspec-and-or-cucumber
218
+ ### geordi tests
177
219
 
220
+ Run all employed tests.
178
221
 
179
- setup-firefox-for-selenium
180
- --------------------------
181
222
 
182
- Helps you create an frozen version of Firefox, so your Selenium tests will no longer break whenever Firefox updates:
223
+ ### geordi unit
183
224
 
184
- setup-firefox-for-selenium
225
+ Run Test::Unit.
185
226
 
186
- More information at http://makandracards.com/makandra/1575-how-to-install-a-frozen-version-of-firefox-for-your-selenium-tests
187
227
 
228
+ ### geordi update
188
229
 
189
- shell-for
190
- ---------
230
+ Bring a project up to date.
191
231
 
192
- Opens an SSH shell on the given [Capistrano multistage](https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension) deployment target:
232
+ Example: `geordi update`
193
233
 
194
- shell-for production
234
+ Performs: `git pull`, `bundle install` (if necessary) and migrates (if applicable).
195
235
 
196
- Now it can also be called with any command to be remotely executed before loading the bash. `--no-bash` skips the bash.
236
+ After updating, loads a dump into the development db when called with the
237
+ `--dump` option:
197
238
 
198
- shell-for staging --no-bash top
239
+ geordi update -d staging
199
240
 
200
- More information at http://makandracards.com/makandra/1209-script-to-open-an-ssh-shell-to-a-capistrano-deployment-target
241
+ After updating, runs all tests when called with the `--test` option:
201
242
 
243
+ geordi update -t
202
244
 
203
- tests
204
- --------------
245
+ See `geordi help update` for details.
205
246
 
206
- Runs both `rs` and `cuc`. Call from any project directory:
207
247
 
208
- tests
248
+ ### geordi version
249
+
250
+ Print the current version of geordi.
251
+
252
+
253
+ ### geordi vnc-show
254
+
255
+ Show the hidden VNC window.
256
+
257
+
258
+ ### geordi with-firefox-for-selenium COMMAND
259
+
260
+ Run a command with firefox for selenium set up.
261
+
262
+ Example: `geordi with-firefox-for-selenium b cucumber`
263
+
264
+ Useful when you need Firefox for Selenium, but can't use the `geordi cucumber`
265
+ command.
266
+
267
+
268
+ ### geordi with-rake
269
+
270
+ Run tests with `rake`.
271
+
272
+
273
+ b
274
+ ---
275
+
276
+ Runs the given command under `bundle exec` if a `Gemfile` is present in your
277
+ working directory. If no `Gemfile` is present just runs the given command:
278
+
279
+ b spec spec/models
280
+
281
+ More information at http://makandracards.com/makandra/684-automatically-run-bundle-exec-if-required
282
+
283
+
284
+ dumple
285
+ ------
286
+
287
+ Stores a timestamped database dump for the given Rails environment in `~/dumps`:
288
+
289
+ dumple development
290
+
291
+ More information at http://makandracards.com/makandra/1008-dump-your-database-with-dumple
292
+
209
293
 
210
- More information at http://makandracards.com/makandra/1277-a-nicer-way-to-run-rspec-and-or-cucumber
294
+ launchy_browser
295
+ ---------------
211
296
 
297
+ Used by the `geordi cucumber` command. Makes launchy open pages in the user's
298
+ browser, as opposed to opening it within the VNC window.
212
299
 
213
- run_tests
214
- ---------
215
300
 
216
- Enables VNC and setups firefox just like "cuc", but simply runs the given command.
301
+ Contributing
302
+ ============
217
303
 
218
- Useful if your project does not use "cucumber", so you can for example say
304
+ Copy `lib/geordi/COMMAND_TEMPLATE` to `lib/geordi/commands/your_command` and
305
+ edit it to do what you need it to do. Usually, it is hard to automatedly test
306
+ Geordi commands, so make sure you've manually tested it.
219
307
 
220
- run_tests rake test:integration
308
+ Don't forget to update this README. The whole `geordi` section is auto-generated
309
+ by `rake update_readme`.
data/Rakefile CHANGED
@@ -1,2 +1,42 @@
1
1
  require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
+
4
+ task :update_readme do
5
+ require File.expand_path('../lib/geordi/cli', __FILE__)
6
+
7
+ readme = File.read('README.md')
8
+ geordi_section_regex = /
9
+ geordi\n
10
+ -{3,} # 3 dashes or more
11
+ .*? # anything, non-greedy
12
+ (?= # stop before:
13
+ ^\w+\n-{3,} # the next section
14
+ )
15
+ /xm
16
+
17
+ geordi_section = <<-TEXT
18
+ geordi
19
+ ------
20
+
21
+ The base command line utility offering most of the commands.
22
+
23
+ You may abbreviate commands by typing only the first letter(s), e.g. `geordi
24
+ dev` will boot a development server, `geordi s -t` will setup a project and run
25
+ tests afterwards. Underscores and dashes are equivalent.
26
+
27
+ For details on commands, e.g. supported options, run `geordi help <command>`.
28
+
29
+ TEXT
30
+
31
+ Geordi::CLI.all_commands.sort.each do |_, command|
32
+ unless command.hidden?
33
+ geordi_section << "### geordi #{ command.usage }\n\n"
34
+ geordi_section << "#{ command.description.sub /(\.)?$/, '.' }\n\n"
35
+ geordi_section << "#{ command.long_description.strip }\n\n" if command.long_description
36
+ geordi_section << "\n"
37
+ end
38
+ end
39
+
40
+ updated_readme = readme.sub(geordi_section_regex, geordi_section)
41
+ File.open('README.md', 'w') { |f| f.puts updated_readme.strip }
42
+ end
data/bin/apache-site CHANGED
@@ -1,21 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- site = ARGV[0]
4
- old_cwd = Dir.pwd
5
- Dir.chdir "/etc/apache2/sites-available/"
6
-
7
- # show available sites if no site was passed as argument
8
- unless site
9
- puts 'ERROR: Argument site is missing.'
10
- puts 'Please call: apache-site my-site'
11
- puts
12
- puts 'Available sites:'
13
- Dir.new(".").each do |file|
14
- puts "- #{file}" if file != '.' && file != '..'
15
- end
16
- exit
17
- end
18
-
19
- has_default = File.exists?("default")
20
- exec "sudo a2dissite \*; sudo a2ensite #{"default " if has_default}#{site} && sudo apache2ctl restart"
21
- Dir.chdir old_cwd
3
+ exec 'geordi', 'apache_site', *ARGV
data/bin/cap-all CHANGED
@@ -1,29 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'fileutils'
4
-
5
-
6
- targets = Dir["config/deploy/*.rb"].map { |f| File.basename(f, ".rb") }
7
-
8
- if targets.empty?
9
- targets = [nil]
10
- end
11
-
12
- targets.each do |stage|
13
-
14
- puts "Deploying to #{stage ? stage : 'default target'}"
15
- puts "*" * 80
16
-
17
- if stage
18
- exit_code = system("bundle", "exec", "cap", stage, *ARGV)
19
- else
20
- exit_code = system("bundle", "exec", "cap", *ARGV)
21
- end
22
- unless exit_code
23
- puts "*" * 80
24
- puts "Capistrano failed. Have a look!"
25
- exit(1)
26
- end
27
-
28
- puts
29
- end
3
+ exec 'geordi', 'all_targets', *ARGV
@@ -1,13 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- puts 'Removing:'
4
- for pattern in %w[ webrat-* capybara-* tmp/webrat-* tmp/capybara-* tmp/rtex/* log/*.log ]
5
- puts "- #{pattern}"
6
- puts `rm -vfR #{pattern}`
7
- end
8
-
9
- puts 'Finding recursively and removing:'
10
- for pattern in %w[ *~ ]
11
- puts "- #{pattern}"
12
- `find . -name #{pattern} -exec rm {} ';'`
13
- end
3
+ exec 'geordi', 'cleanup-directory'
data/bin/console-for CHANGED
@@ -1,14 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + "/../lib/geordi/capistrano"
3
- include Geordi::Capistrano
4
2
 
5
- catching_errors do
6
- self.stage = ARGV.shift
7
- options = { :select_server => true }
8
-
9
- if File.exists? "#{config.root}/script/console" # => Rails 2
10
- shell_for("script/console #{config.env}", options)
11
- else
12
- shell_for("bundle exec rails console #{config.env}", options)
13
- end
14
- end
3
+ exec 'geordi', 'console', *ARGV
data/bin/cuc CHANGED
@@ -1,4 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
- require File.join(File.dirname(__FILE__), '../lib/geordi/cuc')
3
2
 
4
- Geordi::Cucumber.new.run
3
+ exec 'geordi', 'cucumber', *ARGV
data/bin/cuc-show CHANGED
@@ -1,4 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
- require File.join(File.dirname(__FILE__), '../lib/geordi/cuc')
3
2
 
4
- Geordi::Cucumber.new.launch_vnc_viewer
3
+ exec 'geordi', 'vnc-show'