From 4646d4a073861860ee4233757ad674d988385cd8 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 9 Apr 2019 22:15:04 -0500 Subject: [PATCH] Gemify --- .rubocop.yml | 4 ++++ Gemfile | 8 +------- Makefile | 11 ++++++++--- README.md | 18 ++++++++++++++++-- dhall.gemspec | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 65 insertions(+), 12 deletions(-) create mode 100644 dhall.gemspec diff --git a/.rubocop.yml b/.rubocop.yml index f92e9ed..6940451 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,6 +16,10 @@ Metrics/ClassLength: Exclude: - test/* +Metrics/BlockLength: + Exclude: + - dhall.gemspec + Metrics/ModuleLength: Enabled: false diff --git a/Gemfile b/Gemfile index 0c054bb..be173b2 100644 --- a/Gemfile +++ b/Gemfile @@ -2,10 +2,4 @@ source "https://rubygems.org" -gem "abnf" -gem "cbor" -gem "citrus" -gem "promise.rb" -gem "simplecov", require: false, group: :test -gem "value_semantics" -gem "webmock" +gemspec diff --git a/Makefile b/Makefile index 5f8d5bd..15d3750 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,21 @@ .PHONY: lint test unit clean lib/dhall/parser.citrus: dhall-lang/standard/dhall.abnf scripts/generate_citrus_parser.rb lib/dhall/parser.rb - bundle exec ruby -E UTF-8 -Ilib scripts/generate_citrus_parser.rb < dhall-lang/standard/dhall.abnf > $@ + bundle exec ruby -E UTF-8 scripts/generate_citrus_parser.rb < dhall-lang/standard/dhall.abnf > $@ + +dhall.gem: lib/dhall/parser.citrus dhall.gemspec + $(RM) dhall.gem + gem build dhall.gemspec + mv dhall*.gem dhall.gem lint: rubocop -D test: lib/dhall/parser.citrus - bundle exec ruby -E UTF-8 -Ilib test/test_suite.rb + bundle exec ruby -E UTF-8 test/test_suite.rb unit: lib/dhall/parser.citrus - bundle exec ruby -E UTF-8 -Ilib test/test_suite.rb -n'/unit|simple|failure|import/' + bundle exec ruby -E UTF-8 test/test_suite.rb -n'/unit|simple|failure|import/' clean: $(RM) lib/dhall/parser.citrus diff --git a/README.md b/README.md index 86d2062..25a8c52 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,20 @@ This project follows semantic versioning, and every tagged version claims to adh For the purposes of considering what is a "breaking change" only the API as documented in this documentation is considered, regardless of any other exposed parts of the library. Anything not documented here may change at any time, but backward-incompatible changes to anything documented here will be accompanied by a major-version increment. +## Installation + +Add this line to your application's Gemfile: + + gem 'dhall' + +And then execute: + + bundle + +Or install it yourself as: + + gem install dhall + ## Load Expressions require "dhall" @@ -231,8 +245,8 @@ Many methods on Dhall expressions call `#as_dhall` on their arguments, so you ca To aid in converting your existing configurations or seralized data, there are included some experimental scripts: - json-to-dhall < path/to/config.json | dhall decode - yaml-to-dhall < path/to/config.yaml | dhall decode + bundle exec json-to-dhall < path/to/config.json | dhall decode + bundle exec yaml-to-dhall < path/to/config.yaml | dhall decode ## Getting Help diff --git a/dhall.gemspec b/dhall.gemspec new file mode 100644 index 0000000..17ae8ed --- /dev/null +++ b/dhall.gemspec @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +Gem::Specification.new do |spec| + spec.name = "dhall" + spec.version = "0.0.0-#{`git describe --always --dirty`}" + spec.authors = ["Stephen Paul Weber"] + spec.email = ["dev@singpolyma.net"] + spec.license = "GPL-3.0" + + spec.summary = "The non-repetitive alternative to YAML, in Ruby" + spec.description = "This is a Ruby implementation of the Dhall " \ + "configuration language. Dhall is a powerful, " \ + "but safe and non-Turing-complete configuration " \ + "language. For more information, see: " \ + "https://dhall-lang.org" + spec.homepage = "https://git.sr.ht/~singpolyma/dhall-ruby" + + spec.files = + ["lib/dhall/parser.citrus"] + + `git ls-files -z`.split("\x00".b).reject do |f| + f.start_with?(".", "test/", "scripts/") || + f == "Makefile" || f == "Gemfile" + end + spec.bindir = "bin" + spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_dependency "cbor", "~> 0.5.9.3" + spec.add_dependency "citrus", "~> 3.0" + spec.add_dependency "promise.rb", "~> 0.7.4" + spec.add_dependency "value_semantics", "~> 3.0" + + spec.add_development_dependency "abnf", "~> 0.0.1" + spec.add_development_dependency "simplecov", "~> 0.16.1" + spec.add_development_dependency "webmock", "~> 3.5" +end -- 2.38.5