diff --git a/Gemfile b/Gemfile index 9bc7afaa..6ed10ada 100644 --- a/Gemfile +++ b/Gemfile @@ -16,8 +16,8 @@ group :test do # rails is not used because activerecord should not be included, but rails would normally coordinate the versions # between its dependencies, which is now handled by this constraint. rails_version_constraint = [ - '>= 3.2.0', - '< 4.0.0' + '>= 4.0.9', + '< 4.1.0' ] # Dummy app uses actionpack for ActionController, but not rails since it doesn't use activerecord. diff --git a/RELEASING.md b/RELEASING.md index 37fbeed7..d7e5093a 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -40,18 +40,21 @@ Complete these steps on DESTINATION The entries in the [CHANGELOG.md](CHANGELOG.md) can be used to help determine how the `VERSION` should be bumped. -### Compatible changes +### Bug fixes -If the [CHANGELOG.md](CHANGELOG.md) contains only Enhancements, Bug Fixes, and/or Deprecations for the Next Release then -increment [`PATCH`](lib/metasploit/model/version.rb). +If the [CHANGELOG.md](CHANGELOG.md) contains only Bug Fixes for the Next Release, then increment +[`PATCH`](lib/metasploit/model/version.rb). -### Incompatible changes +### Compatible API changes -If the [CHANGELOG.md](CHANGELOG.md) contains any Incompatible Changes for the Next Release, then you can either (1) -decide to remain pre-1.0.0 or (2) advance to 1.0.0. +If the [CHANGELOG.md](CHANGELOG.md) contains any Enhancements or Deprecations, then increment +[`MINOR`](lib/metasploit/model/version.rb) and reset [`PATCH`](lib/metasploit/model/version.rb) to `0`. -1. To remain pre-1..0.0, then increment [`MINOR`](lib/metasploit/model/version.rb) and reset [`PATCH`](lib/metasploit/model/version.rb) to `0`. -2. To advance to 1.0.0, increment [`MAJOR`](lib/metasploit/model/version.rb) and reset [`MINOR`](lib/metasploit/model/version.rb and [`PATCH`](lib/metasploit/model/version.rb) to `0`. +### Incompatible API changes + +If the [CHANGELOG.md](CHANGELOG.md) contains any Incompatible Change, then increment +[`MAJOR`](lib/metasploit/model/version.rb) and reset [`MINOR`](lib/metasploit/model/version.rb and +[`PATCH`](lib/metasploit/model/version.rb) to `0`. ## Setup [CHANGELOG.md](CHANGELOG.md) for next release diff --git a/lib/metasploit/model.rb b/lib/metasploit/model.rb index a9168b8c..6c87c4e2 100644 --- a/lib/metasploit/model.rb +++ b/lib/metasploit/model.rb @@ -1,6 +1,11 @@ # # Gems # +# gems must load explicitly any gem declared in gemspec +# @see https://github.com/bundler/bundler/issues/2018#issuecomment-6819359 +# +# + require 'active_model' require 'active_support' diff --git a/lib/metasploit/model/engine.rb b/lib/metasploit/model/engine.rb index e0ca03e0..3e45ae62 100644 --- a/lib/metasploit/model/engine.rb +++ b/lib/metasploit/model/engine.rb @@ -14,7 +14,7 @@ class Metasploit::Model::Engine < Rails::Engine # Remove ActiveSupport::Dependencies loading paths to save time during constant resolution and to ensure that # metasploit-model is properly declaring all autoloads and not falling back on ActiveSupport::Dependencies - config.paths.each_value do |path| + config.paths.values.each do |path| path.skip_autoload! path.skip_autoload_once! path.skip_eager_load! diff --git a/lib/metasploit/model/version.rb b/lib/metasploit/model/version.rb index 5f855037..3531e47a 100644 --- a/lib/metasploit/model/version.rb +++ b/lib/metasploit/model/version.rb @@ -7,13 +7,13 @@ module Version # # The major version number. - MAJOR = 0 + MAJOR = 1 # The minor version number, scoped to the {MAJOR} version number. - MINOR = 30 + MINOR = 0 # The patch version number, scoped to the {MAJOR} and {MINOR} version numbers. - PATCH = 2 + PATCH = 0 # The prerelease version, scoped to the {MAJOR}, {MINOR}, and {PATCH} version numbers. - PRERELEASE = 'metasploit-version' + PRERELEASE = '1-0-0-plus' # # Module Methods diff --git a/metasploit-model.gemspec b/metasploit-model.gemspec index 5f94c6ef..31b44c38 100644 --- a/metasploit-model.gemspec +++ b/metasploit-model.gemspec @@ -28,8 +28,12 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'yard', '< 0.8.7.4' # Dependency loading - spec.add_runtime_dependency 'activesupport' - spec.add_runtime_dependency 'railties', '< 4.0.0' + rails_version_constraints = ['>= 4.0.9', '< 4.1.0'] + + spec.add_runtime_dependency 'activemodel', *rails_version_constraints + spec.add_runtime_dependency 'activesupport', *rails_version_constraints + + spec.add_runtime_dependency 'railties', *rails_version_constraints if RUBY_PLATFORM =~ /java/ # markdown formatting for yard diff --git a/spec/app/models/metasploit/model/search/operator/attribute_spec.rb b/spec/app/models/metasploit/model/search/operator/attribute_spec.rb index d248a29c..f81baf20 100644 --- a/spec/app/models/metasploit/model/search/operator/attribute_spec.rb +++ b/spec/app/models/metasploit/model/search/operator/attribute_spec.rb @@ -30,7 +30,7 @@ context 'validations' do it { is_expected.to validate_presence_of(:attribute) } - it { is_expected.to ensure_inclusion_of(:type).in_array(described_class::TYPES) } + it { is_expected.to validate_inclusion_of(:type).in_array(described_class::TYPES) } end context '#attribute_enumerable' do @@ -99,4 +99,4 @@ expect(name).to eq(attribute) end end -end \ No newline at end of file +end diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index df099fab..3d87b24b 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -1,6 +1,8 @@ require File.expand_path('../boot', __FILE__) -require 'rails/all' +# Pick the frameworks you want: +require 'active_model/railtie' +require "action_controller/railtie" Bundler.require(*Rails.groups) diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb index 4b7ab56c..71c78b18 100644 --- a/spec/dummy/config/environments/development.rb +++ b/spec/dummy/config/environments/development.rb @@ -16,9 +16,6 @@ # Print deprecation notices to the Rails logger config.active_support.deprecation = :log - # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin - # Do not compress assets config.assets.compress = false