Skip to content

Commit

Permalink
Bump version to 1.1.0, update dependencies and interface to work with…
Browse files Browse the repository at this point in the history
… ERIC 39
  • Loading branch information
mpm committed Feb 19, 2024
1 parent 799993c commit 60ffaed
Show file tree
Hide file tree
Showing 13 changed files with 399 additions and 237 deletions.
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.3.0
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0]

Eric now requires a call to an initialization function. This happens
when the gem is required. However, this is possibly not thread safe
(no research was done on this).

In a single thread context, the gem should be backwards compatible.

Names of the error codes (see `Liberic::SDK::Fehlercodes`) have been
updated according to the constant names used in `eric_fehlercodes.h`
from the ERiC sources from ERIC 39.

So technically this update is not 100% backwards compatible. However, I
find a bump to 2.0.0 excessive for this release.

### Added

- Updated documentation and added a changelog.
- Added `Liberic::SDK::hole_zertifikat_eigenschaften`
- Added `Liberic::SDK::initialisiere` and `Liberic::SDK::beende`

### Changed

- Updated dependencies of this gem. Since it has been a couple of years
since the last update, minimum required versions haven't been tested.
The gem probably also works with Ruby 2.x and older versions of ffi
and nokogiri.
- Updated API for ERIC 39 (2023).
image that will render properly (although in English for all languages)

## [1.0.2] - Prior 2024

This gem was originally developed for a company that became later
wundertax. A [fork of the gem](https://github.com/wundertax/liberic-ruby)
was maintained by them for a while but has been archived in 2019.

Development of [the original version](https://github.com/mpm/liberic-ruby) of
this gem (where this changelog belongs to) was picked up by me in 2024
for a different project.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
source 'https://rubygems.org'

ruby '3.3.0'

# Specify your gem's dependencies in liberic.gemspec
gemspec
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Or install it yourself (not possible yet) as:
$ gem install liberic

The ERiC library files are not distributed with this gem. They must be
obtained from the [ELSTER Downloads Page](https://www.elster.de/ssl/secure/eric.php). (Requires your personal credentials which have to be requested from ELSTER).
obtained from the [ELSTER Downloads Page](https://www.elster.de/elsterweb/entwickler/infoseite/eric). (Requires your personal credentials which have to be requested from ELSTER).

Follow the installation instructions from the ERiC documentation.

Expand All @@ -40,16 +40,20 @@ include/
lib/
```

Currently, the environment variable `ERIC_HOME_27` needs to be set to this
Currently, the environment variable `ERIC_HOME_39` needs to be set to this
folder or the gem will not find the library files.

For example:

```sh
$ export ERIC_HOME_27=/opt/ERiC-27.3.2.0/Linux-x86_64
$ export ERIC_HOME_39=/opt/ERiC-39.3.2.0/Linux-x86_64
```

### Additional steps on OS X

The following OS X specific information dates back to the first version of this
library (from 2016). Might be outdated or incorrect by now.

On *Mac OS X* you need to process the libraries to fix the interal paths
(credits to @deviantbits):

Expand Down
2 changes: 2 additions & 0 deletions lib/liberic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
require 'liberic/config'

module Liberic
SDK::API::initialisiere(nil, nil)

check_eric_version!

def config
Expand Down
2 changes: 1 addition & 1 deletion lib/liberic/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def library_path
File.expand_path("libericapi.#{suffix}", ERIC_LIB_FOLDER)
end

ERIC_HOME = ENV['ERIC_HOME_27'] || raise(InitializationError.new('ERIC_HOME_27 environment variable not found (set it to the path to the ERiC libraries)'))
ERIC_HOME = ENV['ERIC_HOME_39'] || raise(InitializationError.new('ERIC_HOME_39 environment variable not found (set it to the path to the ERiC libraries)'))
ERIC_LIB_FOLDER = File.expand_path('lib', ERIC_HOME)

def check_eric_version!
Expand Down
2 changes: 1 addition & 1 deletion lib/liberic/helpers/invocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Error < StandardError
extend self

def raise_on_error(value)
return value if value == SDK::Fehlercodes::OK
return value if value == SDK::Fehlercodes::ERIC_OK
raise Error.new(SDK::Fehlercodes::CODES[value])
end

Expand Down
1 change: 1 addition & 0 deletions lib/liberic/response/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Version
def initialize(response_xml)
@response_xml = response_xml
@response_dom = Nokogiri::XML(@response_xml)

@libs = @response_dom.xpath('//version:Bibliothek', version: VERSION_NS).map do |lib|
fields = Hash[
{file: 'Name',
Expand Down
Loading

0 comments on commit 60ffaed

Please sign in to comment.