Git Product home page Git Product logo

bcdatabase's People

Contributors

jdzak avatar rsutphin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bcdatabase's Issues

Error when calling "bcdatabase help"

Hi I get the following error:

bcdatabase help Unknown command help. /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.3/lib/bcdatabase/commands.rb:236:in `command_name': undefined method`underscore' for "Help":String (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.3/lib/bcdatabase/commands.rb:207:in `help' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.3/lib/bcdatabase/commands.rb:207:in`collect' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.3/lib/bcdatabase/commands.rb:207:in `help' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.3/bin/bcdatabase:22 from /usr/bin/bcdatabase:19:in`load' from /usr/bin/bcdatabase:19

any ideas what is wrong, or what I'm doing wrong?

LoadError: no such file to load -- bcdatabase

Hi again!

I installed the gem and tired to load bcdatabase with irb and within the application both lead to the same result

irb(main):001:0> require 'bcdatabase' LoadError: no such file to load -- bcdatabase

Any ideas what might be wrong?

best
phlegx

Refactor the command line interface to use Thor

The command line interface has few tests. This is mostly because the way it is structured is hard to test.

Refactor it to use Thor and along the way, add tests for the existing functionality. This will also allow for well-tested solutions for #1, #7, and #8.

Don't refer to the RAILS_ENV constant

The database.yml integration in bcdatabase looks at the RAILS_ENV constant to determine if it should throw an exception about a missing configuration. It turns out that the constant is not guaranteed to be in sync with the environment variable, particularly if you have multiple test environments (rails always sets the constant to "test" when test_help is required, at least in 2.3.11).

Switch to looking at the environment variable instead.

No such file or directory - /var/lib/nubic/db.pass

Hi, me again. The following error occurs:

bcdatabase epass Password (^C to end): /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase.rb:48:in `initialize': No such file or directory - /var/lib/nubic/db.pass (Errno::ENOENT) from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase.rb :48:in`open' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase.rb:48:in `pass' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase.rb:40:in`encipher' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase.rb:22:in `encrypt' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase/commands.rb:64:in`interactive' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase/commands.rb:60:in `loop' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase/commands.rb:60:in`interactive' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase/commands.rb:46:in `main' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/bin/bcdatabase:26 from /usr/bin/bcdatabase:19:in`load' from /usr/bin/bcdatabase:19

and:

bcdatabase gen-key /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase/commands.rb:191:in `initialize': No such file or directory - /var/lib/nubic/db.pass (Errno::ENOENT) from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase/commands.rb:191:in`open' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/lib/bcdatabase/commands.rb:191:in `main' from /usr/lib/ruby/gems/1.8/gems/bcdatabase-1.0.4/bin/bcdatabase:26 from /usr/bin/bcdatabase:19:in`load' from /usr/bin/bcdatabase:19

Also /etc/nubic/.. does not exist
Seems that those paths have not been created on "sudo gem install bcdatabse". do they need to be crated manually?

best
phlegx

Add DataMapper support

DataMapper configurations are very similar to the AR configurations that Bcdatabase already supports. One difference is that sometimes DataMapper adapters have different names from their AR equivalents. For these cases, support an alternative datamapper_adapter key. Bcdatabase should replace the adapter with this value when it is indicated that the configurations will be used with DataMapper.

Bcdatabase files do not work properly with completely empty entries

A Bcdatabase file like the following could work, but doesn't currently:

defaults:
  host: localhost
  adapter: postgresql
  username: me
  password: mydevpass
personnel:
warehouse:

In this case, the expectation is that there are two configurations — :personnel and :warehouse — that differ only in the database key. The database key should be defaulted from the entry name, but in this case it won't be. Instead, the entry is skipped entirely.

A workaround is to set the entry value to a YAML hash literal like so:

personnel: {}

Separate JRuby adapter support

When using ActiveRecord on JRuby, you usually need to use a different adapter than on MRI. (The only AR adapter I know of that supports both MRI and JRuby is oracle_enhanced.) Add an automatic transform that converts a jruby_adapter value into adapter when on JRuby.

DataMapper does not seem to have this issue — the DataObjects adapters that it uses seem to transparently work with either Ruby or JRuby if there's any support at all.

Make DataMapper & JRuby transforms more generic

It turns out that DataMapper (well, DataObjects, technically) has another configuration difference from ActiveRecord: encoding. While AR expects the encoding name to match a database encoding, DO wants it to be a ruby encoding. These differ for UTF-8 — PostgreSQL's encoding is called "utf8" while Ruby's is "utf-8".

Instead of adding another special-case key to the datamapper transform, allow for this by generalizing the transform to copy any datamapper_[name] key-value to the key [name]. Do the same for the JRuby transform.

Some command tests fail with Highline 1.6.9 under JRuby

Three of the CLI specs fail using HighLine 1.6.9 under JRuby 1.6.5. There's a note about switching to JLine in the HL changelog; that might be the culprit. I'm not sure if the issue actually affects the CLI or just the tests.

Automatically create target directories

gen-key and other utilities expect their target directories to exist and be readable. They should create the directories automatically and fail gracefully if a directory isn't readable.

Receiving ERB error

Hi,

I followed the readme as given. I get the following error

=> Booting WEBrick...
(erb):3: compile error (SyntaxError)
(erb):3: unterminated string meets end of file
(erb):3: syntax error, unexpected $end, expecting ')'
_erbout.concat(( bcdb.production :encrypted, :db ).to_s); _erbout

Can you please point me where I am erroring. The files contents are as follows

encrypted.yml =

defaults:
adapter: mysql
encoding: utf8
db:
epassword: bu4P2Rny+Xm/PmlUgRgIKg==

database.yml=
<%
require 'bcdatabase'
bcdb = Bcdatabase.load RAILS_ROOT+'/bcdatabase/'
%>

<%= bcdb.production :encrypted, :db %>

Handle a missing encryption key more gracefully

In the bcdatabase utility, if you try to use encrypt or epass before gen-key there's an exception. It would be better to give an error message with a clue about needing to use gen-key first.

Thor dependency for rails 4

Currently this gem is locked to Thor version v.0.14, but Rails 4 has minimum dependency on Thor v.0.18.1.

Can we update this dependency?

Command line interface does not work on ruby 1.9

The command line interface (or at least the help, which is the advertised way to learn about the command line interface) does not work on 1.9. This problem is compounded by the fact that the command line interface is only sparsely tested.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.