story_branch-graphql 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2dec1d8b47cbd3a1659f00f235fef257c345a07873c88e9c197e1baa765e8d40
4
- data.tar.gz: 43213c4ddc5d74f64dda6533a5eb71f3a3e58c25f39516e688a2c28fca63489d
3
+ metadata.gz: f2d1763ada0abfd2bc9218d06040e0f9833b8419a6b42000eb688e467408fd7c
4
+ data.tar.gz: 2acd7d89b26bb5f8959e03656725e58667c117796552bc240855b1007e60b2dc
5
5
  SHA512:
6
- metadata.gz: 7db5f8b780a36d897f230024270db5c45d19287ba242db6dd6f7eb8ce1d58e36843ff534dfb1d6945743a5deba975512d3d46a26a3bedfcc7ee39c30993e2427
7
- data.tar.gz: ae8cae4590d3335f9d4d0a04ac503f0073c5777742a48cefe1e56f4dffc0ae263505846a768c5fe7eaae390094af295f43115eb40a135b813d2abd9703379f67
6
+ metadata.gz: d6abf7dd3c3d3075474e38a37ea8dd36773aca0d5002e0ccc930721f806df373c4f72d316f1c6a7bf2c0cf03374254509c2ce8b619da0bc13c638d7b5b853cce
7
+ data.tar.gz: 9266e43a940ee32cd819ab50837be703916ad287333bd2a4709c1b0582c12327170f4f5ca9de5394eaa98ad0294a15bbb0f4c878ecc624a4a0c2ae2a5f48bf33
@@ -0,0 +1,13 @@
1
+ name: StandardRB
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v1
10
+ - name: StandardRB Linter
11
+ uses: andrewmcodes/standardrb-action@v1.0.0
12
+ env:
13
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,7 @@
1
+ {
2
+ "ruby.lint": {
3
+ "standard": {
4
+ "useBundler": true,
5
+ }
6
+ }
7
+ }
data/Rakefile CHANGED
@@ -7,4 +7,4 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList["test/**/*_test.rb"]
8
8
  end
9
9
 
10
- task :default => :test
10
+ task default: :test
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'httparty'
4
- require_relative 'response'
3
+ require "httparty"
4
+ require_relative "response"
5
5
 
6
6
  module StoryBranch
7
7
  module Graphql
@@ -13,12 +13,12 @@ module StoryBranch
13
13
  @auth = api_key
14
14
  end
15
15
 
16
- def get(graphql_query:, endpoint: 'graphql')
16
+ def get(graphql_query:, endpoint: "graphql")
17
17
  body_json = query_params_json(graphql_query)
18
18
 
19
19
  gql_response = HTTParty.post(graphql_endpoint(endpoint), headers: headers, body: body_json)
20
20
  response = StoryBranch::Graphql::Response.new(response: gql_response)
21
- raise GraphqlClientError, response.full_error_messages unless response.success?
21
+ raise Error, response.full_error_messages unless response.success?
22
22
 
23
23
  response
24
24
  end
@@ -32,12 +32,12 @@ module StoryBranch
32
32
  def headers
33
33
  {
34
34
  Authorization: @auth,
35
- 'Content-Type': 'application/json'
35
+ "Content-Type": "application/json"
36
36
  }
37
37
  end
38
38
 
39
39
  def query_params_json(graphql_query)
40
- { query: graphql_query }.to_json
40
+ {query: graphql_query}.to_json
41
41
  end
42
42
  end
43
43
  end
@@ -9,7 +9,7 @@ module StoryBranch
9
9
  end
10
10
 
11
11
  def data
12
- @data ||= @response.parsed_response['data']
12
+ @data ||= @response.parsed_response["data"]
13
13
  end
14
14
 
15
15
  def success?
@@ -20,10 +20,10 @@ module StoryBranch
20
20
  return @errors if @errors
21
21
 
22
22
  @errors = if @response.success?
23
- @response.parsed_response['errors']
24
- else
25
- [@response.response, @response.parsed_response]
26
- end
23
+ @response.parsed_response["errors"]
24
+ else
25
+ [@response.response, @response.parsed_response]
26
+ end
27
27
  end
28
28
 
29
29
  def full_error_messages
@@ -1,5 +1,5 @@
1
1
  module StoryBranch
2
2
  module Graphql
3
- VERSION = '0.0.1'
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'graphql/version'
4
- require_relative 'graphql/client'
3
+ require_relative "graphql/version"
4
+ require_relative "graphql/client"
5
5
 
6
6
  # Module initial definition
7
7
  module StoryBranch
@@ -1,39 +1,39 @@
1
- require_relative 'lib/story_branch/graphql/version'
1
+ require_relative "lib/story_branch/graphql/version"
2
2
 
3
3
  Gem::Specification.new do |spec|
4
- spec.name = 'story_branch-graphql'
5
- spec.version = StoryBranch::Graphql::VERSION
6
- spec.authors = ["Rui Baltazar"]
7
- spec.email = ["rui.p.baltazar@gmail.com"]
4
+ spec.name = "story_branch-graphql"
5
+ spec.version = StoryBranch::Graphql::VERSION
6
+ spec.authors = ["Rui Baltazar"]
7
+ spec.email = ["rui.p.baltazar@gmail.com"]
8
8
 
9
- spec.summary = 'Very simple GraphQL client'
10
- spec.description = <<~DESCRIPTION
9
+ spec.summary = "Very simple GraphQL client"
10
+ spec.description = <<~DESCRIPTION
11
11
  This simple gem allows you to make GraphQL requests and parses the response
12
12
  into a simple structure with helper methods to validate if it's a successful
13
13
  response or not
14
14
  DESCRIPTION
15
- spec.homepage = 'https://github.com/story-branch/sb_graphql_client'
16
- spec.license = 'MIT'
15
+ spec.homepage = "https://github.com/story-branch/sb_graphql_client"
16
+ spec.license = "MIT"
17
17
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
18
18
 
19
19
  spec.metadata = {
20
- 'bug_tracker_uri' => 'https://github.com/story-branch/sb_graphql_client/issues',
21
- 'changelog_uri' => 'https://github.com/story-branch/sb_graphql_client/blob/master/Changelog.md',
22
- 'documentation_uri' => 'https://github.com/story-branch/sb_graphql_client/blob/master/README.md',
23
- 'source_code_uri' => 'https://github.com/story-branch/sb_graphql_client',
24
- 'homepage_uri' => spec.homepage
20
+ "bug_tracker_uri" => "https://github.com/story-branch/sb_graphql_client/issues",
21
+ "changelog_uri" => "https://github.com/story-branch/sb_graphql_client/blob/master/Changelog.md",
22
+ "documentation_uri" => "https://github.com/story-branch/sb_graphql_client/blob/master/README.md",
23
+ "source_code_uri" => "https://github.com/story-branch/sb_graphql_client",
24
+ "homepage_uri" => spec.homepage
25
25
  }
26
26
 
27
27
  # Specify which files should be added to the gem when it is released.
28
28
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
29
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
30
30
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
31
31
  end
32
- spec.bindir = "exe"
33
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.bindir = "exe"
33
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ["lib"]
35
35
 
36
- spec.add_runtime_dependency 'httparty', '>0'
36
+ spec.add_runtime_dependency "httparty", ">0"
37
37
 
38
- spec.add_development_dependency 'standard', '~> 1.15'
38
+ spec.add_development_dependency "standard", "~> 1.15"
39
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: story_branch-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rui Baltazar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-10 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -48,8 +48,10 @@ executables: []
48
48
  extensions: []
49
49
  extra_rdoc_files: []
50
50
  files:
51
+ - ".github/workflows/standard.yml"
51
52
  - ".gitignore"
52
53
  - ".travis.yml"
54
+ - ".vscode/settings.json"
53
55
  - CODE_OF_CONDUCT.md
54
56
  - Gemfile
55
57
  - LICENSE