farmstead 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/farmstead/cli/db.rb +17 -0
- data/lib/farmstead/cli.rb +5 -0
- data/lib/farmstead/db.rb +15 -1
- data/lib/farmstead/scaffold/exec.sh.erb +3 -0
- data/lib/farmstead/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2806f182e6cd93e8cd9ff4a69ca6578925e26a2a
|
4
|
+
data.tar.gz: 1b604a5e9814af604795c68d78385db6906eb229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f606bb4fbb2191151254f064b9640bf552f23e5c6171c9fe1f511e8c836874e0d2591391d9bab9ef78a7c2cea9a5e5b0e097fcfd26184816d33e85e0e9c57f51
|
7
|
+
data.tar.gz: 38c72bbce85620e6dca08cbd88ebeaf29e55b635ef099156c81d91b64ad5250aeba2b92320fc4e8159b123ff8dbc304673cd77e74f81ee23214b453ef6c26ae2
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Database subcommands
|
2
|
+
|
3
|
+
module Farmstead
|
4
|
+
class CLIDB < Thor
|
5
|
+
desc "setup", "Setup the database"
|
6
|
+
def setup
|
7
|
+
puts "Setting up the database"
|
8
|
+
Farmstead::DB.setup
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "list", "List the sources"
|
12
|
+
def list
|
13
|
+
puts "List the sources"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
data/lib/farmstead/cli.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "thor"
|
2
2
|
require "farmstead/cli/test"
|
3
|
+
require "farmstead/cli/db"
|
3
4
|
|
4
5
|
module Farmstead
|
5
6
|
class HammerTime < Thor
|
@@ -46,6 +47,10 @@ module Farmstead
|
|
46
47
|
require_relative "farmstead/extract"
|
47
48
|
end
|
48
49
|
|
50
|
+
desc "db COMMANDS", "Database commands"
|
51
|
+
subcommand "db", Farmstead::CLIDB
|
52
|
+
|
53
|
+
|
49
54
|
desc "test COMMANDS", "Test commands"
|
50
55
|
subcommand "test", Farmstead::CLITest
|
51
56
|
|
data/lib/farmstead/db.rb
CHANGED
@@ -4,11 +4,25 @@ module Farmstead
|
|
4
4
|
class DB
|
5
5
|
def self.pull_variables
|
6
6
|
@@mysql_host = ENV["MYSQL_HOST"]
|
7
|
+
@@mysql_password = ENV["MYSQL_PASSWORD"]
|
8
|
+
@@mysql_user = ENV["MYSQL_USER"]
|
9
|
+
@@mysql_database = ENV["MYSQL_DATABASE"]
|
10
|
+
@@DB = Sequel.connect(adapter: "mysql2", host: @@mysql_host, database: @@mysql_database, user: @@mysql_user, password: @@mysql_password)
|
7
11
|
end
|
8
12
|
|
9
13
|
def self.add_source
|
10
14
|
self.pull_variables
|
11
|
-
|
15
|
+
puts "Add source"
|
12
16
|
end
|
17
|
+
|
18
|
+
def self.setup
|
19
|
+
self.pull_variables
|
20
|
+
@@DB.create_table :sources do
|
21
|
+
primary_key(:id)
|
22
|
+
String(:name)
|
23
|
+
String(:type)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
13
27
|
end
|
14
28
|
end
|
data/lib/farmstead/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: farmstead
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Jenney
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -250,6 +250,7 @@ files:
|
|
250
250
|
- lib/farmstead/api/v1.rb
|
251
251
|
- lib/farmstead/api/views/environment.erb
|
252
252
|
- lib/farmstead/cli.rb
|
253
|
+
- lib/farmstead/cli/db.rb
|
253
254
|
- lib/farmstead/cli/test.rb
|
254
255
|
- lib/farmstead/db.rb
|
255
256
|
- lib/farmstead/pipeline/extract.rb
|