Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return parameters has been declared as table, default kw in declare block, encoding utf8 #27

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: ruby

rvm:
- 1.9.3
- 2.2.4
- 2.3.1
- 2.4.1
8 changes: 0 additions & 8 deletions CHANGELOG.markdown

This file was deleted.

16 changes: 11 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ source "http://rubygems.org"

gem "pg"
gem "treetop", "~> 1.4.14"
gem "test-unit"
gem "rake", :require => false
gem "rspec", "~> 2.8.0", :require => false
gem "activerecord", "~> 4.2.6", :require => false
gem "simplecov", "~> 0.6.1", :require => false

group :test, :development do
gem "rake", :require => false
end

group :test do
gem "test-unit"
gem "rspec", "~> 2.8.0", :require => false
gem "activerecord", "~> 5.1.4", :require => false
gem "simplecov", "~> 0.15.1",:require => false
end
51 changes: 27 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
GEM
remote: http://rubygems.org/
specs:
activemodel (4.2.6)
activesupport (= 4.2.6)
builder (~> 3.1)
activerecord (4.2.6)
activemodel (= 4.2.6)
activesupport (= 4.2.6)
arel (~> 6.0)
activesupport (4.2.6)
activemodel (5.1.4)
activesupport (= 5.1.4)
activerecord (5.1.4)
activemodel (= 5.1.4)
activesupport (= 5.1.4)
arel (~> 8.0)
activesupport (5.1.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.3)
builder (3.2.2)
arel (8.0.0)
concurrent-ruby (1.0.5)
diff-lcs (1.1.3)
i18n (0.7.0)
json (1.8.3)
minitest (5.8.3)
multi_json (1.3.6)
docile (1.1.5)
i18n (0.9.0)
concurrent-ruby (~> 1.0)
json (2.1.0)
minitest (5.10.3)
pg (0.18.4)
polyglot (0.3.5)
power_assert (0.2.6)
Expand All @@ -33,27 +32,31 @@ GEM
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
simplecov (0.6.4)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
simplecov (0.15.1)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
test-unit (3.1.5)
power_assert
thread_safe (0.3.5)
thread_safe (0.3.6)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (1.2.2)
tzinfo (1.2.3)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 4.2.6)
activerecord (~> 5.1.4)
pg
rake
rspec (~> 2.8.0)
simplecov (~> 0.6.1)
simplecov (~> 0.15.1)
test-unit
treetop (~> 1.4.14)

BUNDLED WITH
1.15.4
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ these events and generates prettified source code that is annotated with coverag

## Features

* Readable and easily-navigable reports (see [example] [5])
* Readable and easily-navigable reports (see [example](http://kputnam.github.com/piggly/reports/index.html))
* Language agnostic - write your tests in Ruby, Python, Java, SQL scripts etc
* Branch, block, and loop coverage analysis
* Instrumenting source-to-source compiler
Expand All @@ -39,8 +39,8 @@ these events and generates prettified source code that is annotated with coverag

## Requirements

* [Treetop] [2]: `gem install treetop`
* The [ruby-pg driver] [3]: `gem install pg`
* [Treetop](http://github.com/nathansobo/treetop): `gem install treetop`
* The [ruby-pg driver](http://bitbucket.org/ged/ruby-pg/): `gem install pg`
* The examples require ActiveRecord: `gem install activerecord`

## How to Install
Expand Down Expand Up @@ -154,10 +154,4 @@ Once the report is built you can open it in `piggly/reports/index.html`.

## Bugs & Issues

Please report any issues or feature requests on the [github tracker] [4].

[1]: http://github.com/relevance/rcov/
[2]: http://github.com/nathansobo/treetop
[3]: http://bitbucket.org/ged/ruby-pg/
[4]: http://github.com/kputnam/piggly/issues
[5]: http://kputnam.github.com/piggly/reports/index.html
Please report any issues or feature requests on the [github tracker](http://github.com/kputnam/piggly/issues).
8 changes: 8 additions & 0 deletions example/proc/issue_34.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE OR REPLACE FUNCTION issue_34(IN id integer DEFAULT NULL::integer)
RETURNS TABLE(tag integer, flag boolean, foo integer, bar boolean, baz boolean, quux numeric) AS
$BODY$
BEGIN
-- there be dragons here
END;
$BODY$
LANGUAGE plpgsql VOLATILE;
10 changes: 10 additions & 0 deletions example/proc/scramble.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ create or replace function scramble(varchar, out text, out char) as $$
execute scramble($1::text, $2, $3);
end
$$ language 'plpgsql' stable;

create or replace function ccramble(subject text)
returns table(scrambled text, first char)
as
$$
begin
scrambled := substring($1, 1, (random() * length($1))::integer);
first := substring($1, 1, 1);
end
$$ language 'plpgsql' stable;
1 change: 0 additions & 1 deletion lib/piggly/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Piggly
module Command
autoload :Base, "piggly/command/base"
autoload :Report, "piggly/command/report"
autoload :Test, "piggly/command/test"
autoload :Trace, "piggly/command/trace"
autoload :Untrace, "piggly/command/untrace"
end
Expand Down
29 changes: 8 additions & 21 deletions lib/piggly/command/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ def main(argv)
cmd, argv = command(argv)

if cmd.nil?
abort "usage: #{$0} {test|report|trace|untrace} --help"
abort "usage: #{$0} {report|trace|untrace} --help"
else
cmd.main(argv)
end
end

private

# @return [(Class, Array<String>)]
def command(argv)
return if argv.empty?
head, *tail = argv

case head.downcase
when "report"; [Report, tail]
when "test"; [Test, tail]
when "trace"; [Trace, tail]
when "untrace"; [Untrace, tail]
end
Expand Down Expand Up @@ -68,26 +65,16 @@ def filter(config, index)
else
head, _ = config.filters

start = index.procedures
start =
case head.first
when :+; []
when :-; index.procedures
end

config.filters.inject(start) do |s, pair|
case pair.first
when :+
puts "Selecting procedures"
o = s.select(&pair.last)
puts "Selected #{ o.count} procedures"
puts "Selected:"
o.each do |x| puts x.name end
puts "---"
o
when :-
puts "Rejecting procedures"
o = s.reject(&pair.last)
puts "Rejected #{s.count - o.count} procedures"
puts "Rejected:"
((o-s)|(s-o)).each do |x| puts x.name end
puts "---"
o
when :+; s | index.procedures.select(&pair.last)
when :-; s.reject(&pair.last)
end
end
end
Expand Down
157 changes: 0 additions & 157 deletions lib/piggly/command/test.rb

This file was deleted.

Loading