dply 0.1.0 → 0.1.1

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: 0cb8b78720dfacebae2f3c70eb5a73ee9c8355ed
4
- data.tar.gz: a428544177c09f38238a5bf2128ea2dd82038749
3
+ metadata.gz: e05f58e649a7ba3d9e361385ea2efeb117b7a795
4
+ data.tar.gz: 66029bdf3cc1d341c3b9f9fcacf169dc7f692241
5
5
  SHA512:
6
- metadata.gz: 508041596cef6f13c18a66532a7875c022784d8df7e158693c33433b049f0593139ef340e6b7ebfd2722d6c17111b97b864cf241889d46b02dfe70bf0b5fd772
7
- data.tar.gz: 6146f87d6669c0e813ab3e4f85fc287263d586749c7d395b22162e7701f5126c760c1fe5bd3d84ad35f1f07c7cbd81c2f077c38ffb22ca57f2d3204a5bd483cd
6
+ metadata.gz: b0a1ea45f1249c97ece698000c4f9f2dd93710b863336bedba5a70383d9bfbb3401d328ea3777676bfeb17c94ac32626ceab1ece369e11e29b218955f0b335f8
7
+ data.tar.gz: 210c4c83027c7f0b53e75b58265c4f0f9e3123cd14741efb7d85ac7ce107d1015af5a3226823983600cf13ca2307f1c86e17a6b68d607aac22c83210502c6824
data/bin/drake CHANGED
@@ -69,10 +69,11 @@ begin
69
69
 
70
70
  command = (ARGV.shift || "").to_sym
71
71
  case command
72
- when :deploy, :reload, :task, :build, :depcheck, :"install-pkgs"
72
+ when :deploy, :reload, :task, :build, :depcheck, :"install-pkgs", :reopen_logs
73
73
  run_cli command, ARGV
74
- when /[a-zA-Z_\-0-9]+[:][a-zA-Z_\-0-9]+/
75
- require 'dply/task_runner'
74
+ when /\A[a-zA-Z_\-0-9]+[:][a-zA-Z_\-0-9]+\z/
75
+ require 'dply/tasks'
76
+ ::Dply::Tasks.new.rake command
76
77
  when :''
77
78
  puts opts_parser
78
79
  else
@@ -1,5 +1,7 @@
1
1
  require 'dply/logger'
2
2
  require 'dply/lock'
3
+ require 'dply/strategy'
4
+ require 'dply/config'
3
5
 
4
6
  module Dply
5
7
  module Cli
@@ -13,27 +15,19 @@ module Dply
13
15
 
14
16
  def run
15
17
  lock.acquire
16
- strategy.deploy
18
+ strategy.reload
17
19
  end
18
20
 
19
21
  def strategy
20
- @strategy ||= ::Dply::Strategy.load(config, options)
22
+ @strategy ||= Strategy.load(config, {})
21
23
  end
22
24
 
23
25
  def config
24
- @config ||= ::Dply::Config.new(dir).to_struct
25
- end
26
-
27
- def dir
28
- @dir ||= Dir.pwd
26
+ @config ||= Config.new.to_struct
29
27
  end
30
28
 
31
29
  def lock
32
- @lock ||= ::Dply::Lock.new
33
- end
34
-
35
- def options
36
- @options ||= {}
30
+ @lock ||= Lock.new
37
31
  end
38
32
 
39
33
  end
@@ -0,0 +1,35 @@
1
+ require 'dply/logger'
2
+ require 'dply/lock'
3
+ require 'dply/strategy'
4
+ require 'dply/config'
5
+
6
+ module Dply
7
+ module Cli
8
+ class ReopenLogs
9
+
10
+ include Logger
11
+
12
+ def initialize(argv)
13
+ @argv = argv
14
+ end
15
+
16
+ def run
17
+ lock.acquire
18
+ strategy.reopen_logs
19
+ end
20
+
21
+ def strategy
22
+ @strategy ||= Strategy.load(config, {})
23
+ end
24
+
25
+ def config
26
+ @config ||= Config.new.to_struct
27
+ end
28
+
29
+ def lock
30
+ @lock ||= Lock.new
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,37 @@
1
+ require 'dply/logger'
2
+ require 'dply/lock'
3
+ require 'dply/strategy'
4
+ require 'dply/config'
5
+
6
+ module Dply
7
+ module Cli
8
+ class Task
9
+
10
+ include Logger
11
+
12
+ def initialize(argv)
13
+ @argv = argv
14
+ end
15
+
16
+ def run
17
+ task_name = @argv.shift
18
+ error "task name not specified" if not task_name
19
+ lock.acquire
20
+ strategy.task(task_name)
21
+ end
22
+
23
+ def strategy
24
+ @strategy ||= Strategy.load(config, {})
25
+ end
26
+
27
+ def config
28
+ @config ||= Config.new.to_struct
29
+ end
30
+
31
+ def lock
32
+ @lock ||= Lock.new
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -47,6 +47,14 @@ module Dply
47
47
  end
48
48
  end
49
49
 
50
+ def reopen_logs
51
+ Dir.chdir(current_dir) { tasks.rake "#{target}:reopen_logs" }
52
+ end
53
+
54
+ def task(task_name)
55
+ Dir.chdir(current_dir) { tasks.task task_name }
56
+ end
57
+
50
58
  private
51
59
 
52
60
  def current_dir
@@ -47,6 +47,14 @@ module Dply
47
47
  end
48
48
  end
49
49
 
50
+ def reopen_logs
51
+ Dir.chdir(current_dir) { tasks.rake "#{target}:reopen_logs" }
52
+ end
53
+
54
+ def task(task_name)
55
+ Dir.chdir(current_dir) { tasks.task task_name }
56
+ end
57
+
50
58
  private
51
59
 
52
60
  def current_dir
@@ -1,3 +1,3 @@
1
1
  module Dply
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dply
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neeraj
@@ -100,6 +100,8 @@ files:
100
100
  - lib/dply/cli/deploy.rb
101
101
  - lib/dply/cli/install_pkgs.rb
102
102
  - lib/dply/cli/reload.rb
103
+ - lib/dply/cli/reopen_logs.rb
104
+ - lib/dply/cli/task.rb
103
105
  - lib/dply/config.rb
104
106
  - lib/dply/config_downloader.rb
105
107
  - lib/dply/config_struct.rb