trackington 0.1.7.pre → 0.1.8.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6b9fa79d0704edb9eb8cd8ea9ed80f0f22d54ea
4
- data.tar.gz: 74310cc3d4f8750bc9fe06db5475bccec9bdc388
3
+ metadata.gz: 79ddc3fe3dd6b662220a29b7626342bcc29d2a47
4
+ data.tar.gz: 75fcd788c565df5ce2286177e5c93db81502c8f9
5
5
  SHA512:
6
- metadata.gz: 3b4a17c16c4df5ba0ed4bbe3dac3655473fa1c2748c3010f4e42b62688f1f3019371d222b90a13d22d0a073921439341d9bfd0f9d9e23d82aaa4f53930d377a3
7
- data.tar.gz: ebb9a556995884ece279311d60d81097867ac956689e66f88962c3e4ece825faa073a2a2a7b7dabe7366e87d9433b4946285cc93337e4bcca336111e6bf8b52b
6
+ metadata.gz: edb150b43fa8d002f4646722b663327448d7f64e42b83d5ce0393fda54b57509c008008f472b221093df5781ccee47c333ee024c5f1d061302c9659f70096a20
7
+ data.tar.gz: c6ec17d4442389a2e4d517f26bbca071bc07cf1f1878fffe34283dbe8060cb95484333beb2228a8cbd81bd7387d273c06d752e6dbc53c9b4f2c876b4eada167d
data/lib/app/core.rb CHANGED
@@ -8,22 +8,26 @@ module Trackington
8
8
  class Application
9
9
  attr_reader :users, :projects
10
10
 
11
- def initialize
11
+ def initialize(connection_config = nil)
12
12
  @users = UserRepository.new
13
13
  @projects = ProjectRepository.new
14
14
 
15
- establish_connection
15
+ establish_connection(connection_config)
16
16
  end
17
17
 
18
18
  private
19
19
 
20
- def establish_connection
21
- config_path = File.expand_path('../../db/config.yml', __FILE__)
22
- config = YAML.load(IO.read(config_path))
20
+ def establish_connection(config)
21
+ if config.nil?
22
+ config_path = File.expand_path('../../db/config.yml', __FILE__)
23
+ config = YAML.load(IO.read(config_path))
23
24
 
24
- env = ENV['DB'] || 'development'
25
+ env = ENV['DB'] || 'development'
25
26
 
26
- ActiveRecord::Base.establish_connection(config[env])
27
+ ActiveRecord::Base.establish_connection(config[env])
28
+ else
29
+ ActiveRecord::Base.establish_connection(config)
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -1,7 +1,7 @@
1
- class CreateUsers < ActiveRecord::Migration
2
- def change
3
- create_table :users do |t|
4
- t.string :email
5
- end
6
- end
7
- end
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :email
5
+ end
6
+ end
7
+ end
@@ -1,11 +1,11 @@
1
- class CreateUserCredentials < ActiveRecord::Migration
2
- def change
3
- create_table :credentials do |t|
4
- t.string :password
5
- t.string :salt
6
- t.string :session_key
7
-
8
- t.belongs_to :user, index: true
9
- end
10
- end
11
- end
1
+ class CreateUserCredentials < ActiveRecord::Migration
2
+ def change
3
+ create_table :credentials do |t|
4
+ t.string :password
5
+ t.string :salt
6
+ t.string :session_key
7
+
8
+ t.belongs_to :user, index: true
9
+ end
10
+ end
11
+ end
@@ -1,9 +1,9 @@
1
- class CreateProjects < ActiveRecord::Migration
2
- def change
3
- create_table :projects do |t|
4
- t.string :description
5
- t.string :title
6
- t.boolean :public, default: false
7
- end
8
- end
9
- end
1
+ class CreateProjects < ActiveRecord::Migration
2
+ def change
3
+ create_table :projects do |t|
4
+ t.string :description
5
+ t.string :title
6
+ t.boolean :public, default: false
7
+ end
8
+ end
9
+ end
@@ -1,10 +1,10 @@
1
- class CreateProjectRoles < ActiveRecord::Migration
2
- def change
3
- create_table :project_roles do |t|
4
- t.integer :role_type, default: 0
5
-
6
- t.belongs_to :user, index: true
7
- t.belongs_to :project, index: true
8
- end
9
- end
10
- end
1
+ class CreateProjectRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :project_roles do |t|
4
+ t.integer :role_type, default: 0
5
+
6
+ t.belongs_to :user, index: true
7
+ t.belongs_to :project, index: true
8
+ end
9
+ end
10
+ end
@@ -1,11 +1,11 @@
1
- class CreateSprints < ActiveRecord::Migration
2
- def change
3
- create_table :sprints do |t|
4
- t.date :start_time
5
- t.date :end_time
6
- t.boolean :is_backlog
7
-
8
- t.belongs_to :project, index: true
9
- end
10
- end
11
- end
1
+ class CreateSprints < ActiveRecord::Migration
2
+ def change
3
+ create_table :sprints do |t|
4
+ t.date :start_time
5
+ t.date :end_time
6
+ t.boolean :is_backlog
7
+
8
+ t.belongs_to :project, index: true
9
+ end
10
+ end
11
+ end
@@ -1,18 +1,18 @@
1
- class CreateTasks < ActiveRecord::Migration
2
- def change
3
- create_table :tasks do |t|
4
- t.string :title
5
- t.string :description
6
-
7
- t.integer :time_planned
8
- t.integer :time_actual
9
-
10
- t.integer :priority # Blocker, Critical, Major, Minor, Trivial
11
- t.integer :type # Epic, Bug, Improvement, New Feature, Story, Task
12
- t.integer :status
13
-
14
- t.integer :assigned_to # should be belongs_to :user
15
- t.integer :created_by # should be belongs_to :user
16
- end
17
- end
18
- end
1
+ class CreateTasks < ActiveRecord::Migration
2
+ def change
3
+ create_table :tasks do |t|
4
+ t.string :title
5
+ t.string :description
6
+
7
+ t.integer :time_planned
8
+ t.integer :time_actual
9
+
10
+ t.integer :priority # Blocker, Critical, Major, Minor, Trivial
11
+ t.integer :type # Epic, Bug, Improvement, New Feature, Story, Task
12
+ t.integer :status
13
+
14
+ t.integer :assigned_to # should be belongs_to :user
15
+ t.integer :created_by # should be belongs_to :user
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
- class UpdateSprintColumns < ActiveRecord::Migration
2
- def change
3
- add_column :sprints, :is_active, :boolean
4
- end
5
- end
1
+ class UpdateSprintColumns < ActiveRecord::Migration
2
+ def change
3
+ add_column :sprints, :is_active, :boolean
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
- class UpdateTasksReferences < ActiveRecord::Migration
2
- def change
3
- add_reference :tasks, :sprint, index: true, foreign_key: true
4
- end
5
- end
1
+ class UpdateTasksReferences < ActiveRecord::Migration
2
+ def change
3
+ add_reference :tasks, :sprint, index: true, foreign_key: true
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
- class UpdateTasksColumn < ActiveRecord::Migration
2
- def change
3
- rename_column :tasks, :type, :task_type
4
- end
5
- end
1
+ class UpdateTasksColumn < ActiveRecord::Migration
2
+ def change
3
+ rename_column :tasks, :type, :task_type
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackington
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7.pre
4
+ version: 0.1.8.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoan Dinkov