Merge pull request #129 from SuperTux88/update-ruby-and-gems
Update ruby to 3.2 and update gems
This commit is contained in:
commit
758ca03dbe
17 changed files with 155 additions and 298 deletions
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
|
|
@ -9,25 +9,39 @@ on:
|
|||
|
||||
jobs:
|
||||
test:
|
||||
name: 'Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.rails }}'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby:
|
||||
- "3.2"
|
||||
- "3.1"
|
||||
- "3.0"
|
||||
- "2.7"
|
||||
gemfile:
|
||||
- Gemfile
|
||||
- test/gemfiles/no-rails.Gemfile
|
||||
rails:
|
||||
- "7.0"
|
||||
- "6.1"
|
||||
- "6.0"
|
||||
- "5.2"
|
||||
- "none"
|
||||
exclude:
|
||||
- ruby: "3.2"
|
||||
rails: "5.2"
|
||||
- ruby: "3.1"
|
||||
rails: "5.2"
|
||||
- ruby: "3.0"
|
||||
rails: "5.2"
|
||||
env:
|
||||
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
||||
RAILS_VERSION: ${{ matrix.rails }}
|
||||
BUNDLE_WITHOUT: development
|
||||
BUNDLE_FROZEN: true
|
||||
BUNDLE_DISABLE_SHARED_GEMS: true
|
||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Delete Gemfile.lock
|
||||
run: rm Gemfile.lock
|
||||
if: matrix.rails != '7.0' # Gemfile.lock is only generated for latest rails version
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
|
|
|
|||
|
|
@ -191,6 +191,10 @@ Rails/NegateInclude:
|
|||
Rails/RakeEnvironment:
|
||||
Enabled: false
|
||||
|
||||
# only available on rails >= 6.0
|
||||
Rails/IndexWith:
|
||||
Enabled: false
|
||||
|
||||
Lint/ConstantDefinitionInBlock:
|
||||
Exclude:
|
||||
- "spec/**/*"
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3.1
|
||||
3.2
|
||||
|
|
|
|||
28
Gemfile
28
Gemfile
|
|
@ -9,7 +9,9 @@ gemspec name: "diaspora_federation"
|
|||
|
||||
Dir["diaspora_federation-*.gemspec"].each do |gemspec|
|
||||
plugin = gemspec.scan(/diaspora_federation-(.*)\.gemspec/).flatten.first
|
||||
gemspec(name: "diaspora_federation-#{plugin}", development_group: plugin)
|
||||
unless ENV["RAILS_VERSION"] == "none" && plugin == "rails"
|
||||
gemspec(name: "diaspora_federation-#{plugin}", development_group: plugin)
|
||||
end
|
||||
end
|
||||
|
||||
# Declare any dependencies that are still in development here instead of in
|
||||
|
|
@ -19,10 +21,10 @@ end
|
|||
|
||||
group :development do
|
||||
# code style
|
||||
gem "pronto", "0.11.0", require: false
|
||||
gem "pronto-rubocop", "0.11.2", require: false
|
||||
gem "rubocop", "1.32.0", require: false
|
||||
gem "rubocop-rails", "2.15.2", require: false
|
||||
gem "pronto", "0.11.1", require: false
|
||||
gem "pronto-rubocop", "0.11.5", require: false
|
||||
gem "rubocop", "1.52.0", require: false
|
||||
gem "rubocop-rails", "2.19.1", require: false
|
||||
gem "rubocop-rake", "0.6.0", require: false
|
||||
|
||||
# debugging
|
||||
|
|
@ -42,11 +44,11 @@ group :test do
|
|||
gem "nyan-cat-formatter", require: false
|
||||
|
||||
# test coverage
|
||||
gem "simplecov", "0.21.2", require: false
|
||||
gem "simplecov", "0.22.0", require: false
|
||||
gem "simplecov-rcov", "0.3.1", require: false
|
||||
|
||||
# test helpers
|
||||
gem "json-schema", "~> 3.0"
|
||||
gem "json-schema", "~> 4.0"
|
||||
gem "rspec-collection_matchers", "~> 1.2.0"
|
||||
gem "rspec-json_expectations", "~> 2.1"
|
||||
gem "webmock", "~> 3.0"
|
||||
|
|
@ -56,6 +58,14 @@ group :development, :test do
|
|||
gem "rake"
|
||||
|
||||
# unit tests
|
||||
gem "rspec", "~> 3.11.0"
|
||||
gem "rspec-rails", "~> 5.1.2"
|
||||
gem "rspec", "~> 3.12.0"
|
||||
|
||||
unless ENV["RAILS_VERSION"] == "none"
|
||||
gem "rspec-rails", "~> 5.1.2"
|
||||
|
||||
# The default rails version needs to be kept up to date also in:
|
||||
# - test/dummy/config/application.rb (config.load_defaults)
|
||||
# - .github/workflows/ci.yml ('Delete Gemfile.lock' step)
|
||||
gem "actionpack", "~> #{ENV['RAILS_VERSION'] || '7.0'}.0"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
185
Gemfile.lock
185
Gemfile.lock
|
|
@ -19,46 +19,46 @@ PATH
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actionpack (7.0.3.1)
|
||||
actionview (= 7.0.3.1)
|
||||
activesupport (= 7.0.3.1)
|
||||
rack (~> 2.0, >= 2.2.0)
|
||||
actionpack (7.0.5)
|
||||
actionview (= 7.0.5)
|
||||
activesupport (= 7.0.5)
|
||||
rack (~> 2.0, >= 2.2.4)
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||
actionview (7.0.3.1)
|
||||
activesupport (= 7.0.3.1)
|
||||
actionview (7.0.5)
|
||||
activesupport (= 7.0.5)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||
activesupport (7.0.3.1)
|
||||
activesupport (7.0.5)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
tzinfo (~> 2.0)
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
addressable (2.8.4)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
ast (2.4.2)
|
||||
builder (3.2.4)
|
||||
byebug (11.1.3)
|
||||
coderay (1.1.3)
|
||||
concurrent-ruby (1.1.10)
|
||||
concurrent-ruby (1.2.2)
|
||||
crack (0.4.5)
|
||||
rexml
|
||||
crass (1.0.6)
|
||||
diff-lcs (1.5.0)
|
||||
docile (1.4.0)
|
||||
erubi (1.10.0)
|
||||
ethon (0.15.0)
|
||||
erubi (1.12.0)
|
||||
ethon (0.16.0)
|
||||
ffi (>= 1.15.0)
|
||||
fabrication (2.29.0)
|
||||
faraday (2.3.0)
|
||||
faraday-net_http (~> 2.0)
|
||||
fabrication (2.30.0)
|
||||
faraday (2.7.6)
|
||||
faraday-net_http (>= 2.0, < 3.1)
|
||||
ruby2_keywords (>= 0.0.4)
|
||||
faraday-follow_redirects (0.3.0)
|
||||
faraday (>= 1, < 3)
|
||||
faraday-net_http (2.0.3)
|
||||
faraday-net_http (3.0.2)
|
||||
ffi (1.15.5)
|
||||
fuubar (2.5.1)
|
||||
rspec-core (~> 3.0)
|
||||
|
|
@ -67,96 +67,96 @@ GEM
|
|||
httparty (~> 0.20)
|
||||
terminal-table (>= 1.5.1)
|
||||
hashdiff (1.0.1)
|
||||
httparty (0.20.0)
|
||||
mime-types (~> 3.0)
|
||||
httparty (0.21.0)
|
||||
mini_mime (>= 1.0.0)
|
||||
multi_xml (>= 0.5.2)
|
||||
i18n (1.12.0)
|
||||
i18n (1.14.1)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.6.2)
|
||||
json-schema (3.0.0)
|
||||
json (2.6.3)
|
||||
json-schema (4.0.0)
|
||||
addressable (>= 2.8)
|
||||
listen (3.7.1)
|
||||
listen (3.8.0)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
rb-inotify (~> 0.9, >= 0.9.10)
|
||||
loofah (2.18.0)
|
||||
loofah (2.21.3)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.5.9)
|
||||
nokogiri (>= 1.12.0)
|
||||
macaddr (1.7.2)
|
||||
systemu (~> 2.6.5)
|
||||
method_source (1.0.0)
|
||||
mime-types (3.4.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2022.0105)
|
||||
mini_portile2 (2.8.0)
|
||||
minitest (5.16.2)
|
||||
mini_mime (1.1.2)
|
||||
mini_portile2 (2.8.2)
|
||||
minitest (5.18.0)
|
||||
multi_xml (0.6.0)
|
||||
nokogiri (1.13.8)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
nokogiri (1.15.2)
|
||||
mini_portile2 (~> 2.8.2)
|
||||
racc (~> 1.4)
|
||||
nyan-cat-formatter (0.12.0)
|
||||
rspec (>= 2.99, >= 2.14.2, < 4)
|
||||
octokit (4.25.1)
|
||||
octokit (6.1.1)
|
||||
faraday (>= 1, < 3)
|
||||
sawyer (~> 0.9)
|
||||
parallel (1.22.1)
|
||||
parser (3.1.2.0)
|
||||
parallel (1.23.0)
|
||||
parser (3.2.2.3)
|
||||
ast (~> 2.4.1)
|
||||
pronto (0.11.0)
|
||||
gitlab (~> 4.4, >= 4.4.0)
|
||||
httparty (>= 0.13.7)
|
||||
octokit (~> 4.7, >= 4.7.0)
|
||||
racc
|
||||
pronto (0.11.1)
|
||||
gitlab (>= 4.4.0, < 5.0)
|
||||
httparty (>= 0.13.7, < 1.0)
|
||||
octokit (>= 4.7.0, < 7.0)
|
||||
rainbow (>= 2.2, < 4.0)
|
||||
rexml (~> 3.2)
|
||||
rugged (>= 0.23.0, < 1.1.0)
|
||||
rexml (>= 3.2.5, < 4.0)
|
||||
rugged (>= 0.23.0, < 2.0)
|
||||
thor (>= 0.20.3, < 2.0)
|
||||
pronto-rubocop (0.11.2)
|
||||
pronto-rubocop (0.11.5)
|
||||
pronto (~> 0.11.0)
|
||||
rubocop (>= 0.63.1, < 2.0)
|
||||
pry (0.13.1)
|
||||
pry (0.14.2)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
pry-byebug (3.9.0)
|
||||
pry-byebug (3.10.1)
|
||||
byebug (~> 11.0)
|
||||
pry (~> 0.13.0)
|
||||
public_suffix (4.0.7)
|
||||
racc (1.6.0)
|
||||
rack (2.2.4)
|
||||
rack-test (2.0.2)
|
||||
pry (>= 0.13, < 0.15)
|
||||
public_suffix (5.0.1)
|
||||
racc (1.7.0)
|
||||
rack (2.2.7)
|
||||
rack-test (2.1.0)
|
||||
rack (>= 1.3)
|
||||
rails-dom-testing (2.0.3)
|
||||
activesupport (>= 4.2.0)
|
||||
nokogiri (>= 1.6)
|
||||
rails-html-sanitizer (1.4.3)
|
||||
loofah (~> 2.3)
|
||||
railties (7.0.3.1)
|
||||
actionpack (= 7.0.3.1)
|
||||
activesupport (= 7.0.3.1)
|
||||
rails-html-sanitizer (1.6.0)
|
||||
loofah (~> 2.21)
|
||||
nokogiri (~> 1.14)
|
||||
railties (7.0.5)
|
||||
actionpack (= 7.0.5)
|
||||
activesupport (= 7.0.5)
|
||||
method_source
|
||||
rake (>= 12.2)
|
||||
thor (~> 1.0)
|
||||
zeitwerk (~> 2.5)
|
||||
rainbow (3.1.1)
|
||||
rake (13.0.6)
|
||||
rb-fsevent (0.11.1)
|
||||
rb-fsevent (0.11.2)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
regexp_parser (2.5.0)
|
||||
regexp_parser (2.8.1)
|
||||
rexml (3.2.5)
|
||||
rspec (3.11.0)
|
||||
rspec-core (~> 3.11.0)
|
||||
rspec-expectations (~> 3.11.0)
|
||||
rspec-mocks (~> 3.11.0)
|
||||
rspec (3.12.0)
|
||||
rspec-core (~> 3.12.0)
|
||||
rspec-expectations (~> 3.12.0)
|
||||
rspec-mocks (~> 3.12.0)
|
||||
rspec-collection_matchers (1.2.0)
|
||||
rspec-expectations (>= 2.99.0.beta1)
|
||||
rspec-core (3.11.0)
|
||||
rspec-support (~> 3.11.0)
|
||||
rspec-expectations (3.11.0)
|
||||
rspec-core (3.12.2)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-expectations (3.12.3)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.11.0)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-json_expectations (2.2.0)
|
||||
rspec-mocks (3.11.1)
|
||||
rspec-mocks (3.12.5)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.11.0)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-rails (5.1.2)
|
||||
actionpack (>= 5.2)
|
||||
activesupport (>= 5.2)
|
||||
|
|
@ -165,32 +165,32 @@ GEM
|
|||
rspec-expectations (~> 3.10)
|
||||
rspec-mocks (~> 3.10)
|
||||
rspec-support (~> 3.10)
|
||||
rspec-support (3.11.0)
|
||||
rubocop (1.32.0)
|
||||
rspec-support (3.12.0)
|
||||
rubocop (1.52.0)
|
||||
json (~> 2.3)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.1.0.0)
|
||||
parser (>= 3.2.0.0)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
rexml (>= 3.2.5, < 4.0)
|
||||
rubocop-ast (>= 1.19.1, < 2.0)
|
||||
rubocop-ast (>= 1.28.0, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 1.4.0, < 3.0)
|
||||
rubocop-ast (1.19.1)
|
||||
parser (>= 3.1.1.0)
|
||||
rubocop-rails (2.15.2)
|
||||
unicode-display_width (>= 2.4.0, < 3.0)
|
||||
rubocop-ast (1.29.0)
|
||||
parser (>= 3.2.1.0)
|
||||
rubocop-rails (2.19.1)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
rubocop (>= 1.33.0, < 2.0)
|
||||
rubocop-rake (0.6.0)
|
||||
rubocop (~> 1.0)
|
||||
ruby-progressbar (1.11.0)
|
||||
ruby-progressbar (1.13.0)
|
||||
ruby2_keywords (0.0.5)
|
||||
rugged (1.0.1)
|
||||
rugged (1.6.3)
|
||||
sawyer (0.9.2)
|
||||
addressable (>= 2.3.5)
|
||||
faraday (>= 0.17.3, < 3)
|
||||
simplecov (0.21.2)
|
||||
simplecov (0.22.0)
|
||||
docile (~> 1.1)
|
||||
simplecov-html (~> 0.11)
|
||||
simplecov_json_formatter (~> 0.1)
|
||||
|
|
@ -201,52 +201,51 @@ GEM
|
|||
systemu (2.6.5)
|
||||
terminal-table (3.0.2)
|
||||
unicode-display_width (>= 1.1.1, < 3)
|
||||
thor (1.2.1)
|
||||
thor (1.2.2)
|
||||
typhoeus (1.4.0)
|
||||
ethon (>= 0.9.0)
|
||||
tzinfo (2.0.5)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
unicode-display_width (2.2.0)
|
||||
unicode-display_width (2.4.2)
|
||||
uuid (2.3.9)
|
||||
macaddr (~> 1.0)
|
||||
valid (1.2.0)
|
||||
webmock (3.14.0)
|
||||
webmock (3.18.1)
|
||||
addressable (>= 2.8.0)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
webrick (1.7.0)
|
||||
yard (0.9.28)
|
||||
webrick (~> 1.7.0)
|
||||
zeitwerk (2.6.0)
|
||||
yard (0.9.34)
|
||||
zeitwerk (2.6.8)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
actionpack (~> 7.0.0)
|
||||
diaspora_federation!
|
||||
diaspora_federation-json_schema!
|
||||
diaspora_federation-rails!
|
||||
diaspora_federation-test!
|
||||
fuubar (= 2.5.1)
|
||||
json-schema (~> 3.0)
|
||||
json-schema (~> 4.0)
|
||||
listen
|
||||
nyan-cat-formatter
|
||||
pronto (= 0.11.0)
|
||||
pronto-rubocop (= 0.11.2)
|
||||
pronto (= 0.11.1)
|
||||
pronto-rubocop (= 0.11.5)
|
||||
pry
|
||||
pry-byebug
|
||||
rake
|
||||
rspec (~> 3.11.0)
|
||||
rspec (~> 3.12.0)
|
||||
rspec-collection_matchers (~> 1.2.0)
|
||||
rspec-json_expectations (~> 2.1)
|
||||
rspec-rails (~> 5.1.2)
|
||||
rubocop (= 1.32.0)
|
||||
rubocop-rails (= 2.15.2)
|
||||
rubocop (= 1.52.0)
|
||||
rubocop-rails (= 2.19.1)
|
||||
rubocop-rake (= 0.6.0)
|
||||
simplecov (= 0.21.2)
|
||||
simplecov (= 0.22.0)
|
||||
simplecov-rcov (= 0.3.1)
|
||||
webmock (~> 3.0)
|
||||
yard
|
||||
|
||||
BUNDLED WITH
|
||||
2.3.7
|
||||
2.4.13
|
||||
|
|
|
|||
2
Rakefile
2
Rakefile
|
|
@ -15,7 +15,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|||
rdoc.rdoc_files.include("lib/**/*.rb")
|
||||
end
|
||||
|
||||
if defined?(::Rails)
|
||||
if defined?(Rails)
|
||||
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
||||
load "rails/tasks/engine.rake"
|
||||
load "rails/tasks/statistics.rake"
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
namespace :gemfiles do
|
||||
desc "Generates no-rails.Gemfile"
|
||||
task :generate do
|
||||
FileUtils.mkdir_p("test/gemfiles")
|
||||
FileUtils.rm(Dir["test/gemfiles/*.Gemfile.lock"])
|
||||
|
||||
original_gemfile = File.read("Gemfile")
|
||||
original_gemfile.sub!(/(gemspec name:.*)/) { "#{Regexp.last_match[1]}, path: \"../../\"" }
|
||||
original_gemfile.sub!(/(gemspec\(name:.*)\)/) { "#{Regexp.last_match[1]}, path: \"../../\")" }
|
||||
original_gemfile.sub!(/^group :development do$.*?^end$\n\n/m, "")
|
||||
|
||||
no_rails_gemfile = original_gemfile.dup
|
||||
no_rails_gemfile.sub!(/(gemspec\(name:.*)/) { "#{Regexp.last_match[1]} unless plugin == \"rails\"" }
|
||||
no_rails_gemfile.sub!(/^.*rspec-rails.*$\n/, "")
|
||||
no_rails_path = "test/gemfiles/no-rails.Gemfile"
|
||||
File.write(no_rails_path, no_rails_gemfile)
|
||||
|
||||
Bundler.with_unbundled_env do
|
||||
system("BUNDLE_GEMFILE=#{no_rails_path} bundle install")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -19,26 +19,26 @@ Fabricator(:user, class_name: Person) do
|
|||
end
|
||||
|
||||
Fabricator(:post, class_name: Entity) do
|
||||
on_init { init_with("Post") }
|
||||
initialize_with { resolved_class.new("Post") }
|
||||
author { Fabricate(:person) }
|
||||
end
|
||||
|
||||
Fabricator(:comment, class_name: Entity) do
|
||||
on_init { init_with("Comment") }
|
||||
initialize_with { resolved_class.new("Comment") }
|
||||
author { Fabricate(:person) }
|
||||
end
|
||||
|
||||
Fabricator(:poll, class_name: Entity) do
|
||||
on_init { init_with("Poll") }
|
||||
initialize_with { resolved_class.new("Poll") }
|
||||
author { Fabricate(:person) }
|
||||
end
|
||||
|
||||
Fabricator(:event, class_name: Entity) do
|
||||
on_init { init_with("Event") }
|
||||
initialize_with { resolved_class.new("Event") }
|
||||
author { Fabricate(:person) }
|
||||
end
|
||||
|
||||
Fabricator(:conversation, class_name: Entity) do
|
||||
on_init { init_with("Conversation") }
|
||||
initialize_with { resolved_class.new("Conversation") }
|
||||
author { Fabricate(:person) }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ module DiasporaFederation
|
|||
},
|
||||
{
|
||||
"rel": "self",
|
||||
"type": "application/ld+json; profile=\\\"https://www.w3.org/ns/activitystreams\\\"",
|
||||
"type": "application/ld+json; profile=\\"https://www.w3.org/ns/activitystreams\\"",
|
||||
"href": "#{person.url}channel/#{person.nickname}"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ module DiasporaFederation
|
|||
parent: remote_parent
|
||||
}.merge("new_property" => new_property),
|
||||
%w[author guid parent_guid new_property property],
|
||||
"new_property" => new_property
|
||||
{"new_property" => new_property}
|
||||
).and_call_original
|
||||
Entities::SomeRelayable.from_hash(entity_data, property_order)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -200,9 +200,11 @@ module DiasporaFederation
|
|||
|
||||
it "calls .from_hash with the hash representation of provided XML" do
|
||||
expect(Entities::TestDefaultEntity).to receive(:from_hash).with(
|
||||
test1: "asdf",
|
||||
test2: "qwer",
|
||||
test3: true
|
||||
{
|
||||
test1: "asdf",
|
||||
test2: "qwer",
|
||||
test3: true
|
||||
}
|
||||
)
|
||||
Entities::TestDefaultEntity.from_xml(Nokogiri::XML(<<~XML).root)
|
||||
<test_default_entity>
|
||||
|
|
@ -340,7 +342,7 @@ module DiasporaFederation
|
|||
}
|
||||
expect(Entities::TestEntity).to receive(:json_parser_class).and_call_original
|
||||
expect_any_instance_of(Parsers::JsonParser).to receive(:parse).with(json).and_call_original
|
||||
expect(Entities::TestEntity).to receive(:from_hash).with(test: "value")
|
||||
expect(Entities::TestEntity).to receive(:from_hash).with({test: "value"})
|
||||
Entities::TestEntity.from_json(json)
|
||||
end
|
||||
|
||||
|
|
@ -388,7 +390,7 @@ module DiasporaFederation
|
|||
|
||||
it "calls a constructor of the entity of the appropriate type" do
|
||||
entity_data = {test1: "abc", test2: "123"}
|
||||
expect(Entities::TestDefaultEntity).to receive(:new).with(test1: "abc", test2: "123")
|
||||
expect(Entities::TestDefaultEntity).to receive(:new).with({test1: "abc", test2: "123"})
|
||||
Entities::TestDefaultEntity.from_hash(entity_data)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ RSpec.configure do |config|
|
|||
expect_config.syntax = :expect
|
||||
end
|
||||
|
||||
if defined?(::Rails)
|
||||
if defined?(Rails)
|
||||
config.before(:each, type: :controller) do
|
||||
ActionController::Base.allow_forgery_protection = true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ def change_time(time, options={})
|
|||
new_min = options.fetch(:min, options[:hour] ? 0 : time.min)
|
||||
new_sec = options.fetch(:sec, options[:hour] || options[:min] ? 0 : time.sec)
|
||||
|
||||
::Time.utc(time.year, time.month, time.day, new_hour, new_min, new_sec)
|
||||
Time.utc(time.year, time.month, time.day, new_hour, new_min, new_sec)
|
||||
end
|
||||
|
||||
# indent helper
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ require "diaspora_federation/rails"
|
|||
module Dummy
|
||||
class Application < Rails::Application
|
||||
# Initialize configuration defaults for originally generated Rails version.
|
||||
config.load_defaults 7.0
|
||||
config.load_defaults(ENV["RAILS_VERSION"] || "7.0")
|
||||
|
||||
# Configuration for the application, engines, and railties goes here.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ Rails.application.configure do
|
|||
config.active_support.report_deprecations = false
|
||||
|
||||
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||
config.log_formatter = ::Logger::Formatter.new
|
||||
config.log_formatter = Logger::Formatter.new
|
||||
|
||||
# Use a different logger for distributed setups.
|
||||
# require "syslog/logger"
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
# Declare your gem's dependencies in diaspora_federation.gemspec.
|
||||
# Bundler will treat runtime dependencies like base dependencies, and
|
||||
# development dependencies will be added by default to the :development group.
|
||||
gemspec name: "diaspora_federation", path: "../../"
|
||||
|
||||
Dir["diaspora_federation-*.gemspec"].each do |gemspec|
|
||||
plugin = gemspec.scan(/diaspora_federation-(.*)\.gemspec/).flatten.first
|
||||
gemspec(name: "diaspora_federation-#{plugin}", development_group: plugin, path: "../../") unless plugin == "rails"
|
||||
end
|
||||
|
||||
# Declare any dependencies that are still in development here instead of in
|
||||
# your gemspec. These might include edge Rails or gems from your path or
|
||||
# Git. Remember to move these dependencies to your gemspec before releasing
|
||||
# your gem to rubygems.org.
|
||||
|
||||
group :test do
|
||||
# rspec formatter
|
||||
gem "fuubar", "2.5.1", require: false
|
||||
gem "nyan-cat-formatter", require: false
|
||||
|
||||
# test coverage
|
||||
gem "simplecov", "0.21.2", require: false
|
||||
gem "simplecov-rcov", "0.3.1", require: false
|
||||
|
||||
# test helpers
|
||||
gem "json-schema", "~> 3.0"
|
||||
gem "rspec-collection_matchers", "~> 1.2.0"
|
||||
gem "rspec-json_expectations", "~> 2.1"
|
||||
gem "webmock", "~> 3.0"
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
gem "rake"
|
||||
|
||||
# unit tests
|
||||
gem "rspec", "~> 3.11.0"
|
||||
end
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
PATH
|
||||
remote: ../..
|
||||
specs:
|
||||
diaspora_federation (1.0.1)
|
||||
faraday (>= 1.0, < 3)
|
||||
faraday-follow_redirects (~> 0.3)
|
||||
nokogiri (~> 1.6, >= 1.6.8)
|
||||
typhoeus (~> 1.0)
|
||||
valid (~> 1.0)
|
||||
diaspora_federation-json_schema (1.0.1)
|
||||
diaspora_federation-test (1.0.1)
|
||||
diaspora_federation (= 1.0.1)
|
||||
fabrication (~> 2.29)
|
||||
uuid (~> 2.3, >= 2.3.8)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
crack (0.4.5)
|
||||
rexml
|
||||
diff-lcs (1.5.0)
|
||||
docile (1.4.0)
|
||||
ethon (0.15.0)
|
||||
ffi (>= 1.15.0)
|
||||
fabrication (2.29.0)
|
||||
faraday (2.3.0)
|
||||
faraday-net_http (~> 2.0)
|
||||
ruby2_keywords (>= 0.0.4)
|
||||
faraday-follow_redirects (0.3.0)
|
||||
faraday (>= 1, < 3)
|
||||
faraday-net_http (2.0.3)
|
||||
ffi (1.15.5)
|
||||
fuubar (2.5.1)
|
||||
rspec-core (~> 3.0)
|
||||
ruby-progressbar (~> 1.4)
|
||||
hashdiff (1.0.1)
|
||||
json-schema (3.0.0)
|
||||
addressable (>= 2.8)
|
||||
macaddr (1.7.2)
|
||||
systemu (~> 2.6.5)
|
||||
nokogiri (1.13.8-x86_64-linux)
|
||||
racc (~> 1.4)
|
||||
nyan-cat-formatter (0.12.0)
|
||||
rspec (>= 2.99, >= 2.14.2, < 4)
|
||||
public_suffix (4.0.7)
|
||||
racc (1.6.0)
|
||||
rake (13.0.6)
|
||||
rexml (3.2.5)
|
||||
rspec (3.11.0)
|
||||
rspec-core (~> 3.11.0)
|
||||
rspec-expectations (~> 3.11.0)
|
||||
rspec-mocks (~> 3.11.0)
|
||||
rspec-collection_matchers (1.2.0)
|
||||
rspec-expectations (>= 2.99.0.beta1)
|
||||
rspec-core (3.11.0)
|
||||
rspec-support (~> 3.11.0)
|
||||
rspec-expectations (3.11.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.11.0)
|
||||
rspec-json_expectations (2.2.0)
|
||||
rspec-mocks (3.11.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.11.0)
|
||||
rspec-support (3.11.0)
|
||||
ruby-progressbar (1.11.0)
|
||||
ruby2_keywords (0.0.5)
|
||||
simplecov (0.21.2)
|
||||
docile (~> 1.1)
|
||||
simplecov-html (~> 0.11)
|
||||
simplecov_json_formatter (~> 0.1)
|
||||
simplecov-html (0.12.3)
|
||||
simplecov-rcov (0.3.1)
|
||||
simplecov (>= 0.4.1)
|
||||
simplecov_json_formatter (0.1.4)
|
||||
systemu (2.6.5)
|
||||
typhoeus (1.4.0)
|
||||
ethon (>= 0.9.0)
|
||||
uuid (2.3.9)
|
||||
macaddr (~> 1.0)
|
||||
valid (1.2.0)
|
||||
webmock (3.14.0)
|
||||
addressable (>= 2.8.0)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
|
||||
PLATFORMS
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
diaspora_federation!
|
||||
diaspora_federation-json_schema!
|
||||
diaspora_federation-test!
|
||||
fuubar (= 2.5.1)
|
||||
json-schema (~> 3.0)
|
||||
nyan-cat-formatter
|
||||
rake
|
||||
rspec (~> 3.11.0)
|
||||
rspec-collection_matchers (~> 1.2.0)
|
||||
rspec-json_expectations (~> 2.1)
|
||||
simplecov (= 0.21.2)
|
||||
simplecov-rcov (= 0.3.1)
|
||||
webmock (~> 3.0)
|
||||
|
||||
BUNDLED WITH
|
||||
2.3.7
|
||||
Loading…
Reference in a new issue