Skip to content

Commit cbb5ff1

Browse files
authored
Merge pull request #4 from Youngv/dev
Update to version 0.2.0 with significant changes
2 parents b33ae50 + 043e2a0 commit cbb5ff1

File tree

7 files changed

+37
-15
lines changed

7 files changed

+37
-15
lines changed

CHANGELOG.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.0] - 2025-01-21
9+
10+
### Added
11+
- Added Zeitwerk inflector configuration for proper constant loading
12+
13+
### Changed
14+
- Renamed module from `TALib` to `TALibFFI` for better clarity
15+
- Renamed main file from `lib/ta_lib.rb` to `lib/ta_lib_ffi.rb`
16+
- Updated require statements in specs and gemspec
17+
818
## [0.1.0] - 2024-01-21
919

1020
### Added
@@ -26,10 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2636
### Removed
2737
- N/A
2838

29-
### Fixed
30-
- N/A
31-
3239
### Security
3340
- N/A
3441

42+
[0.2.0]: https://github.com/Youngv/ta_lib_ffi/compare/v0.1.0...v0.2.0
3543
[0.1.0]: https://github.com/Youngv/ta_lib_ffi/releases/tag/v0.1.0

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
ta_lib_ffi (0.1.0)
4+
ta_lib_ffi (0.2.0)
55
fiddle (~> 1.1)
66

77
GEM

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# TALib
1+
# TALibFFI
22

33
![Tests](https://github.com/Youngv/ta_lib_ffi/actions/workflows/main.yml/badge.svg)
44

55
## Introduction
66

7-
TALib is a Ruby binding for [TA-Lib](https://ta-lib.org/) (Technical Analysis Library) using FFI (Foreign Function Interface). It provides a comprehensive set of functions for technical analysis of financial market data.
7+
TALibFFI is a Ruby binding for [TA-Lib](https://ta-lib.org/) (Technical Analysis Library) using FFI (Foreign Function Interface). It provides a comprehensive set of functions for technical analysis of financial market data.
88

99
## Requirements
1010

@@ -57,13 +57,13 @@ Or install it directly:
5757
## Usage
5858

5959
```ruby
60-
require 'ta_lib'
60+
require 'ta_lib_ffi'
6161

6262
# Initialize data
6363
prices = [10.0, 11.0, 12.0, 11.0, 10.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0]
6464

6565
# Calculate SMA
66-
puts TALib.sma(prices, time_period: 3)
66+
puts TALibFFI.sma(prices, time_period: 3)
6767
# => [11.0, 11.333333333333334, 11.0, 10.0, 9.0, 8.0, 7.0, 6.0, 5.0]
6868
```
6969

lib/ta_lib.rb renamed to lib/ta_lib_ffi.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,22 @@
44
require "fiddle/import"
55

66
# Ruby FFI wrapper for TA-Lib (Technical Analysis Library)
7-
module TALib
8-
VERSION = "0.1.0"
7+
module TALibFFI
8+
VERSION = "0.2.0"
9+
10+
if defined?(Zeitwerk)
11+
# Custom inflector for handling special case module names like TALibFFI
12+
class Inflector < Zeitwerk::GemInflector
13+
def camelize(basename, _abspath)
14+
case basename
15+
when "ta_lib_ffi"
16+
"TALibFFI"
17+
else
18+
super
19+
end
20+
end
21+
end
22+
end
923

1024
extend Fiddle::Importer
1125

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
require "ta_lib"
3+
require "ta_lib_ffi"
44

55
RSpec.configure do |config|
66
# Enable flags like --only-failures and --next-failure
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require "spec_helper"
44

5-
RSpec.describe TALib do
5+
RSpec.describe TALibFFI do
66
shared_examples "ta_lib_input_validation" do |method_name|
77
context "when input is invalid" do
88
it "raises error for empty array" do
@@ -24,7 +24,7 @@
2424

2525
describe "Version and Initialization" do
2626
it "has a version number" do
27-
expect(described_class::VERSION).to eq("0.1.0")
27+
expect(described_class::VERSION).to eq("0.2.0")
2828
end
2929

3030
it "returns a string for TA-Lib version", skip: "Not implemented under Windows" do

ta_lib_ffi.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# frozen_string_literal: true
22

3-
require_relative "lib/ta_lib"
3+
require_relative "lib/ta_lib_ffi"
44

55
Gem::Specification.new do |spec|
66
spec.name = "ta_lib_ffi"
7-
spec.version = TALib::VERSION
7+
spec.version = TALibFFI::VERSION
88
spec.authors = ["Victor Yang"]
99
spec.email = ["victor@rt4u.bid"]
1010
spec.summary = "Ruby FFI bindings for TA-Lib (Technical Analysis Library)"

0 commit comments

Comments
 (0)