Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ['3.1', '3.2', '3.3']

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Run tests
run: bundle exec rake spec

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- name: Run RuboCop
run: bundle exec rubocop
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@

.byebug_history
.DS_Store
.ruby-version
*.gem
Gemfile.lock
58 changes: 58 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
require:
- rubocop-rake
- rubocop-rspec

AllCops:
TargetRubyVersion: 3.1
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'bin/**/*'

# Style preferences
Style/StringLiterals:
EnforcedStyle: double_quotes

Style/Documentation:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

# Layout preferences
Layout/LineLength:
Max: 120
Exclude:
- 'spec/**/*'

# Metrics
Metrics/MethodLength:
Max: 15
Exclude:
- 'spec/**/*'

Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- '*.gemspec'

Metrics/AbcSize:
Max: 20
Exclude:
- 'spec/**/*'

# Naming
Naming/MethodParameterName:
AllowedNames:
- 'to'
- 'fx'

# RSpec specific
RSpec/ExampleLength:
Max: 10

RSpec/MultipleExpectations:
Max: 5

RSpec/NestedGroups:
Max: 4
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.6
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ sudo: false
language: ruby
cache: bundler
rvm:
- 2.6.3
before_install: gem install bundler -v 1.17.2
- 3.3.6
- 3.2.6
- 3.1.6
before_install: gem install bundler
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed
- Updated Faraday dependency from ~> 1.4 to ~> 2.0
- Updated Hashie dependency from ~> 4.1 to ~> 5.0
- Updated Bundler requirement from ~> 2.2 to >= 2.2
- Updated Travis CI to test against Ruby 3.1, 3.2, and 3.3
- Removed Bundler version lock in Travis CI

### Added
- Added GitHub Actions CI workflow
- Added RuboCop and related plugins (rubocop-rake, rubocop-rspec) as development dependencies
- Added .rubocop.yml configuration file
- Added .ruby-version file (3.3.6) to repository
- Added CHANGELOG.md

### Fixed
- Removed duplicate `private` keyword in lib/alphavantage/validations.rb

## [1.2.0] - (Date from git history)

### Added
- Intraday extended history support
- API key validation (raises error on missing API key)

### Changed
- Updated API error handling

### Fixed
- Fixed bin/console script

## [1.1.0] - (Date from git history)

### Added
- Support for technical indicators including:
- VWAP, BOP, TRANGE, AD, OBV
- SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3
- RSI, MOM, CMO, ROC, ROCR, TRIX, MIDPOINT
- And many more indicators

### Changed
- Refactored validations
- Trimmed spec fixtures

## [1.0.2] - (Date from git history)

### Changed
- Initial public release with core functionality

[Unreleased]: https://github.com/codespore/alphavantage_ruby/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/codespore/alphavantage_ruby/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/codespore/alphavantage_ruby/compare/v1.0.2...v1.1.0
[1.0.2]: https://github.com/codespore/alphavantage_ruby/releases/tag/v1.0.2
9 changes: 6 additions & 3 deletions alphavantage.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "faraday", "~> 1.4"
spec.add_dependency "hashie", "~> 4.1"
spec.add_dependency "faraday", "~> 2.0"
spec.add_dependency "hashie", "~> 5.0"

spec.add_development_dependency "bundler", "~> 2.2"
spec.add_development_dependency "bundler", ">= 2.2"
spec.add_development_dependency "rake", ">= 12.3.3"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "webmock"
spec.add_development_dependency "byebug"
spec.add_development_dependency "rubocop", "~> 1.60"
spec.add_development_dependency "rubocop-rake", "~> 0.6"
spec.add_development_dependency "rubocop-rspec", "~> 2.26"
end
16 changes: 16 additions & 0 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rspec' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rspec-core", "rspec")
2 changes: 0 additions & 2 deletions lib/alphavantage/validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ def is_integer?(str)
Integer(str) rescue false
end

private

def validate_from_collection(value:, collection:, type:)
return value if collection.include?(value.to_sym)

Expand Down