txdb 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c2c319827b4fdab7a23880e83db01a22cbff37f
4
- data.tar.gz: e4daed35214662b575b686607b825b29fed8aed7
3
+ metadata.gz: 3bc37bfdf9e73758b78be101dc440f0354078f8d
4
+ data.tar.gz: e71385526e032e713be01aa01ce0a0277f11c84d
5
5
  SHA512:
6
- metadata.gz: c0e524ba754bed238ccf5647f1711c357cf87a59fd558fb6fa69e06732c6570eb4486f87de36634f9488d79499db1b1e36acd86ebb3836e791684e35aa472f94
7
- data.tar.gz: 78b1aa0ada81ef0c9369b46177a4dedf6db6a5fcd07c31151167544dac9bfe69bc0178eeb5b8ce35b525d90210f0b40d9569cba5acc6b36de235d794f984a004
6
+ metadata.gz: c14ff5270d2d43875180d98e5d27a64fc03f822bde72e0ed6b718ed502281f4aa4b8a0df00bcb4cebd090b11ff61d3a5d1469556b6b7fc9aaecaff1ac4e646d8
7
+ data.tar.gz: 88b8256d21d523d520e5cc9942fdf784f6719a102a26eb92ce1a3b6210fd43699249ebd6b9eb57fae48d529645f9d27b4a2e01bd17e575b3e77783fdaa63c19e
@@ -12,7 +12,7 @@ module Txdb
12
12
  end
13
13
 
14
14
  def resource_slug_for(table)
15
- Txgh::Utils.slugify("#{table.database.database}-#{table.name}")
15
+ Txgh::Utils.slugify("#{table.database.name}-#{table.name}")
16
16
  end
17
17
  end
18
18
 
@@ -1,8 +1,8 @@
1
1
  module Txdb
2
2
  class ConnectionString
3
3
  TEMPLATES = {
4
- mysql2: "%{adapter}://%{username}:%{password}@%{host}:%{port}/%{database}",
5
- sqlite: "%{adapter}://%{database}"
4
+ mysql2: "%{adapter}://%{username}:%{password}@%{host}:%{port}/%{name}",
5
+ sqlite: "%{adapter}://%{name}"
6
6
  }
7
7
 
8
8
  attr_reader :options
data/lib/txdb/database.rb CHANGED
@@ -6,7 +6,7 @@ module Txdb
6
6
  DEFAULT_PORT = '3306'
7
7
  DEFAULT_POOL = 10
8
8
 
9
- attr_reader :adapter, :backend, :username, :password, :host, :port, :database
9
+ attr_reader :adapter, :backend, :username, :password, :host, :port, :name
10
10
  attr_reader :pool, :transifex_project, :tables, :connection_string
11
11
 
12
12
  def initialize(options = {})
@@ -16,7 +16,7 @@ module Txdb
16
16
  @password = options.fetch(:password)
17
17
  @host = options.fetch(:host, DEFAULT_HOST)
18
18
  @port = options.fetch(:port, DEFAULT_PORT)
19
- @database = options.fetch(:database)
19
+ @name = options.fetch(:name)
20
20
  @pool = options.fetch(:pool, DEFAULT_POOL)
21
21
  @transifex_project = TransifexProject.new(options.fetch(:transifex))
22
22
  @connection_string = ConnectionString.new(options).string
@@ -26,7 +26,7 @@ module Txdb
26
26
 
27
27
  def database
28
28
  @database ||= Txdb::Config.databases.find do |database|
29
- database.database == request.params['database']
29
+ database.name == request.params['database']
30
30
  end
31
31
  end
32
32
 
data/lib/txdb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Txdb
2
- VERSION = '1.2.0'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -7,7 +7,7 @@ describe ConnectionString do
7
7
  let(:options) do
8
8
  {
9
9
  username: 'janeway', password: 'borgsuck',
10
- host: 'voyager', port: 3306, database: 'stellar_cartography'
10
+ host: 'voyager', port: 3306, name: 'stellar_cartography'
11
11
  }
12
12
  end
13
13
 
@@ -29,7 +29,7 @@ describe PullHandler, test_config: true do
29
29
  end
30
30
 
31
31
  let(:params) do
32
- { 'database' => database.database, 'table' => table.name }
32
+ { 'database' => database.name, 'table' => table.name }
33
33
  end
34
34
 
35
35
  it 'downloads the table for each locale' do
@@ -29,7 +29,7 @@ describe PushHandler, test_config: true do
29
29
  end
30
30
 
31
31
  let(:params) do
32
- { 'database' => database.database, 'table' => table.name }
32
+ { 'database' => database.name, 'table' => table.name }
33
33
  end
34
34
 
35
35
  it 'uploads the table' do
@@ -62,7 +62,7 @@ module Txdb
62
62
  backend: 'test-backend',
63
63
  username: 'username',
64
64
  password: 'password',
65
- database: 'spec/test.sqlite3',
65
+ name: 'spec/test.sqlite3',
66
66
  transifex: {
67
67
  organization: 'myorg',
68
68
  project_slug: 'myproject',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2016-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport