nose-cli 0.1.0pre → 0.1.0

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: 69482346fff002e27d56b7826eec5ab14f4626db
4
- data.tar.gz: 07e536d085b0a88fb38f8650a940e4a54c18fbf6
3
+ metadata.gz: e1669befb3b75e3c46629b3087c3113f27fe91df
4
+ data.tar.gz: 5a6f61bc207fa7574c3a289297b62ed268b79034
5
5
  SHA512:
6
- metadata.gz: 1c0e8ab04a53a5107a6ff9559f218eea28db5437d21597720c508867d5d737ce065a742a331ab0742df81bb85efe5f1c6b6737ec00cab204cad1879444b1e73b
7
- data.tar.gz: 3e7ab9f5d4b30a71697a15cface20dbf99998f738504f0d83cba5b165cb3cfbad588bc380378c3dd637e5e2f021acffc908d03fe3abaad17fb687f66ac9da93f
6
+ metadata.gz: 9c53dd07c7ad55bd9eb5b064e4ea3995fdecf21b82462a5d0d51de96177265c9f0f4191cb2563fa061d45509c761b96f8990a25bfe263420d86cb4fd3e7c7301
7
+ data.tar.gz: ea66f982e0080b9a66e160866df865a8931a090c3500c701d746d9dc62d2a7d929e1362ba036575cc665d76588d11846bb10890fac30921aab5051fa41a707de
data/lib/nose_cli.rb CHANGED
@@ -82,7 +82,7 @@ module NoSE
82
82
  end
83
83
 
84
84
  # Get a backend instance for a given configuration and dataset
85
- # @return [Backend::BackendBase]
85
+ # @return [Backend::Backend]
86
86
  def get_backend(config, result)
87
87
  be_class = get_class 'backend', config
88
88
  be_class.new result.workload.model, result.indexes,
@@ -340,6 +340,7 @@ require_relative 'nose_cli/diff_plans'
340
340
  require_relative 'nose_cli/dump'
341
341
  require_relative 'nose_cli/export'
342
342
  require_relative 'nose_cli/execute'
343
+ require_relative 'nose_cli/list'
343
344
  require_relative 'nose_cli/load'
344
345
  require_relative 'nose_cli/genworkload'
345
346
  require_relative 'nose_cli/graph'
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NoSE
4
+ module CLI
5
+ # Add a command to list different types of classes available
6
+ class NoSECLI < Thor
7
+ desc 'list TYPE', 'list available objects of the given TYPE'
8
+
9
+ AVAILABLE_TYPES = %w(backend cost).freeze
10
+
11
+ long_desc <<-LONGDESC
12
+ `nose list` shows available objects of different types.
13
+
14
+ The following types are currently supported:
15
+ #{AVAILABLE_TYPES.join ', '}
16
+ LONGDESC
17
+
18
+ def list(type)
19
+ case type
20
+ when 'backend'
21
+ cls = Backend::Backend
22
+ when 'cost'
23
+ cls = Cost::Cost
24
+ else
25
+ fail Thor::UnknownArgumentError,
26
+ "Invalid type. Available types are #{AVAILABLE_TYPES.join ', '}"
27
+ end
28
+
29
+ cls.subclasses.each_value { |c| puts c.subtype_name }
30
+ end
31
+ end
32
+ end
33
+ end
@@ -36,8 +36,15 @@ module NoSE
36
36
  aliases: '-i'
37
37
 
38
38
  def search(name)
39
- # Get the workload and cost model
40
- workload = Workload.load name
39
+ # Get the workload from file or name
40
+ if File.exist? name
41
+ result = load_results name, options[:mix]
42
+ workload = result.workload
43
+ else
44
+ workload = Workload.load name
45
+ end
46
+
47
+ # Prepare the workload and the cost model
41
48
  workload.mix = options[:mix].to_sym \
42
49
  unless options[:mix] == 'default' && workload.mix != :default
43
50
  workload.remove_updates if options[:read_only]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nose-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0pre
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Mior
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-01 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi-to-html
@@ -62,16 +62,16 @@ dependencies:
62
62
  name: nose
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '='
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 0.1.0pre4
67
+ version: 0.1.0
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '='
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 0.1.0pre4
74
+ version: 0.1.0
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: representable
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -162,6 +162,20 @@ dependencies:
162
162
  - - "~>"
163
163
  - !ruby/object:Gem::Version
164
164
  version: 0.10.1
165
+ - !ruby/object:Gem::Dependency
166
+ name: pry-nav
167
+ requirement: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ type: :development
173
+ prerelease: false
174
+ version_requirements: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
165
179
  - !ruby/object:Gem::Dependency
166
180
  name: pry-rescue
167
181
  requirement: !ruby/object:Gem::Requirement
@@ -300,6 +314,7 @@ files:
300
314
  - lib/nose_cli/export.rb
301
315
  - lib/nose_cli/genworkload.rb
302
316
  - lib/nose_cli/graph.rb
317
+ - lib/nose_cli/list.rb
303
318
  - lib/nose_cli/load.rb
304
319
  - lib/nose_cli/measurements.rb
305
320
  - lib/nose_cli/plan_schema.rb
@@ -333,12 +348,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
333
348
  version: '0'
334
349
  required_rubygems_version: !ruby/object:Gem::Requirement
335
350
  requirements:
336
- - - ">"
351
+ - - ">="
337
352
  - !ruby/object:Gem::Version
338
- version: 1.3.1
353
+ version: '0'
339
354
  requirements: []
340
355
  rubyforge_project:
341
- rubygems_version: 2.5.2
356
+ rubygems_version: 2.4.8
342
357
  signing_key:
343
358
  specification_version: 4
344
359
  summary: Schema design for NoSQL applications