-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mattrayner/giusepped/grom-integration
Integrate Grom into the gem
- Loading branch information
Showing
25 changed files
with
1,402 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
*.gem | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ruby: | ||
config_file: .rubocop.yml | ||
|
||
fail_on_violations: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ sudo: false | |
language: ruby | ||
rvm: | ||
- 2.3.1 | ||
before_install: gem install bundler -v 1.13.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in parliament.gemspec | ||
# Specify your gem's dependencies in parliament-ruby.gemspec | ||
gemspec | ||
|
||
# Include coveralls for CI coverage reports | ||
gem 'coveralls', require: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'forwardable' | ||
|
||
module Parliament | ||
class Response | ||
include Enumerable | ||
extend Forwardable | ||
attr_reader :nodes | ||
def_delegators :@nodes, :size, :each, :select, :map, :select!, :map!, :count, :length | ||
|
||
def initialize(nodes) | ||
@nodes = nodes | ||
end | ||
|
||
def filter(*types) | ||
filtered_objects = Array.new(types.size) { [] } | ||
|
||
unless types.empty? | ||
@nodes.each do |node| | ||
type_index = types.index(node.type) | ||
filtered_objects[type_index] << node unless type_index.nil? | ||
end | ||
end | ||
|
||
filtered_objects.each do |objects| | ||
Parliament::Response.new(objects) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...equest/_get/returns_a_Net_HTTP_Object.yml → ...s_code_of_200_and_/returns_27_objects.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
100 changes: 100 additions & 0 deletions
100
...ament_Request/_get/it_returns_a_status_code_of_200_and_/returns_a_Parliament_Response.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.