Commit a0d280f6 authored by Marin Usalj's avatar Marin Usalj

renamed ConfigManager to Manager and ConfigEnvironment to Environment

parent 2f9df10d
...@@ -81,7 +81,7 @@ PROFILE_ERB_TEMPLATE = <<-EOS ...@@ -81,7 +81,7 @@ PROFILE_ERB_TEMPLATE = <<-EOS
#"^<%= ruby_prefix %>" #"^<%= ruby_prefix %>"
#"^<%= pod_prefix %>" #"^<%= pod_prefix %>"
#"^<%= xcode_app_path %>" #"^<%= xcode_app_path %>"
#"^<%= Pod::Config::ConfigEnvironment.repos_dir %>" #"^<%= Pod::Config::Environment.instance.repos_dir %>"
<% prefixes.each do |prefix| %> <% prefixes.each do |prefix| %>
#"^<%= prefix %>/*" #"^<%= prefix %>/*"
<% end %> <% end %>
...@@ -94,8 +94,8 @@ PROFILE_ERB_TEMPLATE = <<-EOS ...@@ -94,8 +94,8 @@ PROFILE_ERB_TEMPLATE = <<-EOS
"/dev/null" "/dev/null"
) )
(regex (regex
#"^<%= Pod::Config::ConfigEnvironment.instance.project_root %>" #"^<%= Pod::Config::Environment.instance.project_root %>"
#"^<%= Pod::Config::ConfigEnvironment.instance.repos_dir %>" #"^<%= Pod::Config::Environment.instance.repos_dir %>"
#"^/Users/[^.]+/Library/Caches/CocoaPods/*" #"^/Users/[^.]+/Library/Caches/CocoaPods/*"
#"^/dev/tty" #"^/dev/tty"
#"^/private/var" #"^/private/var"
......
...@@ -23,7 +23,7 @@ module Pod ...@@ -23,7 +23,7 @@ module Pod
require 'cocoapods/command/spec' require 'cocoapods/command/spec'
require 'cocoapods/command/init' require 'cocoapods/command/init'
include Pod::Config::Manager include Pod::Config
self.abstract_command = true self.abstract_command = true
self.default_subcommand = 'install' self.default_subcommand = 'install'
......
...@@ -17,7 +17,7 @@ module Pod ...@@ -17,7 +17,7 @@ module Pod
# #
class Config < Command class Config < Command
include Pod::Config::Manager include Pod::Config
self.summary = 'Something like `bundle config` ... but better.' self.summary = 'Something like `bundle config` ... but better.'
self.description = <<-DESC self.description = <<-DESC
......
...@@ -9,32 +9,27 @@ module Pod ...@@ -9,32 +9,27 @@ module Pod
# #
module Config module Config
autoload :ConfigManager, 'cocoapods/config/config_manager' autoload :Manager, 'cocoapods/config/config_manager'
autoload :ConfigEnvironment, 'cocoapods/config/environment' autoload :Environment, 'cocoapods/config/environment'
# Provides support for accessing the configuration manager # Provides support for accessing the configuration manager
# instance in other scopes. # instance in other scopes.
# #
module Manager
def config def config
ConfigManager.instance Manager.instance
end
end end
# Provides support for accessing the environment instance in other # Provides support for accessing the environment instance in other
# scopes. # scopes.
# #
module Environment
def environment def environment
ConfigEnvironment.instance Environment.instance
end
end end
public public
extend Environment #extend Environment
extend Manager #extend Manager
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
# @!group Dependency Injection # @!group Dependency Injection
......
...@@ -7,7 +7,7 @@ module Pod ...@@ -7,7 +7,7 @@ module Pod
# The config manager is responsible for reading and writing the config.yaml # The config manager is responsible for reading and writing the config.yaml
# file. # file.
# #
class ConfigManager class Manager
# The default settings for the configuration. # The default settings for the configuration.
...@@ -106,7 +106,7 @@ module Pod ...@@ -106,7 +106,7 @@ module Pod
# @return [Pathname] The path of the file which contains the user settings. # @return [Pathname] The path of the file which contains the user settings.
# #
def global_config_filepath def global_config_filepath
Config::ConfigEnvironment.instance.home_dir + "config.yaml" Config::Environment.instance.home_dir + "config.yaml"
end end
def local_config_filepath def local_config_filepath
......
...@@ -7,7 +7,7 @@ module Pod ...@@ -7,7 +7,7 @@ module Pod
# The config manager is responsible for reading and writing the config.yaml # The config manager is responsible for reading and writing the config.yaml
# file. # file.
# #
class ConfigEnvironment class Environment
# @!group Singleton # @!group Singleton
......
...@@ -13,7 +13,7 @@ module Pod ...@@ -13,7 +13,7 @@ module Pod
# #
module Executable module Executable
extend Pod::Config::Manager extend Pod::Config
# Creates the methods for the executable with the given name. # Creates the methods for the executable with the given name.
# #
......
...@@ -36,8 +36,7 @@ module Pod ...@@ -36,8 +36,7 @@ module Pod
autoload :PodTargetInstaller, 'cocoapods/installer/target_installer/pod_target_installer' autoload :PodTargetInstaller, 'cocoapods/installer/target_installer/pod_target_installer'
autoload :UserProjectIntegrator, 'cocoapods/installer/user_project_integrator' autoload :UserProjectIntegrator, 'cocoapods/installer/user_project_integrator'
include Config::Manager include Config
include Config::Environment
# @return [Sandbox] The sandbox where the Pods should be installed. # @return [Sandbox] The sandbox where the Pods should be installed.
......
...@@ -6,8 +6,7 @@ module Pod ...@@ -6,8 +6,7 @@ module Pod
# #
class Analyzer class Analyzer
include Config::Manager include Config
include Config::Environment
autoload :SandboxAnalyzer, 'cocoapods/installer/analyzer/sandbox_analyzer' autoload :SandboxAnalyzer, 'cocoapods/installer/analyzer/sandbox_analyzer'
......
...@@ -6,8 +6,7 @@ module Pod ...@@ -6,8 +6,7 @@ module Pod
class << self class << self
include Config::Manager include Config
include Config::Environment
# @return [Source::Aggregate] the aggregate of all the sources known to # @return [Source::Aggregate] the aggregate of all the sources known to
# this installation of CocoaPods. # this installation of CocoaPods.
......
...@@ -17,8 +17,7 @@ module Pod ...@@ -17,8 +17,7 @@ module Pod
class << self class << self
include Config::Manager include Config
include Config::Environment
attr_accessor :indentation_level attr_accessor :indentation_level
attr_accessor :title_level attr_accessor :title_level
......
...@@ -11,8 +11,7 @@ module Pod ...@@ -11,8 +11,7 @@ module Pod
# #
class Validator class Validator
include Config::Manager include Config
include Config::Environment
# @return [Specification::Linter] the linter instance from CocoaPods # @return [Specification::Linter] the linter instance from CocoaPods
# Core. # Core.
......
...@@ -15,7 +15,7 @@ module Pod ...@@ -15,7 +15,7 @@ module Pod
before do before do
FileUtils.rm_rf(@config_file_path) FileUtils.rm_rf(@config_file_path)
@subject = Config::ConfigManager.new @subject = Config::Manager.new
# TODO: stub the file accessor # TODO: stub the file accessor
end end
......
...@@ -79,8 +79,7 @@ Bacon.summary_at_exit ...@@ -79,8 +79,7 @@ Bacon.summary_at_exit
module Bacon module Bacon
class Context class Context
include Pod::Config::Manager include Pod::Config
include Pod::Config::Environment
include SpecHelper::Fixture include SpecHelper::Fixture
include SpecHelper::Command include SpecHelper::Command
......
...@@ -3,7 +3,7 @@ require 'yaml' ...@@ -3,7 +3,7 @@ require 'yaml'
module Pod module Pod
describe Config::ConfigManager do describe Config::Manager do
describe "global" do describe "global" do
...@@ -11,11 +11,11 @@ module Pod ...@@ -11,11 +11,11 @@ module Pod
before do before do
FileUtils.rm_rf(@config_file_path) FileUtils.rm_rf(@config_file_path)
@subject = Config::ConfigManager.new @subject = Config::Manager.new
end end
it "has a singleton" do it "has a singleton" do
Config::ConfigManager.instance.should === Config::ConfigManager.instance Config::Manager.instance.should === Config::Manager.instance
end end
it "creates a global config file if one didn't exist" do it "creates a global config file if one didn't exist" do
......
...@@ -2,9 +2,9 @@ require File.expand_path('../../../spec_helper', __FILE__) ...@@ -2,9 +2,9 @@ require File.expand_path('../../../spec_helper', __FILE__)
module Pod module Pod
describe Config::ConfigEnvironment do describe Config::Environment do
before do before do
@sut = Config::ConfigEnvironment.new @sut = Config::Environment.new
end end
describe "In general" do describe "In general" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment