I'm pretty excited. I received my first ever bug report on the couch_docs issue tracker. Obviously, I would prefer that my gem just work, but hey, bugs happen. Mostly I'm excited that someone else is trying it out and I definitely want to help out if I can.
First up, I need to stash my code generators work-in-progress:
cstrom@whitefall:~/repos/couch_docs$ git stRather than
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: bin/couch-docs
# modified: lib/couch_docs/command_line.rb
# modified: spec/couch_docs_spec.rb
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# lib/couch_docs/generator.rb
# spec/command_line_spec.rb
# spec/generator_spec.rb
no changes added to commit (use "git add" and/or "git commit -a")
git stash
stashing the work-in-progress, I will branch for 1.2. I am reasonably optimistic that I am on the right path. So:cstrom@whitefall:~/repos/couch_docs$ git checkout -b 1.2With things checked into the 1.2 branch, I switch back to the master for fixing the issue:
M bin/couch-docs
M lib/couch_docs/command_line.rb
M spec/couch_docs_spec.rb
Switched to a new branch '1.2'
cstrom@whitefall:~/repos/couch_docs$ git st
# On branch 1.2
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: bin/couch-docs
# modified: lib/couch_docs/command_line.rb
# modified: spec/couch_docs_spec.rb
#
# Untracked files:
# (use "git add..." to include in what will be committed)
#
# lib/couch_docs/generator.rb
# spec/command_line_spec.rb
# spec/generator_spec.rb
no changes added to commit (use "git add" and/or "git commit -a")
cstrom@whitefall:~/repos/couch_docs$ git add lib/couch_docs/generator.rb spec/command_line_spec.rb spec/generator_spec.rb
cstrom@whitefall:~/repos/couch_docs$ git commit -m "Initial generator support" -a
[1.2 f80a85e] Initial generator support
6 files changed, 222 insertions(+), 109 deletions(-)
create mode 100644 lib/couch_docs/generator.rb
create mode 100644 spec/command_line_spec.rb
create mode 100644 spec/generator_spec.rb
cstrom@whitefall:~/repos/couch_docs$ git checkout masterThanks to a comment from Johannes Jörg Schmidt, it seems likely that the culprit is the version of RestClient that I coded against:
Switched to branch 'master'
cstrom@whitefall:~/repos/couch_docs$ gem list | grep rest-clientYup, that seems to be it—Glenn Rempe was using RestClient 1.4 while I coded against 1.1. To address, I bump up the version number on the gem and restrict the version number of the RestClient dependency:
rest-client (1.1.0)
#...The
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rest-client>, ["~> 1.1.0"])
#...
~>
in RubyGems specifies that I want greater than version 1.1.0, but not so much greater that a new minor version is reached (i.e. 1.1.10 is OK, but 1.2.0 is not).With that I commit my changes:
cstrom@whitefall:~/repos/couch_docs$ git ci -m "Require rest-client version 1.1. closes #1" -aI also update History.txt and the README file. Then I can update my gemspec:
[master fa542e0] Require rest-client version 1.1. closes #1
3 files changed, 5 insertions(+), 5 deletions(-)
cstrom@whitefall:~/repos/couch_docs$ rake gem:specBuild my gem:
(in /home/cstrom/repos/couch_docs)
cstrom@whitefall:~/repos/couch_docs$ gem build couch_docs.gemspecAnd then I push to rubygems.org:
Successfully built RubyGem
Name: couch_docs
Version: 1.1.1
File: couch_docs-1.1.1.gem
cstrom@whitefall:~/repos/couch_docs$ gem push couch_docs-1.1.1.gemEasy enough!
Pushing gem to Gemcutter...
Successfully registered gem: couch_docs (1.1.1)
After pushing my changes to github, I test out the fix by uninstalling all of my couch_docs gems, and my RestClient 1.1 gem:
cstrom@whitefall:~/repos/couch_docs$ gem uninstall couch_docsA fresh install of couch_docs now installs version 1.1.1 of couch_docs, along with the older, locked version of RestClient:
Select gem to uninstall:
1. couch_docs-1.1.0
2. couch_docs-1.1.1
3. All versions
> 3
#...
cstrom@whitefall:~/repos/couch_docs$ gem uninstall rest-client
Select gem to uninstall:
1. rest-client-1.1.0
2. rest-client-1.4.2
3. All versions
> 1
#...
cstrom@whitefall:~/repos/couch_docs$ gem install couch_docsAnd, just to be absolutely sure, I am still able to dump design documents from my development database with the freshly installed couch-docs script:
WARNING: Installing to ~/.gem since /var/lib/gems/1.8 and
/var/lib/gems/1.8/bin aren't both writable.
Successfully installed rest-client-1.1.0
Successfully installed couch_docs-1.1.1
2 gems installed
cstrom@whitefall:~/tmp/dump$ couch-docs dump -d http://localhost:5984/eeeHopefully that really does resolve the issue. Time will tell!
cstrom@whitefall:~/tmp/dump$ find _design/
_design/
_design/relax
_design/relax/lib
_design/relax/lib/super_textile.js
_design/relax/shows
_design/relax/shows/ingredients.js
_design/relax/shows/upload.js
_design/relax/shows/recipe.js
_design/relax/shows/test.js
...
Day #43
No comments:
Post a Comment