tulirb 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
  SHA256:
3
- metadata.gz: 71894a41382e1a2d581cd40f46e5cae0fa5b3d16f496f86b38ced085d94532bc
4
- data.tar.gz: b59d5863188a36eb43bc184289778bb207d1982ea03eacf3a591d09b8319aeb8
3
+ metadata.gz: cbe761a5276117baa268d4c3ada16a57afe6a0b993a1a689225320336c4c7a89
4
+ data.tar.gz: adfd35e0f4de82b8d3cdf70d5bbc4188f5e1b312381b18ef65ea254dbfd914bc
5
5
  SHA512:
6
- metadata.gz: ff097d9c769fd60037af18e055e523f8f1e703f3649a43589390ccc178dd7934e699515baeefb7920b6b10299a025c115677786260540e67ccca2dc5b39aeb8e
7
- data.tar.gz: df0d53ecd8603a89cf0b355ab5ab39bae71ebfd79c9ab4e395ac7ad23f2bbe16debac1f46c20a8ad219224bf1871d5b596cb6a0e1fe446f5d9c0779a31404dad
6
+ metadata.gz: 6ac704550f29551b68d3681b359dbe5029f08a1a0ae57d2c6f049fbaac4d8581591d87f2431aa4253169008948704f2479cd6dc43ae48c7e92daa28f30624b81
7
+ data.tar.gz: f951e71336d9c3a42d370d801bdedb3846c13a40d9a5ae1a009bff7415b3ed7011a966a3596a00b4cbfa8bd675e9c5f9e4460e83cb1560c39cd9b02391576c0d
data/.rubocop.yml CHANGED
@@ -16,6 +16,12 @@ Style/StringLiteralsInInterpolation:
16
16
  EnforcedStyle: double_quotes
17
17
  Style/Documentation:
18
18
  Enabled: false
19
+ Metrics/ModuleLength:
20
+ Enabled: false
21
+ Metrics/ClassLength:
22
+ Enabled: false
23
+ Metrics/MethodLength:
24
+ CountAsOne: ['array', 'heredoc', 'method_call']
19
25
 
20
26
 
21
27
  Layout/LineLength:
data/CHANGELOG.md CHANGED
@@ -3,3 +3,9 @@
3
3
  ## [0.1.0] - 2023-12-31
4
4
 
5
5
  - Initial release
6
+
7
+ ## [0.1.1] - 2023-01-22
8
+
9
+ - Fixed ArgumentError messages in C extension.
10
+ - [interna] Replace metaprogrammed Ruby wrapper methods with explicitly defined methods.
11
+ - [internal] Added tests for wrapper methods.
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Tulirb
2
- Ruby bindings for the Tulip indicators technical analysis indicator library (https://tulipindicators.org/). This can be used to build tools for financial trading and data analytics in Ruby.
2
+ Ruby bindings for the Tulip indicators technical analysis indicator library (https://tulipindicators.org/). This can be used to build tools for financial markets trading and analytics in Ruby.
3
3
 
4
4
  ## Installation
5
5
 
@@ -18,6 +18,8 @@ This library consists of a single module: `Tulirb`. All indicator functions are
18
18
  Example:
19
19
 
20
20
  ```ruby
21
+ require("tulirb")
22
+
21
23
  # Exponential Moving Average
22
24
  Tulirb.ema([[1.2, 1.5, 1, 1.8]], period: 5) # => [[1.2, 1.35, 1.175, 1.4875]]
23
25
 
@@ -34,6 +36,9 @@ Example:
34
36
  ) # => [[650, 720.2020202020201, 120.20202020202017], [480.80808080808083, 690.0673400673401, 496.80134680134677]]
35
37
  ```
36
38
 
39
+ ## Documentation
40
+ Find documentation for all indicator functions [here](https://www.rubydoc.info/github/ozone4real/tulirb/main/Tulirb). Information about the input and option parameters for each indicator method are also available in the `Tulirb::INDICATORS_INFO` hash.
41
+
37
42
  ## Development
38
43
 
39
44
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -42,7 +47,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
42
47
 
43
48
  ## Contributing
44
49
 
45
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tulirb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/tulirb/blob/main/CODE_OF_CONDUCT.md).
50
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ozone4real/tulirb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ozone4real/tulirb/blob/main/CODE_OF_CONDUCT.md).
46
51
 
47
52
  ## License
48
53
 
@@ -50,4 +55,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
50
55
 
51
56
  ## Code of Conduct
52
57
 
53
- Everyone interacting in the Tulirb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tulirb/blob/main/CODE_OF_CONDUCT.md).
58
+ Everyone interacting in the Tulirb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ozone4real/tulirb/blob/main/CODE_OF_CONDUCT.md).
data/code_generator.rb ADDED
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require("tulirb")
4
+ require("active_support/core_ext/string")
5
+
6
+ file = File.open("code_output.rb", "a+")
7
+
8
+ file.write("class << self\n")
9
+
10
+ Tulirb::INDICATORS_INFO.each do |k, v|
11
+ kwargs = v[:options].map { |o| "#{o}:" }.join(", ")
12
+ kwargs = kwargs.empty? ? "" : ", #{kwargs}"
13
+ options_doc = v[:options].map { |o| "# @param #{o} [Numeric] #{o.titleize}" }
14
+ options_doc = options_doc.empty? ? "" : "\n#{options_doc.join(".\n")}."
15
+ func = <<~RUBY
16
+ # #{v[:full_name]}.
17
+ # @param inputs [Array<Array<Numeric>>] 2d array of inputs. #{options_doc}
18
+ # @return [Array<Array<Numeric>>] 2d array of results.
19
+ # @see Official TulipIndicators docs for detailed explanation and formular for this indicator function: (https://tulipindicators.org/#{k})
20
+ def #{k}(inputs#{kwargs})
21
+ super(inputs, [#{v[:options].join(", ")}])
22
+ end
23
+
24
+ RUBY
25
+ file.write(func)
26
+ end
27
+
28
+ file.write("end")
29
+ file.close