<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dbshell-rails/lib, branch v0.0.2</title>
<subtitle>A Rake task for Ruby on Rails to painlessly open a database shell</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/'/>
<entry>
<title>Increase version v0.0.1 -&gt; v0.0.2</title>
<updated>2017-05-09T18:50:07+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-09T18:50:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=85c24cc3b0c7b5bca78033b67c4cfc6801b5f545'/>
<id>85c24cc3b0c7b5bca78033b67c4cfc6801b5f545</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>version.rb: Use single quotes</title>
<updated>2017-05-09T18:49:30+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-09T18:49:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=3af76be45efa59b8abf7d8e425b6aee60a27ec3f'/>
<id>3af76be45efa59b8abf7d8e425b6aee60a27ec3f</id>
<content type='text'>
Match the style in the rest of the project.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Match the style in the rest of the project.
</pre>
</div>
</content>
</entry>
<entry>
<title>rails.rb: Check that `Rake` is loaded before loading Rake task</title>
<updated>2017-05-09T18:30:02+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-09T18:30:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=27eaa02d28cc07ceb59a51529100ee4b7016a38f'/>
<id>27eaa02d28cc07ceb59a51529100ee4b7016a38f</id>
<content type='text'>
Was getting an exception when trying to start the development server on
a Rails 5.0.1 app:

    $ bundle exec rails s
    dbshell-rails/lib/dbshell/rails/tasks/dbshell.rake:5:in `&lt;top (required)&gt;': undefined method `desc' for main:Object (NoMethodError)
    	from .../ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `load'
    	from .../ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `block in load'
    	from .../ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
    	from .../ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `load'
    	from dbshell-rails/lib/dbshell/rails.rb:3:in `&lt;top (required)&gt;'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:105:in `require'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:105:in `rescue in block in require'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:82:in `block in require'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:75:in `each'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:75:in `require'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler.rb:107:in `require'
    	from rails-app/config/application.rb:7:in `&lt;top (required)&gt;'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `require'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `&lt;top (required)&gt;'
    	from rails-app/bin/rails:9:in `require'
    	from rails-app/bin/rails:9:in `&lt;top (required)&gt;'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/bin/spring:49:in `&lt;top (required)&gt;'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `&lt;top (required)&gt;'
    	from rails-app/bin/spring:15:in `require'
    	from rails-app/bin/spring:15:in `&lt;top (required)&gt;'
    	from bin/rails:3:in `load'
    	from bin/rails:3:in `&lt;main&gt;'

Looks like Rails is trying to load the task without Rake, and the
interpreter doesn't know what to do with the Rake methods.

Follow the pattern in
https://github.com/paulelliott/fabrication/blob/b470cd817e1973c14e3253cd76606cf934942ca1/lib/fabrication.rb
and guard the load with a check for whether `Rake` is defined.

This makes the server start up and work as expected again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Was getting an exception when trying to start the development server on
a Rails 5.0.1 app:

    $ bundle exec rails s
    dbshell-rails/lib/dbshell/rails/tasks/dbshell.rake:5:in `&lt;top (required)&gt;': undefined method `desc' for main:Object (NoMethodError)
    	from .../ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `load'
    	from .../ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `block in load'
    	from .../ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
    	from .../ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `load'
    	from dbshell-rails/lib/dbshell/rails.rb:3:in `&lt;top (required)&gt;'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:105:in `require'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:105:in `rescue in block in require'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:82:in `block in require'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:75:in `each'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler/runtime.rb:75:in `require'
    	from .../ruby/gems/2.3.0/gems/bundler-1.14.2/lib/bundler.rb:107:in `require'
    	from rails-app/config/application.rb:7:in `&lt;top (required)&gt;'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `require'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
    	from .../ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `&lt;top (required)&gt;'
    	from rails-app/bin/rails:9:in `require'
    	from rails-app/bin/rails:9:in `&lt;top (required)&gt;'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/bin/spring:49:in `&lt;top (required)&gt;'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
    	from .../ruby/gems/2.3.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `&lt;top (required)&gt;'
    	from rails-app/bin/spring:15:in `require'
    	from rails-app/bin/spring:15:in `&lt;top (required)&gt;'
    	from bin/rails:3:in `load'
    	from bin/rails:3:in `&lt;main&gt;'

Looks like Rails is trying to load the task without Rake, and the
interpreter doesn't know what to do with the Rake methods.

Follow the pattern in
https://github.com/paulelliott/fabrication/blob/b470cd817e1973c14e3253cd76606cf934942ca1/lib/fabrication.rb
and guard the load with a check for whether `Rake` is defined.

This makes the server start up and work as expected again.
</pre>
</div>
</content>
</entry>
<entry>
<title>rails.rb: Simplify `load` call to include Rake task</title>
<updated>2017-05-01T02:08:58+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-01T02:08:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=ad3b6c7e69470a2b5bd68c7cafa170332b213b92'/>
<id>ad3b6c7e69470a2b5bd68c7cafa170332b213b92</id>
<content type='text'>
Thanks to the Patterns guide on rubygems.org, I now see that we don't
have to use `__FILE__` at all. Cool!

See:
http://guides.rubygems.org/patterns/#requiring-files-relative-to-each-other
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Thanks to the Patterns guide on rubygems.org, I now see that we don't
have to use `__FILE__` at all. Cool!

See:
http://guides.rubygems.org/patterns/#requiring-files-relative-to-each-other
</pre>
</div>
</content>
</entry>
<entry>
<title>rails.rb: Change to single-quotes</title>
<updated>2017-05-01T02:05:32+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-01T02:05:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=96b181b74aeac226d45a1f4d4a13488931b2b72d'/>
<id>96b181b74aeac226d45a1f4d4a13488931b2b72d</id>
<content type='text'>
Follow this package's convention.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow this package's convention.
</pre>
</div>
</content>
</entry>
<entry>
<title>dbshell.rake: Add a short description to our task</title>
<updated>2017-05-01T00:30:55+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-04-29T21:47:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=5a8c88d3771018978be8f5fb05f44f6d8aba5e7e'/>
<id>5a8c88d3771018978be8f5fb05f44f6d8aba5e7e</id>
<content type='text'>
This has the additional benefit of making it appear in the `rake -T`
output.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This has the additional benefit of making it appear in the `rake -T`
output.
</pre>
</div>
</content>
</entry>
<entry>
<title>dbshell.rake: Add alias to `rake db:shell`</title>
<updated>2017-04-29T21:43:01+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-04-29T21:43:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=96ffac15299beca07a0671cdbed13b137a9aa4c4'/>
<id>96ffac15299beca07a0671cdbed13b137a9aa4c4</id>
<content type='text'>
Provide two ways of accessing the task. One saves a character (":") and
is reminiscent of the Django command that this project is inspired by.
The other is more Rails-like and is consistent with the other
`db:`-prefixed Rails Rake tasks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide two ways of accessing the task. One saves a character (":") and
is reminiscent of the Django command that this project is inspired by.
The other is more Rails-like and is consistent with the other
`db:`-prefixed Rails Rake tasks.
</pre>
</div>
</content>
</entry>
<entry>
<title>DBShell::Client::Postgres: Convert port to string</title>
<updated>2017-04-29T21:32:17+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-04-29T21:32:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=3c522fc313f76dfbb7d1e87703965780245a432c'/>
<id>3c522fc313f76dfbb7d1e87703965780245a432c</id>
<content type='text'>
Turns out the port actually did need to be a string, contrary to what I
had assumed in e89275bc787ae17bc698ac8cdb8cdaf5ebeb7852. I ended up with
this error when passing a specific port in a real test:

    $ bake dbshell
    rake aborted!
    TypeError: no implicit conversion of Fixnum into String
    .../lib/dbshell/client/postgres.rb:8:in `exec'
    .../lib/dbshell/client/postgres.rb:8:in `runshell'
    .../lib/dbshell/client/database.rb:24:in `runshell'
    .../lib/dbshell/rails/tasks/dbshell.rake:6:in `block in &lt;top (required)&gt;'
    .../versions/2.3.3/bin/bundle:22:in `load'
    .../versions/2.3.3/bin/bundle:22:in `&lt;main&gt;'
    Tasks: TOP =&gt; dbshell
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turns out the port actually did need to be a string, contrary to what I
had assumed in e89275bc787ae17bc698ac8cdb8cdaf5ebeb7852. I ended up with
this error when passing a specific port in a real test:

    $ bake dbshell
    rake aborted!
    TypeError: no implicit conversion of Fixnum into String
    .../lib/dbshell/client/postgres.rb:8:in `exec'
    .../lib/dbshell/client/postgres.rb:8:in `runshell'
    .../lib/dbshell/client/database.rb:24:in `runshell'
    .../lib/dbshell/rails/tasks/dbshell.rake:6:in `block in &lt;top (required)&gt;'
    .../versions/2.3.3/bin/bundle:22:in `load'
    .../versions/2.3.3/bin/bundle:22:in `&lt;main&gt;'
    Tasks: TOP =&gt; dbshell
</pre>
</div>
</content>
</entry>
<entry>
<title>DBShell::Client::Database: Add support for the 'postgis' adapter</title>
<updated>2017-04-29T21:26:59+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-04-29T21:26:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=ad34e0127eae4965f4e48c132e06b3dfba474d18'/>
<id>ad34e0127eae4965f4e48c132e06b3dfba474d18</id>
<content type='text'>
PostGIS is, for our purposes, no different from Postgres. Both should
launch `psql`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PostGIS is, for our purposes, no different from Postgres. Both should
launch `psql`.
</pre>
</div>
</content>
</entry>
<entry>
<title>rails.rb: Simplify the Rake task loader call</title>
<updated>2017-04-29T21:15:00+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-04-29T21:15:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dbshell-rails/commit/?id=d976bb250e81c48f95eee50130e17c92a3e20a32'/>
<id>d976bb250e81c48f95eee50130e17c92a3e20a32</id>
<content type='text'>
Since we only have a single *.rake file, we can get away with making
this less general. Doing so condenses what was there previously into a
single line and is arguably more explicit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since we only have a single *.rake file, we can get away with making
this less general. Doing so condenses what was there previously into a
single line and is arguably more explicit.
</pre>
</div>
</content>
</entry>
</feed>
