~singpolyma/dhall-ruby

4646d4a073861860ee4233757ad674d988385cd8 — Stephen Paul Weber 4 years ago c8680bc
Gemify
5 files changed, 65 insertions(+), 12 deletions(-)

M .rubocop.yml
M Gemfile
M Makefile
M README.md
A dhall.gemspec
M .rubocop.yml => .rubocop.yml +4 -0
@@ 16,6 16,10 @@ Metrics/ClassLength:
  Exclude:
    - test/*

Metrics/BlockLength:
  Exclude:
    - dhall.gemspec

Metrics/ModuleLength:
  Enabled: false


M Gemfile => Gemfile +1 -7
@@ 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

M Makefile => Makefile +8 -3
@@ 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

M README.md => README.md +16 -2
@@ 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


A dhall.gemspec => dhall.gemspec +36 -0
@@ 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.singpolyma.net/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