stepmod-utils 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d46a471013b96ac232688535ff7384c7044d166987ae53dd2e1fefd0009a73fb
4
+ data.tar.gz: 39a320ba1cd3b7d05fcb34f17077d12ac036b1de3ed0db730af214f0127ceea0
5
+ SHA512:
6
+ metadata.gz: 723e010d940375916081ed59592c413219f5b0fce10df237bf6504a8be5a40c7405a8b057ec8fe692f2307fcddaecf763cb23dd1a152d1ed1a7e07087e0f49a0
7
+ data.tar.gz: ada92ea7ec12cbe80509a6f9d5a45d354211b9f9aa5a5f18e5dc2e86de58569a63572d65937ccba26917931a7315c016fa4bdd8f660602d46085cb190b1cd61b
@@ -0,0 +1,39 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: macos
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/ubuntu.yml
11
+ - .github/workflows/windows.yml
12
+
13
+ jobs:
14
+ test-macos:
15
+ name: Test on Ruby ${{ matrix.ruby }} macOS
16
+ runs-on: macos-latest
17
+ continue-on-error: ${{ matrix.experimental }}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
26
+ steps:
27
+ - uses: actions/checkout@master
28
+ - name: Use Ruby
29
+ uses: actions/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby }}
32
+ architecture: 'x64'
33
+ - name: Update gems
34
+ run: |
35
+ sudo gem install bundler --force
36
+ bundle install --jobs 4 --retry 3
37
+ - name: Run specs
38
+ run: |
39
+ bundle exec rake
@@ -0,0 +1,41 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '*'
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-18.04
11
+ steps:
12
+ - uses: actions/checkout@v1
13
+ - name: Use Ruby
14
+ uses: actions/setup-ruby@v1
15
+ with:
16
+ ruby-version: '2.6'
17
+ architecture: 'x64'
18
+ - name: Update gems
19
+ run: |
20
+ gem install bundler
21
+ bundle install --jobs 4 --retry 3
22
+ - name: Update stepmod-utils.jar
23
+ run: |
24
+ rm -f bin/stepmod-utils.jar
25
+ rake bin/stepmod-utils.jar
26
+ - name: Run specs
27
+ run: |
28
+ bundle exec rake
29
+ - name: Publish to rubygems.org
30
+ env:
31
+ RUBYGEMS_API_KEY: ${{secrets.METANORMA_CI_RUBYGEMS_API_KEY}}
32
+ run: |
33
+ gem install gem-release
34
+ touch ~/.gem/credentials
35
+ cat > ~/.gem/credentials << EOF
36
+ ---
37
+ :rubygems_api_key: ${RUBYGEMS_API_KEY}
38
+ EOF
39
+ chmod 0600 ~/.gem/credentials
40
+ git status
41
+ gem release
@@ -0,0 +1,53 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: ubuntu
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ tags:
9
+ - '*'
10
+ pull_request:
11
+ paths-ignore:
12
+ - .github/workflows/macos.yml
13
+ - .github/workflows/windows.yml
14
+
15
+ jobs:
16
+ test-linux:
17
+ name: Test on Ruby ${{ matrix.ruby }} Ubuntu
18
+ runs-on: ubuntu-latest
19
+ continue-on-error: ${{ matrix.experimental }}
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ ruby: [ '2.6', '2.5', '2.4' ]
24
+ experimental: [false]
25
+ include:
26
+ - ruby: '2.7'
27
+ experimental: true
28
+ steps:
29
+ - uses: actions/checkout@master
30
+ - name: Use Ruby
31
+ uses: actions/setup-ruby@v1
32
+ with:
33
+ ruby-version: ${{ matrix.ruby }}
34
+ architecture: 'x64'
35
+ - name: Update gems
36
+ run: |
37
+ gem install bundler
38
+ bundle install --jobs 4 --retry 3
39
+ - name: Run specs
40
+ run: |
41
+ bundle exec rake
42
+ - name: Trigger dependent repositories
43
+ if: github.ref == 'refs/heads/master' && matrix.ruby == '2.6'
44
+ env:
45
+ GH_USERNAME: ${{ secrets.PAT_USERNAME }}
46
+ GH_ACCESS_TOKEN: ${{ secrets.PAT_TOKEN }}
47
+ run: |
48
+ curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
49
+ [[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
50
+ for repo in $DEPENDENT_REPOS
51
+ do
52
+ sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "{ \"ref\": \"${GITHUB_REF}\" }"
53
+ done
@@ -0,0 +1,41 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: windows
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/macos.yml
11
+ - .github/workflows/ubuntu.yml
12
+
13
+ jobs:
14
+ test-windows:
15
+ name: Test on Ruby ${{ matrix.ruby }} Windows
16
+ runs-on: windows-latest
17
+ continue-on-error: ${{ matrix.experimental }}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
26
+ steps:
27
+ - uses: actions/checkout@master
28
+ - name: Use Ruby
29
+ uses: actions/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby }}
32
+ architecture: 'x64'
33
+ - name: Update gems
34
+ shell: pwsh
35
+ run: |
36
+ gem install bundler
37
+ bundle config --local path vendor/bundle
38
+ bundle install --jobs 4 --retry 3
39
+ - name: Run specs
40
+ run: |
41
+ bundle exec rake
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at ronald.tse@ribose.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in stepmod-utils.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
@@ -0,0 +1,60 @@
1
+ = stepmod-utils Ruby gem
2
+
3
+ image:https://img.shields.io/gem/v/metanorma.svg["Gem Version", link="https://rubygems.org/gems/metanorma"]
4
+ image:https://github.com/metanorma/stepmod-utils/workflows/ubuntu/badge.svg["Ubuntu Build Status", link="https://github.com/metanorma/stepmod-utils/actions?query=workflow%3Aubuntu"]
5
+ image:https://github.com/metanorma/stepmod-utils/workflows/macos/badge.svg["OSX Build Status", link="https://github.com/metanorma/stepmod-utils/actions?query=workflow%3Amacos"]
6
+ image:https://github.com/metanorma/stepmod-utils/workflows/windows/badge.svg["Windows Build Status", link="https://github.com/metanorma/stepmod-utils/actions?query=workflow%3Awindows"]
7
+ image:https://codeclimate.com/github/metanorma/stepmod-utils/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/stepmod-utils"]
8
+ image:https://img.shields.io/github/issues-pr-raw/metanorma/stepmod-utils.svg["Pull Requests", link="https://github.com/metanorma/stepmod-utils/pulls"]
9
+ image:https://img.shields.io/github/commits-since/metanorma/stepmod-utils/latest.svg["Commits since latest",link="https://github.com/metanorma/stepmod-utils/releases"]
10
+
11
+ == Purpose
12
+
13
+ The stepmod-utils Ruby gem is a wrapper around the Java https://github.com/metanorma/stepmod-utils[stepmod-utils]
14
+ which converts NISO STS and ISOSTS into Metanorma XML and AsciiDoc files.
15
+
16
+ This gem is used to provide stepmod-utils.jar with mirrored version numbers, to allow
17
+ Ruby code to easily refer to the desired stepmod-utils version as dependencies.
18
+
19
+ == Installation
20
+
21
+ [source,ruby]
22
+ ----
23
+ gem install stepmod-utils
24
+ ----
25
+
26
+ Or include it in your gemspec.
27
+
28
+ == Usage
29
+
30
+ [source,ruby]
31
+ ----
32
+ require 'stepmod-utils'
33
+ Sts2mn.convert(input: 'test/sts.xml')
34
+ # => generates 'test/sts.adoc', in Metanorma AsciiDoc
35
+
36
+ Sts2mn.convert(input: 'test/sts.xml', output: 'another/path/mn.xml', format: 'xml')
37
+ # => generates 'another/path/mn.xml' in Metanorma XML
38
+
39
+ Sts2mn.convert(input: 'test/sts.xml', output: 'another/path/mn.adoc', format: 'adoc')
40
+ # => generates 'another/path/mn.adoc' in Metanorma AsciiDoc
41
+
42
+ Sts2mn.split_bibdata('test/sts.xml')
43
+ # => generates 'test/sts.rxl' (Relaton XML) and 'test/mn.adoc' (Metanorma AsciiDoc)
44
+ ----
45
+
46
+ == Updating the gem
47
+
48
+ Update `lib/stepmod-utils/version.rb` to the desired version of https://github.com/metanorma/stepmod-utils[stepmod-utils].
49
+
50
+ Run `rake` to download the `bin/stepmod-utils.jar` file:
51
+
52
+ [source,ruby]
53
+ ----
54
+ rm -f bin/stepmod-utils.jar
55
+ rake bin/stepmod-utils.jar
56
+ ----
57
+
58
+ Then release the gem with `rake release`.
59
+
60
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "stepmod/utils"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,8 @@
1
+ require "stepmod/utils/version"
2
+
3
+ module Stepmod
4
+ module Utils
5
+ class Error < StandardError; end
6
+ # Your code goes here...
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Stepmod
2
+ module Utils
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,36 @@
1
+ require_relative 'lib/stepmod/utils/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "stepmod-utils"
5
+ spec.version = Stepmod::Utils::VERSION
6
+ spec.authors = ["Ribose Inc."]
7
+ spec.email = ["open.source@ribose.com"]
8
+
9
+ spec.summary = "stepmod-utils converts NISO STS XML into Metanorma XML."
10
+ spec.description = <<~DESCRIPTION
11
+ stepmod-utils converts NISO STS XML into Metanorma XML.
12
+ This gem is a wrapper around stepmod-utils.jar available from
13
+ https://github.com/metanorma/stepmod-utils, with versions matching the JAR file.
14
+ DESCRIPTION
15
+
16
+ spec.homepage = "https://github.com/metanorma/stepmod-utils"
17
+ spec.license = "BSD-2-Clause"
18
+
19
+ spec.bindir = "bin"
20
+ spec.require_paths = ["lib"]
21
+ spec.files = `git ls-files`.split("\n")
22
+ spec.test_files = `git ls-files -- {spec}/*`.split("\n")
23
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
24
+
25
+ # Specify which files should be added to the gem when it is released.
26
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
28
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ spec.add_runtime_dependency "thor", "~> 1.0"
35
+ spec.add_runtime_dependency "reverse_adoc", "~> 0.2"
36
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stepmod-utils
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ribose Inc.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-07-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: reverse_adoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.2'
41
+ description: |
42
+ stepmod-utils converts NISO STS XML into Metanorma XML.
43
+ This gem is a wrapper around stepmod-utils.jar available from
44
+ https://github.com/metanorma/stepmod-utils, with versions matching the JAR file.
45
+ email:
46
+ - open.source@ribose.com
47
+ executables: []
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - ".github/workflows/macos.yml"
52
+ - ".github/workflows/release.yml"
53
+ - ".github/workflows/ubuntu.yml"
54
+ - ".github/workflows/windows.yml"
55
+ - ".gitignore"
56
+ - ".rspec"
57
+ - CODE_OF_CONDUCT.md
58
+ - Gemfile
59
+ - README.adoc
60
+ - Rakefile
61
+ - bin/console
62
+ - bin/setup
63
+ - lib/stepmod/utils.rb
64
+ - lib/stepmod/utils/version.rb
65
+ - stepmod-utils.gemspec
66
+ homepage: https://github.com/metanorma/stepmod-utils
67
+ licenses:
68
+ - BSD-2-Clause
69
+ metadata: {}
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 2.4.0
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubygems_version: 3.0.3
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: stepmod-utils converts NISO STS XML into Metanorma XML.
89
+ test_files: []