summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Audet2015-06-25 08:46:37 -0400
committerJeremy Audet2015-06-25 08:46:37 -0400
commitc0216250d36a144950c019c583ab6f0fd223500a (patch)
treec801a8686dbaf5c9589e854be77f4a6790a59dad
downloadaur-c0216250d36a144950c019c583ab6f0fd223500a.tar.gz
Initial commit (version 3.7.0)
-rw-r--r--.SRCINFO18
-rw-r--r--LICENSE20
-rw-r--r--PKGBUILD37
-rwxr-xr-xtest.rb15
4 files changed, 90 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f72fc4664e9f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = ruby-ruby_parser
+ pkgdesc = Ruby parser written in pure ruby.
+ pkgver = 3.7.0
+ pkgrel = 1
+ url = https://github.com/seattlerb/ruby_parser
+ arch = any
+ license = MIT
+ makedepends = rubygems
+ depends = ruby-sexp_processor
+ noextract = ruby_parser-3.7.0.gem
+ options = !emptydirs
+ source = LICENSE
+ source = http://gems.rubyforge.org/gems/ruby_parser-3.7.0.gem
+ sha256sums = 46870842926785c757eb95c36c7c77235871c7fd2310e93ef72b681ac9ccfd53
+ sha256sums = 95d2036b753f399706e3478c1033a81520b27ccf8702e8de076cdfcaff5f1de4
+
+pkgname = ruby-ruby_parser
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..35f70419dc36
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) Ryan Davis, seattle.rb
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..86244aed7f02
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Jeremy "Ichimonji10" Audet <ichimonji10 at gmail dot com>
+# Contributor: Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# namcap warns that ruby-sexp_processor is an unnecessary dependency. This is
+# untrue.
+
+pkgname=ruby-ruby_parser
+_pkgname=ruby_parser
+pkgver=3.7.0
+pkgrel=1
+pkgdesc='Ruby parser written in pure ruby.'
+arch=(any)
+url='https://github.com/seattlerb/ruby_parser'
+license=(MIT)
+depends=(ruby-sexp_processor)
+makedepends=(rubygems)
+options=(!emptydirs)
+source=(LICENSE "http://gems.rubyforge.org/gems/${_pkgname}-${pkgver}.gem")
+noextract=("${_pkgname}-${pkgver}.gem")
+sha256sums=('46870842926785c757eb95c36c7c77235871c7fd2310e93ef72b681ac9ccfd53'
+ '95d2036b753f399706e3478c1033a81520b27ccf8702e8de076cdfcaff5f1de4')
+
+package() {
+ # install gem
+ HOME=/tmp gem install \
+ --no-user-install \
+ --ignore-dependencies \
+ --install-dir "${pkgdir}$(ruby -rubygems -e 'puts Gem.default_dir')" \
+ --bindir "${pkgdir}/usr/bin" \
+ "${srcdir}/${_pkgname}-${pkgver}.gem"
+
+ # install license
+ install -Dm 644 "${srcdir}/LICENSE" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/test.rb b/test.rb
new file mode 100755
index 000000000000..d63e5374639b
--- /dev/null
+++ b/test.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+
+require File.join('test', 'unit')
+require 'ruby_parser'
+
+# Check whether ruby_parser functions correctly.
+class TestRubyParser < Test::Unit::TestCase
+ # Run a simple command taken from the ruby_parser README.
+ def test_from_readme
+ assert_equal(
+ RubyParser.new.parse("1+1").to_s,
+ 's(:call, s(:lit, 1), :+, s(:lit, 1))'
+ )
+ end
+end