masamune 0.15.4 → 0.15.5

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: c3a23e580b78e0dfde266cffddec00f2442bc1da
4
- data.tar.gz: 175e664d4f3262bb3d302a1a789912130e71c693
3
+ metadata.gz: e5057258a406f7f889d685a6060ca42ecd5e39ab
4
+ data.tar.gz: c4fa4ad80317574acaeebbe8017fc4d4ed3ff20b
5
5
  SHA512:
6
- metadata.gz: 2422f0c4406e4543a1f88f0843b4579c945861766a684c942d5dac09ab1f88ff42f85547b1f93937f8976e1a038ece71ec43a735c0246c745b7c8b13ed2315f7
7
- data.tar.gz: b23f898f4883cc7704b81c324751d017894acc1e6f5ce5e3f4e8285084ac812b160a0a41e894875f91f97ae8521437897c327f1f3130377c2dfbec1a411b61a1
6
+ metadata.gz: fcac62a5623326ed3a090de28f7355b9e6bc77a36b9959483bf53214c579ab2bffcb3cdfda3c1710b44b7fbfcb026720e7bdbc34877201bfaa3c1f06f20f5b44
7
+ data.tar.gz: c69d42b73d6aeb0bb7c6d0cdfcdae0330e31fc8e29192dc36143c3606f085d162a7c37fbcc2b6d631fc3d2d6dab7cf565ee9a1655afc2692c9c707fd35312291
@@ -73,6 +73,11 @@ module Masamune::Actions
73
73
  engine.execute(current_command_name, options)
74
74
  end
75
75
 
76
+ def reset_module!
77
+ ClassMethods.reset_module!
78
+ end
79
+ module_function :reset_module!
80
+
76
81
  private
77
82
 
78
83
  included do |base|
@@ -94,27 +99,26 @@ module Masamune::Actions
94
99
  end
95
100
 
96
101
  module ClassMethods
97
- @@namespaces = []
98
- @@commands = []
99
- @@sources = []
100
- @@targets = []
101
-
102
102
  def skip
103
+ initialize_module!
103
104
  @@namespaces << namespace
104
105
  @@sources << {skip: true}
105
106
  @@targets << {skip: true}
106
107
  end
107
108
 
108
109
  def source(source_options = {})
110
+ initialize_module!
109
111
  @@namespaces << namespace
110
112
  @@sources << source_options
111
113
  end
112
114
 
113
115
  def target(target_options = {})
116
+ initialize_module!
114
117
  @@targets << target_options
115
118
  end
116
119
 
117
120
  def create_command(*a)
121
+ initialize_module!
118
122
  super.tap do
119
123
  @@commands += a
120
124
  end
@@ -126,6 +130,22 @@ module Masamune::Actions
126
130
 
127
131
  private
128
132
 
133
+ def reset_module!
134
+ @@namespaces = []
135
+ @@targets = []
136
+ @@sources = []
137
+ @@commands = []
138
+ @@engine = nil
139
+ end
140
+ module_function :reset_module!
141
+
142
+ def initialize_module!
143
+ @@namespaces ||= []
144
+ @@targets ||= []
145
+ @@sources ||= []
146
+ @@commands ||= []
147
+ end
148
+
129
149
  # If internal call to Thor::Base.start fails, exit
130
150
  def exit_on_failure?
131
151
  true
@@ -27,7 +27,7 @@ require 'pry'
27
27
  module Masamune::Tasks
28
28
  class ShellThor < Thor
29
29
  include Masamune::Thor
30
- include Masamune::Actions::DateParse
30
+ include Masamune::Actions::DataFlow
31
31
 
32
32
  # FIXME need to add an unnecessary namespace until this issue is fixed:
33
33
  # https://github.com/wycats/thor/pull/247
@@ -35,6 +35,7 @@ module Masamune::Tasks
35
35
  skip_lock!
36
36
 
37
37
  desc 'shell', 'Launch an interactive shell'
38
+ skip
38
39
  method_option :prompt, :desc => 'Set shell prompt', :default => 'masamune'
39
40
  class_option :start, :aliases => '-a', :desc => 'Start time', default: '1 month ago'
40
41
  def shell_exec
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Masamune
24
- VERSION = '0.15.4'
24
+ VERSION = '0.15.5'
25
25
  end
@@ -34,4 +34,8 @@ describe Masamune::Tasks::ShellThor do
34
34
  cli_invocation
35
35
  end
36
36
  end
37
+
38
+ context 'includes reference to engine' do
39
+ it { expect(described_class.engine).to_not be_nil }
40
+ end
37
41
  end
@@ -72,6 +72,7 @@ module TaskExampleGroup
72
72
  def self.included(base)
73
73
  base.before :all do
74
74
  ENV['THOR_DEBUG'] = '1'
75
+ Masamune::Actions::DataFlow.reset_module!
75
76
  end
76
77
 
77
78
  base.let(:thor_class) { described_class }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: masamune
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.4
4
+ version: 0.15.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Andrews
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-04 00:00:00.000000000 Z
11
+ date: 2015-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor