fog-xml 0.1.3 → 0.1.4

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
- SHA1:
3
- metadata.gz: 4eeb054cf660ff82dc4d8804584f11aa4a597296
4
- data.tar.gz: a7afd307ab320a7c5e8f3dd6b67d93058c92ffdc
2
+ SHA256:
3
+ metadata.gz: f20443f996f68c6657e65d1997355153ff80094d68fbe227a52e43298f6b216a
4
+ data.tar.gz: 0f1234f7218d87805b644e4c8797b0f11209217c048e61669d838057c0b64b9e
5
5
  SHA512:
6
- metadata.gz: f9bd21121d9d15926482f89074969475e26da8734aadb50de59529b4a14e02fff64c90947e81f5aecba98a9220721b9789494569b1e2166cd0cb3abf0b124205
7
- data.tar.gz: 1fb2e1b9553ae269ab297570379d4c18b9faa1bb4bd40fad5542ea26e8cbf36e251caf67798c3c49c307ce6261ae09748b336c42c3ca4a2562bb4688c17b4599
6
+ metadata.gz: c3965c992d6845bd68a637c825fd3133fb80eb23b7956bbd4b81ecb56f24343f62815c0ca13ce5b4168e40e102a636df1bd80374e32e413e950694e423e57b61
7
+ data.tar.gz: 5f6e0f9b03ffeb84212d085148d5b776c1fe7613d61f44dc99129f4707b74c3eb46dc4baaf5476f35d4d7cd941a56b0425f103d119a21750b9ec6765cf8c85a5
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "daily"
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "daily"
@@ -0,0 +1,34 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.5', '2.6', '2.7', '3.0', 'head']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2.3.4
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
+ - name: Install dependencies
32
+ run: bundle install
33
+ - name: Run tests
34
+ run: bundle exec rake
@@ -0,0 +1,23 @@
1
+ name: Mark stale issues and pull requests
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "30 1 * * *"
6
+
7
+ jobs:
8
+ stale:
9
+
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/stale@v4
14
+ with:
15
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
16
+ days-before-stale: 60
17
+ days-before-close: 7
18
+ exempt-issue-labels: 'pinned,security'
19
+ exempt-pr-labels: 'pinned,security'
20
+ stale-issue-message: 'This issue has been marked inactive and will be closed if no further activity occurs.'
21
+ stale-pr-message: 'This pr has been marked inactive and will be closed if no further activity occurs.'
22
+ stale-issue-label: 'no-issue-activity'
23
+ stale-pr-label: 'no-pr-activity'
data/fog-xml.gemspec CHANGED
@@ -22,22 +22,13 @@ Gem::Specification.new do |spec|
22
22
  spec.test_files = spec.files.grep(/^(test|spec|features)\//)
23
23
  spec.require_paths = %w(lib)
24
24
 
25
+ spec.required_ruby_version = '>= 2.0.0'
26
+
25
27
  spec.add_dependency "fog-core"
26
- case RUBY_VERSION
27
- when /^(1\.8.*|1\.9\.[012])$/
28
- spec.add_dependency "nokogiri", ">= 1.5.11", "< 1.6.2"
29
- spec.add_development_dependency "rake", "< 11.0.0"
30
- when /^(1\.9\.([^012]|\d.+)|2\.0.*)$/
31
- spec.add_dependency "nokogiri", ">= 1.5.11", "< 1.7.0"
32
- spec.add_development_dependency "rake"
33
- else
34
- spec.add_dependency "nokogiri", ">= 1.5.11", "< 2.0.0"
35
- spec.add_development_dependency "rake"
36
- end
28
+ spec.add_dependency "nokogiri", ">= 1.5.11", "< 2.0.0" #pinned for 2.0 support
29
+ spec.add_development_dependency "rake"
37
30
  spec.add_development_dependency "minitest"
38
31
  spec.add_development_dependency "turn"
39
32
  spec.add_development_dependency "pry"
40
- spec.add_development_dependency "coveralls" if RUBY_VERSION.to_f >= 1.9
41
- spec.add_development_dependency "term-ansicolor", "< 1.4.0" if RUBY_VERSION.start_with? "1.9."
42
- spec.add_development_dependency "tins", "< 1.7.0" if RUBY_VERSION.start_with? "1.9."
33
+ spec.add_development_dependency "coveralls"
43
34
  end
@@ -0,0 +1,26 @@
1
+ module Fog
2
+ module XML
3
+ class Response
4
+ def initialize(parser)
5
+ @parser = parser
6
+ @data_stream = Nokogiri::XML::SAX::PushParser.new(parser)
7
+ @response_string = ""
8
+ end
9
+
10
+ def call(chunk, _remaining, _total)
11
+ @response_string << chunk if ENV["DEBUG_RESPONSE"]
12
+ @data_stream << chunk
13
+ end
14
+
15
+ def rewind
16
+ @parser.reset
17
+ @response_string = ""
18
+ end
19
+
20
+ def finish
21
+ Fog::Logger.debug "\n#{@response_string}" if ENV["DEBUG_RESPONSE"]
22
+ @data_stream.finish
23
+ end
24
+ end
25
+ end
26
+ end
@@ -23,20 +23,13 @@ module Fog
23
23
  def request(parser, params)
24
24
  reset unless @persistent
25
25
 
26
- # Prepare the SAX parser
27
- data_stream = Nokogiri::XML::SAX::PushParser.new(parser)
28
- response_string = ""
29
- params[:response_block] = lambda do |chunk, _remaining, _total|
30
- response_string << chunk if ENV["DEBUG_RESPONSE"]
31
- data_stream << chunk
32
- end
26
+ params[:response_block] = ::Fog::XML::Response.new(parser)
33
27
 
34
28
  # Make request which read chunks into parser
35
29
  response = @excon.request(params)
36
- Fog::Logger.debug "\n#{response_string}" if ENV["DEBUG_RESPONSE"]
37
30
 
38
31
  # Cease parsing and override response.body with parsed data
39
- data_stream.finish
32
+ params[:response_block].finish
40
33
  response.body = parser.response
41
34
  response
42
35
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Xml
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
data/lib/fog/xml.rb CHANGED
@@ -8,6 +8,7 @@ module Fog
8
8
  module XML
9
9
  autoload :SAXParserConnection, File.expand_path("../xml/sax_parser_connection", __FILE__)
10
10
  autoload :Connection, File.expand_path("../xml/connection", __FILE__)
11
+ autoload :Response, File.expand_path("../xml/response", __FILE__)
11
12
  end
12
13
 
13
14
  module Parsers
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wesley Beary (geemus)
8
8
  - Paul Thornthwaite (tokengeek)
9
9
  - The fog team
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-03-30 00:00:00.000000000 Z
13
+ date: 2021-10-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fog-core
@@ -126,11 +126,12 @@ executables: []
126
126
  extensions: []
127
127
  extra_rdoc_files: []
128
128
  files:
129
+ - ".github/dependabot.yml"
130
+ - ".github/workflows/ruby.yml"
131
+ - ".github/workflows/stale.yml"
129
132
  - ".gitignore"
130
133
  - ".rubocop.yml"
131
134
  - ".ruby-gemset"
132
- - ".ruby-version"
133
- - ".travis.yml"
134
135
  - CONTRIBUTING.md
135
136
  - CONTRIBUTORS.md
136
137
  - Gemfile
@@ -138,12 +139,12 @@ files:
138
139
  - README.md
139
140
  - Rakefile
140
141
  - fog-xml.gemspec
141
- - gemfiles/Gemfile.1.9.2-
142
142
  - gemfiles/Gemfile.1.9.3+
143
143
  - lib/fog/parsers/base.rb
144
144
  - lib/fog/to_hash_document.rb
145
145
  - lib/fog/xml.rb
146
146
  - lib/fog/xml/connection.rb
147
+ - lib/fog/xml/response.rb
147
148
  - lib/fog/xml/sax_parser_connection.rb
148
149
  - lib/fog/xml/version.rb
149
150
  - spec/fog/parsers/base_spec.rb
@@ -153,7 +154,7 @@ homepage: https://github.com/fog/fog-xml
153
154
  licenses:
154
155
  - MIT
155
156
  metadata: {}
156
- post_install_message:
157
+ post_install_message:
157
158
  rdoc_options: []
158
159
  require_paths:
159
160
  - lib
@@ -161,16 +162,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
162
  requirements:
162
163
  - - ">="
163
164
  - !ruby/object:Gem::Version
164
- version: '0'
165
+ version: 2.0.0
165
166
  required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  requirements:
167
168
  - - ">="
168
169
  - !ruby/object:Gem::Version
169
170
  version: '0'
170
171
  requirements: []
171
- rubyforge_project:
172
- rubygems_version: 2.6.11
173
- signing_key:
172
+ rubygems_version: 3.2.15
173
+ signing_key:
174
174
  specification_version: 4
175
175
  summary: XML parsing for fog providers
176
176
  test_files:
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.3.0
data/.travis.yml DELETED
@@ -1,19 +0,0 @@
1
- matrix:
2
- include:
3
- - rvm: 1.8.7
4
- gemfile: gemfiles/Gemfile.1.9.2-
5
- - rvm: 1.9.2
6
- gemfile: gemfiles/Gemfile.1.9.2-
7
- - rvm: 1.9.3
8
- gemfile: gemfiles/Gemfile.1.9.3+
9
- - rvm: 2.0.0
10
- gemfile: gemfiles/Gemfile.1.9.3+
11
- - rvm: 2.3.0
12
- gemfile: gemfiles/Gemfile.1.9.3+
13
- env: COVERAGE=true
14
- - rvm: ree
15
- gemfile: gemfiles/Gemfile.1.9.2-
16
- - rvm: jruby
17
- gemfile: gemfiles/Gemfile.1.9.3+
18
- before_install:
19
- - gem install bundler
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem 'mime-types', '< 2.0'
4
- gem 'nokogiri', '< 1.6'
5
- gem 'rest-client', '~> 1.6.8'
6
- gem 'fog-core'
7
-
8
- gemspec :path => '../'