From bffa2e962d49e8ef96040c8faa0a9db0eb8c7d7b Mon Sep 17 00:00:00 2001 From: Ho-Sheng Hsiao Date: Tue, 25 May 2010 19:58:45 -0400 Subject: [PATCH] [CORE/ARCH] Refactored remarkable to remarkable/core --- rake_helpers.rb | 2 +- remarkable/lib/remarkable.rb | 14 -------------- remarkable/lib/remarkable/core.rb | 15 +++++++++++++++ remarkable/lib/remarkable/{ => core}/base.rb | 0 .../lib/remarkable/{ => core}/core_ext/array.rb | 0 remarkable/lib/remarkable/{ => core}/dsl.rb | 6 +++--- .../lib/remarkable/{ => core}/dsl/assertions.rb | 0 .../lib/remarkable/{ => core}/dsl/callbacks.rb | 0 .../lib/remarkable/{ => core}/dsl/optionals.rb | 0 remarkable/lib/remarkable/{ => core}/i18n.rb | 0 remarkable/lib/remarkable/{ => core}/macros.rb | 0 remarkable/lib/remarkable/{ => core}/matchers.rb | 0 remarkable/lib/remarkable/{ => core}/messages.rb | 0 remarkable/lib/remarkable/{ => core}/negative.rb | 0 remarkable/lib/remarkable/{ => core}/rspec.rb | 0 remarkable/lib/remarkable/{ => core}/version.rb | 0 remarkable/spec/{lib => core}/base_spec.rb | 0 .../spec/{lib => core}/dsl/assertions_spec.rb | 0 .../spec/{lib => core}/dsl/optionals_spec.rb | 0 remarkable/spec/{lib => core}/i18n_spec.rb | 0 remarkable/spec/{lib => core}/macros_spec.rb | 0 remarkable/spec/{lib => core}/matchers_spec.rb | 0 remarkable/spec/{lib => core}/messages_spec.rb | 0 remarkable/spec/{lib => core}/pending_spec.rb | 0 remarkable/spec/spec_helper.rb | 2 +- .../lib/remarkable/active_model.rb | 2 +- .../lib/remarkable_activemodel.rb | 5 ----- 27 files changed, 21 insertions(+), 25 deletions(-) delete mode 100644 remarkable/lib/remarkable.rb create mode 100644 remarkable/lib/remarkable/core.rb rename remarkable/lib/remarkable/{ => core}/base.rb (100%) rename remarkable/lib/remarkable/{ => core}/core_ext/array.rb (100%) rename remarkable/lib/remarkable/{ => core}/dsl.rb (93%) rename remarkable/lib/remarkable/{ => core}/dsl/assertions.rb (100%) rename remarkable/lib/remarkable/{ => core}/dsl/callbacks.rb (100%) rename remarkable/lib/remarkable/{ => core}/dsl/optionals.rb (100%) rename remarkable/lib/remarkable/{ => core}/i18n.rb (100%) rename remarkable/lib/remarkable/{ => core}/macros.rb (100%) rename remarkable/lib/remarkable/{ => core}/matchers.rb (100%) rename remarkable/lib/remarkable/{ => core}/messages.rb (100%) rename remarkable/lib/remarkable/{ => core}/negative.rb (100%) rename remarkable/lib/remarkable/{ => core}/rspec.rb (100%) rename remarkable/lib/remarkable/{ => core}/version.rb (100%) rename remarkable/spec/{lib => core}/base_spec.rb (100%) rename remarkable/spec/{lib => core}/dsl/assertions_spec.rb (100%) rename remarkable/spec/{lib => core}/dsl/optionals_spec.rb (100%) rename remarkable/spec/{lib => core}/i18n_spec.rb (100%) rename remarkable/spec/{lib => core}/macros_spec.rb (100%) rename remarkable/spec/{lib => core}/matchers_spec.rb (100%) rename remarkable/spec/{lib => core}/messages_spec.rb (100%) rename remarkable/spec/{lib => core}/pending_spec.rb (100%) delete mode 100644 remarkable_activemodel/lib/remarkable_activemodel.rb diff --git a/rake_helpers.rb b/rake_helpers.rb index a132a30..f783f17 100644 --- a/rake_helpers.rb +++ b/rake_helpers.rb @@ -1,6 +1,6 @@ # encoding: utf-8 current_dir = File.dirname(__FILE__) -require File.join(current_dir, "remarkable/lib/remarkable/version.rb") +require File.join(current_dir, "remarkable/lib/remarkable/core/version.rb") require 'rubygems' require 'rake/gempackagetask' diff --git a/remarkable/lib/remarkable.rb b/remarkable/lib/remarkable.rb deleted file mode 100644 index 4e47466..0000000 --- a/remarkable/lib/remarkable.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Load core files -require 'remarkable/version' -require 'remarkable/matchers' -require 'remarkable/macros' -require 'remarkable/i18n' -require 'remarkable/dsl' -require 'remarkable/messages' -require 'remarkable/base' -require 'remarkable/negative' -require 'remarkable/core_ext/array' -require 'remarkable/rspec' - -dir = File.dirname(__FILE__) -Remarkable.add_locale File.join(dir, '..', 'locale', 'en.yml') diff --git a/remarkable/lib/remarkable/core.rb b/remarkable/lib/remarkable/core.rb new file mode 100644 index 0000000..5b89b62 --- /dev/null +++ b/remarkable/lib/remarkable/core.rb @@ -0,0 +1,15 @@ +# Load core files +require 'remarkable/core/version' +require 'remarkable/core/matchers' +require 'remarkable/core/macros' +require 'remarkable/core/i18n' +require 'remarkable/core/dsl' +require 'remarkable/core/messages' +require 'remarkable/core/base' +require 'remarkable/core/negative' +require 'remarkable/core/core_ext/array' +require 'remarkable/core/rspec' + +# Add default locale +dir = File.dirname(__FILE__) +Dir["#{dir}/../../locale/*yml"].each {|f| Remarkable.add_locale(f) } diff --git a/remarkable/lib/remarkable/base.rb b/remarkable/lib/remarkable/core/base.rb similarity index 100% rename from remarkable/lib/remarkable/base.rb rename to remarkable/lib/remarkable/core/base.rb diff --git a/remarkable/lib/remarkable/core_ext/array.rb b/remarkable/lib/remarkable/core/core_ext/array.rb similarity index 100% rename from remarkable/lib/remarkable/core_ext/array.rb rename to remarkable/lib/remarkable/core/core_ext/array.rb diff --git a/remarkable/lib/remarkable/dsl.rb b/remarkable/lib/remarkable/core/dsl.rb similarity index 93% rename from remarkable/lib/remarkable/dsl.rb rename to remarkable/lib/remarkable/core/dsl.rb index a2984ba..92d9bd3 100644 --- a/remarkable/lib/remarkable/dsl.rb +++ b/remarkable/lib/remarkable/core/dsl.rb @@ -1,6 +1,6 @@ -require 'remarkable/dsl/assertions' -require 'remarkable/dsl/optionals' -require 'remarkable/dsl/callbacks' +require 'remarkable/core/dsl/assertions' +require 'remarkable/core/dsl/optionals' +require 'remarkable/core/dsl/callbacks' module Remarkable # The DSL module is responsable for all Remarkable convenience methods. diff --git a/remarkable/lib/remarkable/dsl/assertions.rb b/remarkable/lib/remarkable/core/dsl/assertions.rb similarity index 100% rename from remarkable/lib/remarkable/dsl/assertions.rb rename to remarkable/lib/remarkable/core/dsl/assertions.rb diff --git a/remarkable/lib/remarkable/dsl/callbacks.rb b/remarkable/lib/remarkable/core/dsl/callbacks.rb similarity index 100% rename from remarkable/lib/remarkable/dsl/callbacks.rb rename to remarkable/lib/remarkable/core/dsl/callbacks.rb diff --git a/remarkable/lib/remarkable/dsl/optionals.rb b/remarkable/lib/remarkable/core/dsl/optionals.rb similarity index 100% rename from remarkable/lib/remarkable/dsl/optionals.rb rename to remarkable/lib/remarkable/core/dsl/optionals.rb diff --git a/remarkable/lib/remarkable/i18n.rb b/remarkable/lib/remarkable/core/i18n.rb similarity index 100% rename from remarkable/lib/remarkable/i18n.rb rename to remarkable/lib/remarkable/core/i18n.rb diff --git a/remarkable/lib/remarkable/macros.rb b/remarkable/lib/remarkable/core/macros.rb similarity index 100% rename from remarkable/lib/remarkable/macros.rb rename to remarkable/lib/remarkable/core/macros.rb diff --git a/remarkable/lib/remarkable/matchers.rb b/remarkable/lib/remarkable/core/matchers.rb similarity index 100% rename from remarkable/lib/remarkable/matchers.rb rename to remarkable/lib/remarkable/core/matchers.rb diff --git a/remarkable/lib/remarkable/messages.rb b/remarkable/lib/remarkable/core/messages.rb similarity index 100% rename from remarkable/lib/remarkable/messages.rb rename to remarkable/lib/remarkable/core/messages.rb diff --git a/remarkable/lib/remarkable/negative.rb b/remarkable/lib/remarkable/core/negative.rb similarity index 100% rename from remarkable/lib/remarkable/negative.rb rename to remarkable/lib/remarkable/core/negative.rb diff --git a/remarkable/lib/remarkable/rspec.rb b/remarkable/lib/remarkable/core/rspec.rb similarity index 100% rename from remarkable/lib/remarkable/rspec.rb rename to remarkable/lib/remarkable/core/rspec.rb diff --git a/remarkable/lib/remarkable/version.rb b/remarkable/lib/remarkable/core/version.rb similarity index 100% rename from remarkable/lib/remarkable/version.rb rename to remarkable/lib/remarkable/core/version.rb diff --git a/remarkable/spec/lib/base_spec.rb b/remarkable/spec/core/base_spec.rb similarity index 100% rename from remarkable/spec/lib/base_spec.rb rename to remarkable/spec/core/base_spec.rb diff --git a/remarkable/spec/lib/dsl/assertions_spec.rb b/remarkable/spec/core/dsl/assertions_spec.rb similarity index 100% rename from remarkable/spec/lib/dsl/assertions_spec.rb rename to remarkable/spec/core/dsl/assertions_spec.rb diff --git a/remarkable/spec/lib/dsl/optionals_spec.rb b/remarkable/spec/core/dsl/optionals_spec.rb similarity index 100% rename from remarkable/spec/lib/dsl/optionals_spec.rb rename to remarkable/spec/core/dsl/optionals_spec.rb diff --git a/remarkable/spec/lib/i18n_spec.rb b/remarkable/spec/core/i18n_spec.rb similarity index 100% rename from remarkable/spec/lib/i18n_spec.rb rename to remarkable/spec/core/i18n_spec.rb diff --git a/remarkable/spec/lib/macros_spec.rb b/remarkable/spec/core/macros_spec.rb similarity index 100% rename from remarkable/spec/lib/macros_spec.rb rename to remarkable/spec/core/macros_spec.rb diff --git a/remarkable/spec/lib/matchers_spec.rb b/remarkable/spec/core/matchers_spec.rb similarity index 100% rename from remarkable/spec/lib/matchers_spec.rb rename to remarkable/spec/core/matchers_spec.rb diff --git a/remarkable/spec/lib/messages_spec.rb b/remarkable/spec/core/messages_spec.rb similarity index 100% rename from remarkable/spec/lib/messages_spec.rb rename to remarkable/spec/core/messages_spec.rb diff --git a/remarkable/spec/lib/pending_spec.rb b/remarkable/spec/core/pending_spec.rb similarity index 100% rename from remarkable/spec/lib/pending_spec.rb rename to remarkable/spec/core/pending_spec.rb diff --git a/remarkable/spec/spec_helper.rb b/remarkable/spec/spec_helper.rb index c50bc83..354d8ee 100644 --- a/remarkable/spec/spec_helper.rb +++ b/remarkable/spec/spec_helper.rb @@ -6,7 +6,7 @@ require File.expand_path('path_helpers', File.join(File.dirname(__FILE__), '/../../')) load_project_path :remarkable -require 'remarkable' +require 'remarkable/core' # Requires supporting files with custom matchers and macros, etc, # # in ./support/ and its subdirectories. diff --git a/remarkable_activemodel/lib/remarkable/active_model.rb b/remarkable_activemodel/lib/remarkable/active_model.rb index a892e4c..3955894 100644 --- a/remarkable_activemodel/lib/remarkable/active_model.rb +++ b/remarkable_activemodel/lib/remarkable/active_model.rb @@ -1,5 +1,5 @@ # Load Remarkable -require 'remarkable' +require 'remarkable/core' require 'remarkable/active_model/base' # Add default locale diff --git a/remarkable_activemodel/lib/remarkable_activemodel.rb b/remarkable_activemodel/lib/remarkable_activemodel.rb deleted file mode 100644 index a3133fb..0000000 --- a/remarkable_activemodel/lib/remarkable_activemodel.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load Remarkable ActiveModel files -dir = File.dirname(__FILE__) -require File.join(dir, 'remarkable', 'active_model') - -Remarkable.include_matchers!(Remarkable::ActiveModel, Rspec::Core::ExampleGroup)