shrine-storage-you_tube 0.3.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yaml +52 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +98 -0
  5. data/.travis.yml +31 -2
  6. data/Appraisals +36 -0
  7. data/Gemfile +5 -1
  8. data/Rakefile +5 -3
  9. data/bin/console +4 -3
  10. data/gemfiles/.bundle/config +2 -0
  11. data/gemfiles/shrine_2.0.1.gemfile +11 -0
  12. data/gemfiles/shrine_2.1.1.gemfile +11 -0
  13. data/gemfiles/shrine_2.10.0.gemfile +9 -0
  14. data/gemfiles/shrine_2.10.1.gemfile +11 -0
  15. data/gemfiles/shrine_2.11.0.gemfile +11 -0
  16. data/gemfiles/shrine_2.12.0.gemfile +11 -0
  17. data/gemfiles/shrine_2.13.0.gemfile +11 -0
  18. data/gemfiles/shrine_2.14.0.gemfile +11 -0
  19. data/gemfiles/shrine_2.15.0.gemfile +11 -0
  20. data/gemfiles/shrine_2.16.0.gemfile +11 -0
  21. data/gemfiles/shrine_2.17.1.gemfile +11 -0
  22. data/gemfiles/shrine_2.18.1.gemfile +11 -0
  23. data/gemfiles/shrine_2.19.3.gemfile +11 -0
  24. data/gemfiles/shrine_2.2.0.gemfile +11 -0
  25. data/gemfiles/shrine_2.3.1.gemfile +11 -0
  26. data/gemfiles/shrine_2.5.0.gemfile +11 -0
  27. data/gemfiles/shrine_2.6.1.gemfile +11 -0
  28. data/gemfiles/shrine_2.7.0.gemfile +11 -0
  29. data/gemfiles/shrine_2.8.0.gemfile +11 -0
  30. data/gemfiles/shrine_2.9.0.gemfile +11 -0
  31. data/gemfiles/shrine_3.0.0.gemfile +11 -0
  32. data/gemfiles/shrine_3.0.1.gemfile +11 -0
  33. data/gemfiles/shrine_3.1.0.gemfile +11 -0
  34. data/gemfiles/shrine_3.2.0.gemfile +11 -0
  35. data/gemfiles/shrine_3.2.1.gemfile +11 -0
  36. data/gemfiles/shrine_3.2.2.gemfile +11 -0
  37. data/gemfiles/shrine_3.3.0.gemfile +11 -0
  38. data/gemfiles/shrine_3.4.0.gemfile +11 -0
  39. data/gemfiles/shrine_3.5.0.gemfile +11 -0
  40. data/lib/shrine/storage/you_tube/version.rb +3 -1
  41. data/lib/shrine/storage/you_tube.rb +18 -9
  42. data/shrine-storage-you_tube.gemspec +18 -17
  43. metadata +73 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f5a6399574fbf281d2574ae9fff47630e8b81670
4
- data.tar.gz: ca6a34f45afbf6907e5bc8af4119dc1ac2e251e1
2
+ SHA256:
3
+ metadata.gz: 655474e7b81024cd948eed88e17edd872dbb8fe34ccbe601b671731a5a941f9f
4
+ data.tar.gz: 01c6d05f6cc520c584f4463d40d385bbb7b10cfb9ee4d79cbf42f44fc11c5dd3
5
5
  SHA512:
6
- metadata.gz: 766d9854adcb2e1027d5fa4f9419aa282bcf18525298dc498a91ef72054412eabd24175d3541b818cbdcafddd7f940f1d7eaa0e0be9b16b986cb1266a7ff2dd4
7
- data.tar.gz: 489d91d880e5901b14b376b717b92882d18f58c0f39c2d2cc3c80c10efd7a109130094ed6a2b68363a71cf49360197536da45d5e91e8105b31e5edaf2c56c868
6
+ metadata.gz: f914278242b9aeb581444b265e10ff79a6f2f7a0e273f0bffa599abbc0970088adf56a783061f3d0c49bf2edb93f76b6ecb49f3e182d6baac07a485fa907f316
7
+ data.tar.gz: bc9829eda30a4b72000027c37317059b79ee9b62782440b393c1c783465fcd747245ea6db467006cf78b53aa12ed667ee33d33ed70ca4e92b0fdbcfdbcee980c
@@ -0,0 +1,52 @@
1
+ name: Run Tests
2
+ on: [push]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ strategy:
7
+ matrix:
8
+ ruby_version:
9
+ - 2.7.5
10
+ - 3.0.5
11
+ - 3.1.4
12
+ - 3.2.2
13
+ shrine_version:
14
+ - 2.0.1
15
+ - 2.1.1
16
+ - 2.2.0
17
+ - 2.3.1
18
+ - 2.5.0
19
+ - 2.6.1
20
+ - 2.7.0
21
+ - 2.8.0
22
+ - 2.9.0
23
+ - 2.10.1
24
+ - 2.11.0
25
+ - 2.12.0
26
+ - 2.13.0
27
+ - 2.14.0
28
+ - 2.15.0
29
+ - 2.16.0
30
+ - 2.17.1
31
+ - 2.18.1
32
+ - 2.19.3
33
+ - 3.0.0
34
+ - 3.0.1
35
+ - 3.1.0
36
+ - 3.2.0
37
+ - 3.2.1
38
+ - 3.2.2
39
+ - 3.3.0
40
+ - 3.4.0
41
+ - 3.5.0
42
+
43
+ env:
44
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/shrine_${{ matrix.shrine_version }}.gemfile
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - uses: ruby/setup-ruby@v1
48
+ with:
49
+ ruby-version: ${{ matrix.ruby_version }}
50
+ bundler-cache: true
51
+ - run: bundle exec rake spec
52
+
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .env
11
+ gemfiles/*.lock
data/.rubocop.yml ADDED
@@ -0,0 +1,98 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.4
7
+ DisplayCopNames: true
8
+ DisplayStyleGuide: false
9
+ Exclude:
10
+ - 'gemfiles/*'
11
+
12
+ Layout/ClassStructure:
13
+ Enabled: true
14
+
15
+ Layout/EmptyLinesAroundArguments:
16
+ Enabled: false
17
+
18
+ Layout/MultilineArrayLineBreaks:
19
+ Enabled: true
20
+
21
+ Metrics/BlockLength:
22
+ ExcludedMethods:
23
+ - aasm
24
+ - class_methods
25
+ - configure
26
+ - included
27
+ Exclude:
28
+ - 'Guardfile'
29
+ - 'spec/**/*'
30
+ - 'util/*'
31
+ - 'lib/tasks/*'
32
+ - 'db/migrate/*'
33
+ - 'config/routes.rb'
34
+ - 'config/sitemap.rb'
35
+
36
+ Metrics/ClassLength:
37
+ Max: 200
38
+
39
+ Metrics/LineLength:
40
+ Enabled: false
41
+
42
+ # Prefer Metrics/AbcSize
43
+ Metrics/MethodLength:
44
+ Enabled: false
45
+
46
+ Metrics/ModuleLength:
47
+ Max: 200
48
+
49
+ Naming/UncommunicativeMethodParamName:
50
+ AllowedNames:
51
+ - io
52
+ - id
53
+ - to
54
+ - by
55
+ - on
56
+ - in
57
+ - at
58
+ - _
59
+
60
+ RSpec/ContextWording:
61
+ Prefixes:
62
+ - after
63
+ - when
64
+ - with
65
+ - without
66
+ - for
67
+ - as
68
+
69
+ RSpec/SharedContext:
70
+ Exclude:
71
+ - 'spec/acceptance/**'
72
+
73
+ Security/Open:
74
+ Severity: warning
75
+
76
+ Style/AsciiComments:
77
+ Enabled: false
78
+
79
+ Style/AutoResourceCleanup:
80
+ Enabled: true
81
+
82
+ Style/Documentation:
83
+ Enabled: false
84
+
85
+ Style/IpAddresses:
86
+ Enabled: true
87
+
88
+ Style/Lambda:
89
+ EnforcedStyle: literal
90
+
91
+ Style/NumericLiterals:
92
+ Enabled: false
93
+
94
+ Style/OptionHash:
95
+ Enabled: true
96
+
97
+ Style/Send:
98
+ Enabled: true
data/.travis.yml CHANGED
@@ -1,4 +1,33 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.3
4
- before_install: gem install bundler -v 1.10.6
3
+ - 2.4.6
4
+ - 2.5.5
5
+ - 2.6.3
6
+ gemfile:
7
+ - gemfiles/shrine_2.0.1.gemfile
8
+ - gemfiles/shrine_2.1.1.gemfile
9
+ - gemfiles/shrine_2.2.0.gemfile
10
+ - gemfiles/shrine_2.3.1.gemfile
11
+ - gemfiles/shrine_2.4.1.gemfile
12
+ - gemfiles/shrine_2.5.0.gemfile
13
+ - gemfiles/shrine_2.6.1.gemfile
14
+ - gemfiles/shrine_2.7.0.gemfile
15
+ - gemfiles/shrine_2.8.0.gemfile
16
+ - gemfiles/shrine_2.9.0.gemfile
17
+ - gemfiles/shrine_2.10.1.gemfile
18
+ - gemfiles/shrine_2.11.0.gemfile
19
+ - gemfiles/shrine_2.12.0.gemfile
20
+ - gemfiles/shrine_2.13.0.gemfile
21
+ - gemfiles/shrine_2.14.0.gemfile
22
+ - gemfiles/shrine_2.15.0.gemfile
23
+ - gemfiles/shrine_2.16.0.gemfile
24
+ - gemfiles/shrine_2.17.1.gemfile
25
+ - gemfiles/shrine_2.18.1.gemfile
26
+ - gemfiles/shrine_2.19.3.gemfile
27
+ - gemfiles/shrine_3.0.0.gemfile
28
+ matrix:
29
+ allow_failures:
30
+ - gemfile: gemfiles/shrine_2.4.1.gemfile
31
+ before_install:
32
+ - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
33
+ - gem install bundler -v '< 2'
data/Appraisals ADDED
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ %w[
4
+ 2.0.1
5
+ 2.1.1
6
+ 2.2.0
7
+ 2.3.1
8
+ 2.5.0
9
+ 2.6.1
10
+ 2.7.0
11
+ 2.8.0
12
+ 2.9.0
13
+ 2.10.1
14
+ 2.11.0
15
+ 2.12.0
16
+ 2.13.0
17
+ 2.14.0
18
+ 2.15.0
19
+ 2.16.0
20
+ 2.17.1
21
+ 2.18.1
22
+ 2.19.3
23
+ 3.0.0
24
+ 3.0.1
25
+ 3.1.0
26
+ 3.2.0
27
+ 3.2.1
28
+ 3.2.2
29
+ 3.3.0
30
+ 3.4.0
31
+ 3.5.0
32
+ ].each do |shrine_version|
33
+ appraise "shrine-#{shrine_version}" do
34
+ gem 'shrine', shrine_version
35
+ end
36
+ end
data/Gemfile CHANGED
@@ -1,8 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in shrine-storage-you_tube.gemspec
4
6
  gemspec
5
7
 
6
- gem 'webmock', git: "https://github.com/bblimke/webmock.git"
8
+ gem 'webmock', git: 'https://github.com/bblimke/webmock.git'
7
9
 
8
10
  gem 'pry'
11
+ gem 'rubocop'
12
+ gem 'rubocop-rspec'
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ task default: :spec
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "shrine/storage/you_tube"
4
+ require 'bundler/setup'
5
+ require 'shrine/storage/you_tube'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "shrine/storage/you_tube"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.0.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.1.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "shrine", "2.10.0"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.10.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.11.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.12.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.13.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.14.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.15.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.16.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.17.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.18.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.19.3"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.2.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.3.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.5.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.6.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.7.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.8.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "2.9.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.0.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.0.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.1.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.2.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.2.1"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.2.2"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.3.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.4.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
6
+ gem "pry"
7
+ gem "rubocop"
8
+ gem "rubocop-rspec"
9
+ gem "shrine", "3.5.0"
10
+
11
+ gemspec path: "../"
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Shrine
2
4
  module Storage
3
5
  class YouTube
4
- VERSION = '0.3.1'
6
+ VERSION = '0.5.0'
5
7
  end
6
8
  end
7
9
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'shrine/storage/you_tube/version'
2
4
  require 'google/apis/youtube_v3'
3
5
 
@@ -14,6 +16,7 @@ class Shrine
14
16
 
15
17
  attr_reader :original_storage, :youtube, :default_privacy, :upload_options
16
18
 
19
+ extend Forwardable
17
20
  def initialize(
18
21
  original_storage:,
19
22
  client_id:,
@@ -39,24 +42,28 @@ class Shrine
39
42
  @original_storage = original_storage
40
43
  end
41
44
 
42
- extend Forwardable
43
- delegate [:download, :open, :read, :stream] => :original_storage
45
+ delegate %i[download open read stream] => :original_storage
44
46
 
45
47
  def channel_id
46
48
  @channel_id ||= find_user_channel
47
49
  end
48
50
 
49
- def upload(io, id, metadata = {}, **passed_upload_options)
50
- snippet = { title: metadata['filename'], channel_id: channel_id }
51
+ def upload(io, id, _old_metadata = {}, shrine_metadata: {}, **passed_upload_options)
52
+ # Shrine stopped using this _old_metadata positional argument in 2.0.0
53
+ # which is the first version this gem supports. Unfortunately, their linter
54
+ # didn't switch to dropping the argument until 3.2.1, so we include it here
55
+ # for compatibility with the linter under earlier versions of Shrine.
56
+
57
+ snippet = { title: shrine_metadata['filename'], channel_id: channel_id }
51
58
  snippet.update(upload_options)
52
59
  snippet.update(passed_upload_options)
53
- snippet.update(metadata.delete('youtube') || {})
60
+ snippet.update(shrine_metadata.delete('youtube') || {})
54
61
 
55
62
  video_data = Google::Apis::YoutubeV3::Video.new(snippet: snippet)
56
63
  uploaded_video = upload_video(io, video_data)
57
64
 
58
65
  id.replace(uploaded_video.id)
59
- original_storage.upload(io, id, metadata)
66
+ original_storage.upload(io, id, shrine_metadata: shrine_metadata)
60
67
 
61
68
  uploaded_video.to_h
62
69
  end
@@ -67,12 +74,13 @@ class Shrine
67
74
 
68
75
  def delete(id)
69
76
  return unless exists?(id)
77
+
70
78
  youtube.delete_video(id)
71
79
  original_storage.delete(id)
72
80
  end
73
81
 
74
82
  def url(id, type: nil, **options)
75
- case type && type.to_sym
83
+ case type&.to_sym
76
84
  when :original
77
85
  original_storage.url(id, **options)
78
86
  when :embed
@@ -85,7 +93,7 @@ class Shrine
85
93
  end
86
94
 
87
95
  def clear!
88
- while uploads_playlist_count > 0
96
+ while uploads_playlist_count.positive?
89
97
  uploads_playlist_items.items.each do |item|
90
98
  video_id = item.snippet.resource_id.video_id
91
99
  youtube.delete_video(video_id)
@@ -111,7 +119,7 @@ class Shrine
111
119
 
112
120
  protected
113
121
 
114
- def youtube_service(client_id: , client_secret: , refresh_token: , client_options: {}, request_options: {})
122
+ def youtube_service(client_id:, client_secret:, refresh_token:, client_options: {}, request_options: {})
115
123
  Google::Apis::YoutubeV3::YouTubeService.new.tap do |service|
116
124
  service.authorization = Google::Auth::UserRefreshCredentials.new(
117
125
  client_id: client_id,
@@ -128,6 +136,7 @@ class Shrine
128
136
  channel_count = user_channels.items.count
129
137
 
130
138
  raise(UserChannelNotFound, channel_count) unless channel_count == 1
139
+
131
140
  user_channels.items.first.id
132
141
  end
133
142
 
@@ -1,29 +1,30 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'shrine/storage/you_tube/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = "shrine-storage-you_tube"
8
+ spec.name = 'shrine-storage-you_tube'
8
9
  spec.version = Shrine::Storage::YouTube::VERSION
9
- spec.authors = ["Reid Beels", "The Dyrt"]
10
- spec.email = ["reid@thedyrt.com"]
10
+ spec.authors = ['Reid Beels', 'The Dyrt']
11
+ spec.email = ['reid@thedyrt.com']
11
12
 
12
- spec.summary = %q{Provides YouTube storage for the Shrine file upload framework.}
13
- spec.homepage = "https://github.com/thedyrt/shrine-storage-you_tube"
13
+ spec.summary = 'Provides YouTube storage for the Shrine file upload framework.'
14
+ spec.homepage = 'https://github.com/thedyrt/shrine-storage-you_tube'
14
15
 
15
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
- spec.bindir = "exe"
17
+ spec.bindir = 'exe'
17
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
19
20
 
20
- spec.add_dependency 'shrine', '~> 2.0'
21
- spec.add_dependency 'google-api-client', '~> 0.13.0'
21
+ spec.add_dependency 'google-api-client', '> 0.11'
22
+ spec.add_dependency 'shrine', '> 2.0', '< 4.0'
22
23
 
23
- spec.add_development_dependency "bundler", "~> 1.10"
24
- spec.add_development_dependency "rake", "~> 10.0"
25
- spec.add_development_dependency "rspec"
26
- spec.add_development_dependency "vcr", "~> 3.0"
27
- spec.add_development_dependency "webmock", "~> 2.3"
28
- spec.add_development_dependency "dotenv", "~> 2.0"
24
+ spec.add_development_dependency 'appraisal'
25
+ spec.add_development_dependency 'dotenv', '~> 2.0'
26
+ spec.add_development_dependency 'rake', '>= 10.0'
27
+ spec.add_development_dependency 'rspec'
28
+ spec.add_development_dependency 'vcr', '~> 3.0'
29
+ spec.add_development_dependency 'webmock', '~> 2.3'
29
30
  end
metadata CHANGED
@@ -1,70 +1,90 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shrine-storage-you_tube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Beels
8
8
  - The Dyrt
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-05-09 00:00:00.000000000 Z
12
+ date: 2023-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: google-api-client
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">"
19
+ - !ruby/object:Gem::Version
20
+ version: '0.11'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">"
26
+ - !ruby/object:Gem::Version
27
+ version: '0.11'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: shrine
16
30
  requirement: !ruby/object:Gem::Requirement
17
31
  requirements:
18
- - - "~>"
32
+ - - ">"
19
33
  - !ruby/object:Gem::Version
20
34
  version: '2.0'
35
+ - - "<"
36
+ - !ruby/object:Gem::Version
37
+ version: '4.0'
21
38
  type: :runtime
22
39
  prerelease: false
23
40
  version_requirements: !ruby/object:Gem::Requirement
24
41
  requirements:
25
- - - "~>"
42
+ - - ">"
26
43
  - !ruby/object:Gem::Version
27
44
  version: '2.0'
45
+ - - "<"
46
+ - !ruby/object:Gem::Version
47
+ version: '4.0'
28
48
  - !ruby/object:Gem::Dependency
29
- name: google-api-client
49
+ name: appraisal
30
50
  requirement: !ruby/object:Gem::Requirement
31
51
  requirements:
32
- - - "~>"
52
+ - - ">="
33
53
  - !ruby/object:Gem::Version
34
- version: 0.13.0
35
- type: :runtime
54
+ version: '0'
55
+ type: :development
36
56
  prerelease: false
37
57
  version_requirements: !ruby/object:Gem::Requirement
38
58
  requirements:
39
- - - "~>"
59
+ - - ">="
40
60
  - !ruby/object:Gem::Version
41
- version: 0.13.0
61
+ version: '0'
42
62
  - !ruby/object:Gem::Dependency
43
- name: bundler
63
+ name: dotenv
44
64
  requirement: !ruby/object:Gem::Requirement
45
65
  requirements:
46
66
  - - "~>"
47
67
  - !ruby/object:Gem::Version
48
- version: '1.10'
68
+ version: '2.0'
49
69
  type: :development
50
70
  prerelease: false
51
71
  version_requirements: !ruby/object:Gem::Requirement
52
72
  requirements:
53
73
  - - "~>"
54
74
  - !ruby/object:Gem::Version
55
- version: '1.10'
75
+ version: '2.0'
56
76
  - !ruby/object:Gem::Dependency
57
77
  name: rake
58
78
  requirement: !ruby/object:Gem::Requirement
59
79
  requirements:
60
- - - "~>"
80
+ - - ">="
61
81
  - !ruby/object:Gem::Version
62
82
  version: '10.0'
63
83
  type: :development
64
84
  prerelease: false
65
85
  version_requirements: !ruby/object:Gem::Requirement
66
86
  requirements:
67
- - - "~>"
87
+ - - ">="
68
88
  - !ruby/object:Gem::Version
69
89
  version: '10.0'
70
90
  - !ruby/object:Gem::Dependency
@@ -109,43 +129,62 @@ dependencies:
109
129
  - - "~>"
110
130
  - !ruby/object:Gem::Version
111
131
  version: '2.3'
112
- - !ruby/object:Gem::Dependency
113
- name: dotenv
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - "~>"
117
- - !ruby/object:Gem::Version
118
- version: '2.0'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: '2.0'
126
- description:
132
+ description:
127
133
  email:
128
134
  - reid@thedyrt.com
129
135
  executables: []
130
136
  extensions: []
131
137
  extra_rdoc_files: []
132
138
  files:
139
+ - ".github/workflows/test.yaml"
133
140
  - ".gitignore"
134
141
  - ".rspec"
142
+ - ".rubocop.yml"
135
143
  - ".travis.yml"
144
+ - Appraisals
136
145
  - Gemfile
137
146
  - LICENSE.txt
138
147
  - README.md
139
148
  - Rakefile
140
149
  - bin/console
141
150
  - bin/setup
151
+ - gemfiles/.bundle/config
152
+ - gemfiles/shrine_2.0.1.gemfile
153
+ - gemfiles/shrine_2.1.1.gemfile
154
+ - gemfiles/shrine_2.10.0.gemfile
155
+ - gemfiles/shrine_2.10.1.gemfile
156
+ - gemfiles/shrine_2.11.0.gemfile
157
+ - gemfiles/shrine_2.12.0.gemfile
158
+ - gemfiles/shrine_2.13.0.gemfile
159
+ - gemfiles/shrine_2.14.0.gemfile
160
+ - gemfiles/shrine_2.15.0.gemfile
161
+ - gemfiles/shrine_2.16.0.gemfile
162
+ - gemfiles/shrine_2.17.1.gemfile
163
+ - gemfiles/shrine_2.18.1.gemfile
164
+ - gemfiles/shrine_2.19.3.gemfile
165
+ - gemfiles/shrine_2.2.0.gemfile
166
+ - gemfiles/shrine_2.3.1.gemfile
167
+ - gemfiles/shrine_2.5.0.gemfile
168
+ - gemfiles/shrine_2.6.1.gemfile
169
+ - gemfiles/shrine_2.7.0.gemfile
170
+ - gemfiles/shrine_2.8.0.gemfile
171
+ - gemfiles/shrine_2.9.0.gemfile
172
+ - gemfiles/shrine_3.0.0.gemfile
173
+ - gemfiles/shrine_3.0.1.gemfile
174
+ - gemfiles/shrine_3.1.0.gemfile
175
+ - gemfiles/shrine_3.2.0.gemfile
176
+ - gemfiles/shrine_3.2.1.gemfile
177
+ - gemfiles/shrine_3.2.2.gemfile
178
+ - gemfiles/shrine_3.3.0.gemfile
179
+ - gemfiles/shrine_3.4.0.gemfile
180
+ - gemfiles/shrine_3.5.0.gemfile
142
181
  - lib/shrine/storage/you_tube.rb
143
182
  - lib/shrine/storage/you_tube/version.rb
144
183
  - shrine-storage-you_tube.gemspec
145
184
  homepage: https://github.com/thedyrt/shrine-storage-you_tube
146
185
  licenses: []
147
186
  metadata: {}
148
- post_install_message:
187
+ post_install_message:
149
188
  rdoc_options: []
150
189
  require_paths:
151
190
  - lib
@@ -160,9 +199,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
199
  - !ruby/object:Gem::Version
161
200
  version: '0'
162
201
  requirements: []
163
- rubyforge_project:
164
- rubygems_version: 2.6.13
165
- signing_key:
202
+ rubygems_version: 3.4.10
203
+ signing_key:
166
204
  specification_version: 4
167
205
  summary: Provides YouTube storage for the Shrine file upload framework.
168
206
  test_files: []