nubic / bcdatabase Goto Github PK
View Code? Open in Web Editor NEWServer-central database configuration for ruby (including rails) apps
License: MIT License
Server-central database configuration for ruby (including rails) apps
License: MIT License
One of the tests for bcdatabase epass
fails when using Highline 1.6.5 for the Highline dependency. (1.6.2 works fine.) Determine why and fix it.
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?
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
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.
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
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.
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: {}
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.
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.
bcdatabase encrypt
will not work properly if either of the following is true:
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.
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.
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 %>
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.
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.