diff --git a/.dir-locals.el b/.dir-locals.el index 0cd7ee5..cafcbc6 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,5 +1,6 @@ ;;; Directory Local Variables -*- no-byte-compile: t -*- ;;; For more information see (info "(emacs) Directory Variables") -((nil . ((eval . (progn (add-to-list 'grep-find-ignored-directories "tmp") +((nil . ((eval . (progn (require 'grep) + (add-to-list 'grep-find-ignored-directories "tmp") (add-to-list 'grep-find-ignored-directories "doc")))))) diff --git a/.github/workflows/doc.yaml b/.github/workflows/doc.yaml new file mode 100644 index 0000000..65414e0 --- /dev/null +++ b/.github/workflows/doc.yaml @@ -0,0 +1,40 @@ +name: Build and deploy documentation to GitHub Pages +on: + push: + branches: [ "main" ] + pull_request: + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.4' + bundler-cache: true + + - name: Run RDoc + run: rdoc + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: doc + + deploy: + needs: build-and-deploy + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 + permissions: + id-token: write + pages: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} diff --git a/.rdoc_options b/.rdoc_options index c5c5134..e9e85cf 100644 --- a/.rdoc_options +++ b/.rdoc_options @@ -4,3 +4,4 @@ exclude: - bin - Rakefile - Gemfile + - vendor diff --git a/CHANGELOG.md b/CHANGELOG.md index 90e97e6..7cda3b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # Change log of Ruby GettextPO gem -## [Unreleased] +## Unreleased -## [0.1.0] - 2026-03-07 +- Add libgettextpo version constant. +- Add severities constants. + +## 0.1.0 - 2026-03-07 - Initial release diff --git a/ext/gettextpo/gettextpo.c b/ext/gettextpo/gettextpo.c index 8b1fc3e..9a0246d 100644 --- a/ext/gettextpo/gettextpo.c +++ b/ext/gettextpo/gettextpo.c @@ -17,29 +17,9 @@ #include "gettextpo.h" #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include VALUE rb_cMessage; VALUE rb_cMessageIterator; @@ -845,6 +825,14 @@ RUBY_FUNC_EXPORTED void Init_gettextpo (void) { VALUE rb_mGettextPO = rb_define_module ("GettextPO"); + rb_define_const (rb_mGettextPO, "LIBGETTEXTPO_VERSION", + INT2NUM (libgettextpo_version)); + rb_define_const (rb_mGettextPO, "SEVERITY_WARNING", + INT2NUM (PO_SEVERITY_WARNING)); + rb_define_const (rb_mGettextPO, "SEVERITY_ERROR", + INT2NUM (PO_SEVERITY_ERROR)); + rb_define_const (rb_mGettextPO, "SEVERITY_FATAL_ERROR", + INT2NUM (PO_SEVERITY_FATAL_ERROR)); rb_define_singleton_method (rb_mGettextPO, "header_entry_value", gettextpo_m_header_entry_value, 2); rb_define_singleton_method (rb_mGettextPO, "header_with_updated_entry_value", diff --git a/test/gettextpo_test.rb b/test/gettextpo_test.rb index e4edf0b..30f6c22 100644 --- a/test/gettextpo_test.rb +++ b/test/gettextpo_test.rb @@ -22,6 +22,8 @@ class GettextPOTest < Test::Unit::TestCase assert do ::GettextPO.const_defined?(:VERSION) end + + assert_compare 2944, '<=', GettextPO::LIBGETTEXTPO_VERSION end test "GettextPO::File.new" do