Skip to content

Tidy up Gemfile #824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### Fixed

- [#690](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/690) Rails 6 support
- [#690](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/690) Rails 6 support
- [#805](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/805) Rails 6: Fix database tasks tests for SQL Server
- [#807](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/807) Rails 6: Skip binary fixtures test on Windows
- [#809](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/809) Rails 6: Coerce reaper test using fork
Expand All @@ -19,6 +19,7 @@
- [#821](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/821) Enable frozen strings - part 1
- [#822](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/822) Enable frozen strings - part 2
- [#823](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/823) Enable frozen strings - final
- [#824](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/824) Tidy up Gemfile

#### Added

Expand Down
76 changes: 35 additions & 41 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,69 +1,63 @@
# frozen_string_literal: true

require 'openssl'
source 'https://rubygems.org'
source "https://rubygems.org"

git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gemspec

gem "bcrypt"
gem "pg", ">= 0.18.0"
gem "sqlite3", "~> 1.4"
gem "pg", ">= 0.18.0"
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'bcrypt'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

if RbConfig::CONFIG["host_os"] =~ /darwin/
gem 'terminal-notifier-guard'
end

if ENV['RAILS_SOURCE']
gemspec path: ENV['RAILS_SOURCE']
if ENV["RAILS_SOURCE"]
gemspec path: ENV["RAILS_SOURCE"]
else
# Need to get rails source because the gem doesn't include tests
version = ENV['RAILS_VERSION'] || begin
require 'net/http'
require 'yaml'
spec = eval(File.read('activerecord-sqlserver-adapter.gemspec'))
ver = spec.dependencies.detect{ |d|d.name == 'activerecord' }.requirement.requirements.first.last.version
major, minor, tiny, pre = ver.split('.')
if !pre
uri = URI.parse "https://rubygems.org/api/v1/versions/activerecord.yaml"
version = ENV["RAILS_VERSION"] || begin
require "openssl"
require "net/http"
require "yaml"

spec = eval(File.read("activerecord-sqlserver-adapter.gemspec"))
ver = spec.dependencies.detect{ |d|d.name == "activerecord" }.requirement.requirements.first.last.version
major, minor, tiny, pre = ver.split(".")

if pre
ver
else
uri = URI.parse("https://rubygems.org/api/v1/versions/activerecord.yaml")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
YAML.load(http.request(Net::HTTP::Get.new(uri.request_uri)).body).select do |data|
a, b, c = data['number'].split('.')
!data['prerelease'] && major == a && (minor.nil? || minor == b)
end.first['number']
else
ver
YAML.load(http.request(Net::HTTP::Get.new(uri.request_uri)).body).find do |data|
a, b, c = data["number"].split(".")
!data["prerelease"] && major == a && (minor.nil? || minor == b)
end["number"]
end
end
gem 'rails', github: "rails/rails", tag: "v#{version}"
end

if ENV['AREL']
gem 'arel', path: ENV['AREL']
gem "rails", github: "rails/rails", tag: "v#{version}"
end

group :tinytds do
if ENV['TINYTDS_SOURCE']
gem 'tiny_tds', path: ENV['TINYTDS_SOURCE']
elsif ENV['TINYTDS_VERSION']
gem 'tiny_tds', ENV['TINYTDS_VERSION']
if ENV["TINYTDS_SOURCE"]
gem "tiny_tds", path: ENV["TINYTDS_SOURCE"]
elsif ENV["TINYTDS_VERSION"]
gem "tiny_tds", ENV["TINYTDS_VERSION"]
else
gem 'tiny_tds'
gem "tiny_tds"
end
end

group :development do
gem 'byebug', platform: [:mri, :mingw, :x64_mingw]
gem 'mocha'
gem 'minitest-spec-rails'
gem "pry-byebug", platform: [:mri, :mingw, :x64_mingw]
gem "mocha"
gem "minitest-spec-rails"
end

group :guard do
gem 'guard'
gem 'guard-minitest'
gem "guard"
gem "guard-minitest"
gem "terminal-notifier-guard" if RbConfig::CONFIG["host_os"] =~ /darwin/
end