sqa 0.0.8 → 0.0.9

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
  SHA256:
3
- metadata.gz: 9ed5a0bfe672b2a11993e5afd8ed8cbb103355f033c95e791c8c2ef57dbd8464
4
- data.tar.gz: 308d76cd23b50c057816ed7cde0815a51b4bb5e196ea14e231fd68ad06fe76b5
3
+ metadata.gz: b21ccda9b46c7125afbce0c1ac8f074b945a64e3ee946db5c44566e104bd34e9
4
+ data.tar.gz: 5252167d8e7f7520bcbdd43a9cf0bae541466ee09b05b677817cb31d8d74ca71
5
5
  SHA512:
6
- metadata.gz: 1e8297f1d895d4ae7509a24486dc5ae3f542e1f0aeead4308a37da0a9a240f9b8e7bc2858914d928277044be78aff8eb6880c3b86329457e1cc329903d2faf23
7
- data.tar.gz: d58c62150ae5ed500222704cf550f7f34d7740fe4a5e7761354962ce3fbd79c21353d9d5b6a017f6b3c2e636316c745e05b261507883bace63901769b1959049
6
+ metadata.gz: a9defe0ba2597a23c5edde2d2adb150e4d5b1e8f0b9005ed00b439b60e1c56af766ec959d305e57c416ebc6c8f701ffe6525050e2ff81258a4348430b3cc8ef8
7
+ data.tar.gz: 40026c37bb437b44d1f25ebc868f8d166b2bebfcd3476ce7463f6f3534d8f846da5e8179fba2248e5387da0a8ea0f7acd8805c49952f049ea0ebfa1c75df112a
data/Rakefile CHANGED
@@ -1,4 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.warning = false
10
+ t.test_globs = ["test/**/*_test.rb"]
11
+ end
12
+
4
13
  task default: %i[]
@@ -0,0 +1 @@
1
+ 2a8a31c1dced7189c4b5c2a53a14fd222b28bad3de103bab088e5a1ee49c3dcb9f9632e8fa84ad11a28749477dfb9b6a79e3b86cb1cd26ac88517b27e3a5ad99
data/lib/sqa/cli.rb CHANGED
@@ -57,7 +57,7 @@ module SQA
57
57
  desc "Set the directory for the SQA data"
58
58
  end
59
59
 
60
- flag :dump_config do
60
+ option :dump_config do
61
61
  long "--dump-config path_to_file"
62
62
  desc "Dump the current configuration"
63
63
  end
@@ -156,7 +156,7 @@ module SQA
156
156
 
157
157
  def remove_temps(a_hash)
158
158
  temps = %i[ help version dump ]
159
- debug_me{[ :a_hash ]}
159
+ # debug_me{[ :a_hash ]}
160
160
  a_hash.reject{|k, _| temps.include? k}
161
161
  end
162
162
  end
data/lib/sqa/config.rb CHANGED
@@ -18,7 +18,9 @@ module SQA
18
18
  include Hashie::Extensions::Coercion
19
19
  include Hashie::Extensions::Dash::PredefinedValues
20
20
 
21
- property :config_file #, default: Nenv.home + "/.sqa.yml"
21
+ property :config_file #,a String filepath for the current config overriden by cli options
22
+ property :dump_config # a String filepath into which to dump the current config
23
+
22
24
  property :data_dir, default: Nenv.home + "/sqa_data"
23
25
 
24
26
  # TODO: If no path is given, these files will be in
@@ -163,7 +165,15 @@ module SQA
163
165
  def dump_json = File.open(config_file, "w") { |f| f.write JSON.pretty_generate(as_hash)}
164
166
  def dump_toml = File.open(config_file, "w") { |f| f.write TomlRB.dump(as_hash)}
165
167
  def dump_yaml = File.open(config_file, "w") { |f| f.write as_hash.to_yaml}
166
- end
168
+
169
+
170
+ #####################################
171
+ class << self
172
+ def reset
173
+ SQA.config = new
174
+ end
175
+ end
176
+ end
167
177
  end
168
178
 
169
- SQA.config = SQA::Config.new
179
+ SQA::Config.reset
@@ -5,7 +5,7 @@ require_relative 'data_frame/yahoo_finance'
5
5
 
6
6
  class SQA::DataFrame < Daru::DataFrame
7
7
  def self.path(filename)
8
- SQA::Config.data_dir + filename
8
+ Pathname.new SQA.config.data_dir + filename
9
9
  end
10
10
 
11
11
  def self.load(filename, options={}, &block)
data/lib/sqa/strategy.rb CHANGED
@@ -54,4 +54,12 @@ class SQA::Strategy
54
54
  end
55
55
  end
56
56
 
57
+ require_relative 'strategy/common'
58
+ require_relative 'strategy/consensus'
59
+ require_relative 'strategy/ema'
60
+ require_relative 'strategy/mp'
61
+ require_relative 'strategy/mr'
62
+ require_relative 'strategy/random'
63
+ require_relative 'strategy/rsi'
64
+ require_relative 'strategy/sma'
57
65
 
data/lib/sqa/version.rb CHANGED
@@ -4,7 +4,7 @@ require 'sem_version'
4
4
  require 'sem_version/core_ext'
5
5
 
6
6
  module SQA
7
- VERSION = "0.0.8"
7
+ VERSION = "0.0.9"
8
8
 
9
9
  class << self
10
10
  def version
data/lib/sqa.rb CHANGED
@@ -30,7 +30,13 @@ module SQA
30
30
  # Ran at SQA::Config elaboration time
31
31
  # @@config = Config.new
32
32
 
33
- CLI.run(argv) if defined? CLI
33
+ if defined? CLI
34
+ CLI.run(argv)
35
+ else
36
+ # There are no real command line parameters
37
+ # because the sqa gem is be required within
38
+ # the context of a larger program.
39
+ end
34
40
 
35
41
  Daru.lazy_update = config.lazy_update
36
42
  Daru.plotting_library = config.plotting_library
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-05 00:00:00.000000000 Z
11
+ date: 2023-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -285,6 +285,7 @@ files:
285
285
  - checksums/sqa-0.0.6.gem.sha512
286
286
  - checksums/sqa-0.0.7.gem.sha512
287
287
  - checksums/sqa-0.0.8.gem.sha512
288
+ - checksums/sqa-0.0.9.gem.sha512
288
289
  - docs/.gitignore
289
290
  - docs/README.md
290
291
  - docs/average_true_range.md