karo 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of karo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/karo.gemspec +1 -1
- data/lib/karo/cli.rb +20 -0
- data/lib/karo/db.rb +16 -0
- data/lib/karo/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cd656f6ce56c5a2e9e66d0f0ae3459cb4b2be65
|
4
|
+
data.tar.gz: 4583053b91edd2469581b6abfc0f83e415650246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f1539cc884ea2788b7f3dcb0d666ecb92ca221edcd5762e5171b02940b25185d39d8f83d2da7661a9fba78ce921293f94abb4a2e2a5c5d2528078d82fc24eb1
|
7
|
+
data.tar.gz: 0cff60cb102c528f20779405a0b4cd5e112e8638bf943c8dc755b2fd95a98a1b8e12d7fe9a64f9a9a0e8de0556ecb4d0c5bd3faf79913074bf56fea0c93c1340
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Getting Started [![Code Climate](https://codeclimate.com/github/rahult/karo.png)](https://codeclimate.com/github/rahult/karo) [![Dependency Status](https://gemnasium.com/rahult/karo.png)](https://gemnasium.com/rahult/karo) [![Gem Version](https://badge.fury.io/rb/karo.png)](http://badge.fury.io/rb/karo)
|
2
2
|
|
3
|
-
**Karo** is a commandline companion for a rails application which makes db, assets syncs
|
3
|
+
**Karo** is a commandline companion for a rails application which makes db, assets syncs across multiple rails servers easier while development
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/karo.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "pry"
|
22
|
-
spec.add_development_dependency "bundler"
|
22
|
+
spec.add_development_dependency "bundler"
|
23
23
|
spec.add_development_dependency "rake"
|
24
24
|
spec.add_development_dependency "rdoc"
|
25
25
|
spec.add_development_dependency "aruba"
|
data/lib/karo/cli.rb
CHANGED
@@ -46,6 +46,26 @@ module Karo
|
|
46
46
|
ap configuration if configuration
|
47
47
|
end
|
48
48
|
|
49
|
+
desc "ssh", "open ssh console for a given server environment"
|
50
|
+
def ssh
|
51
|
+
configuration = Config.load_configuration(options)
|
52
|
+
|
53
|
+
path = File.join(configuration["path"], "current")
|
54
|
+
ssh = "ssh #{configuration["user"]}@#{configuration["host"]} -t"
|
55
|
+
cmd = "cd #{path} && $SHELL"
|
56
|
+
system "#{ssh} '#{cmd}'"
|
57
|
+
end
|
58
|
+
|
59
|
+
desc "console", "open rails console for a given server environment"
|
60
|
+
def console
|
61
|
+
configuration = Config.load_configuration(options)
|
62
|
+
|
63
|
+
path = File.join(configuration["path"], "current")
|
64
|
+
ssh = "ssh #{configuration["user"]}@#{configuration["host"]} -t"
|
65
|
+
cmd = "cd #{path} && bundle exec rails console #{options[:environment]}"
|
66
|
+
system "#{ssh} '#{cmd}'"
|
67
|
+
end
|
68
|
+
|
49
69
|
desc "version", "displays karo's current version"
|
50
70
|
def version
|
51
71
|
say Karo::VERSION
|
data/lib/karo/db.rb
CHANGED
@@ -10,6 +10,7 @@ module Karo
|
|
10
10
|
|
11
11
|
include Thor::Actions
|
12
12
|
|
13
|
+
method_option :migrate, aliases: "-m", desc: "run migrations after sync", default: true
|
13
14
|
desc "pull", "syncs MySQL database from server to localhost"
|
14
15
|
def pull
|
15
16
|
configuration = Config.load_configuration(options)
|
@@ -53,6 +54,11 @@ module Karo
|
|
53
54
|
|
54
55
|
system "#{ssh} \"mysqldump --opt -C -u#{server_db_config["username"]} -p#{server_db_config["password"]} #{server_db_config["database"]}\" | mysql -v -h #{local_db_config["host"]} -C -u#{local_db_config["username"]} -p#{local_db_config["password"]} #{local_db_config["database"]}"
|
55
56
|
|
57
|
+
if options[:migrate]
|
58
|
+
say "Running rake db:migrations", :green
|
59
|
+
system "bundle exec rake db:migrate"
|
60
|
+
end
|
61
|
+
|
56
62
|
say "Database sync complete", :green
|
57
63
|
end
|
58
64
|
|
@@ -61,6 +67,16 @@ module Karo
|
|
61
67
|
say "Pending Implementation...", :yellow
|
62
68
|
end
|
63
69
|
|
70
|
+
desc "console", "open rails dbconsole for a given server environment"
|
71
|
+
def console
|
72
|
+
configuration = Config.load_configuration(options)
|
73
|
+
|
74
|
+
path = File.join(configuration["path"], "current")
|
75
|
+
ssh = "ssh #{configuration["user"]}@#{configuration["host"]} -t"
|
76
|
+
cmd = "cd #{path} && bundle exec rails dbconsole #{options[:environment]} -p"
|
77
|
+
system "#{ssh} '#{cmd}'"
|
78
|
+
end
|
79
|
+
|
64
80
|
end
|
65
81
|
|
66
82
|
end
|
data/lib/karo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rahul Trikha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|