diff --git a/CHANGELOG.md b/CHANGELOG.md index 30f3709159..197299c801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## Branch 0.17 + +###### TODO + +- Add `s.exclude_source_files` and related attributes to the specification class. + +###### Enhancements + +- Added PathList class. + +- Added Podfile to the Pods project. + [#476](https://github.com/CocoaPods/CocoaPods/issues/476) + ## Master [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.16.0.rc2...master) • [Xcodeproj](https://github.com/CocoaPods/Xcodeproj/compare/0.4.0.rc1...master) diff --git a/lib/cocoapods/local_pod.rb b/lib/cocoapods/local_pod.rb index 7225e3bf35..1426d88f97 100644 --- a/lib/cocoapods/local_pod.rb +++ b/lib/cocoapods/local_pod.rb @@ -21,7 +21,7 @@ module Pod # returns absolute paths. # class LocalPod - autoload :DirList, 'cocoapods/local_pod/dir_list' + autoload :PathList, 'cocoapods/local_pod/path_list' # @return [Specification] The specification that describes the pod. # @@ -95,8 +95,8 @@ def root @sandbox.root + top_specification.name end - def dir_list - @dir_list ||= DirList.new(root) + def path_list + @path_list ||= PathList.new(root) end # @return [String] A string representation of the pod which indicates if @@ -161,7 +161,7 @@ def local? def clean! clean_paths.each { |path| FileUtils.rm_rf(path) } @cleaned = true - dir_list.read_file_system + path_list.read_file_system end # Finds the absolute paths, including hidden ones, of the files @@ -577,7 +577,7 @@ def expanded_paths(patterns, dir_pattern = nil, exclude_patterns = nil) result = [] - result << dir_list.glob(glob_patterns, dir_pattern, exclude_patterns) + result << path_list.glob(glob_patterns, dir_pattern, exclude_patterns) result << file_lists.map do |file_list| file_list.prepend_patterns(root) diff --git a/lib/cocoapods/local_pod/dir_list.rb b/lib/cocoapods/local_pod/path_list.rb similarity index 94% rename from lib/cocoapods/local_pod/dir_list.rb rename to lib/cocoapods/local_pod/path_list.rb index 8c28c9adf4..94aee3e524 100644 --- a/lib/cocoapods/local_pod/dir_list.rb +++ b/lib/cocoapods/local_pod/path_list.rb @@ -1,23 +1,23 @@ module Pod class LocalPod - # The {DirList} class is designed to perform multiple glob matches against + # The {PathList} class is designed to perform multiple glob matches against # a given directory. Basically, it generates a list of all the children # paths and matches the globs patterns against them, resulting in just # one access to the file system. # - # @note A {DirList} once it has generated the list of the paths this is + # @note A {PathList} once it has generated the list of the paths this is # updated only if explicitly requested by calling - # {DirList#read_file_system} + # {PathList#read_file_system} # - class DirList + class PathList # @return [Pathname] The root of the list whose files and directories # are used to perform the matching operations. # attr_accessor :root - # @param [Pathname] root The root of the DirList. + # @param [Pathname] root The root of the PathList. # def initialize(root) @root = root @@ -150,6 +150,6 @@ def dir_glob_equivalent_patterns(pattern) patterns end end - end # DirList + end # PathList end # LocalPod end # Pod diff --git a/spec/unit/local_pod/dir_list.rb b/spec/unit/local_pod/path_list_spec.rb similarity index 68% rename from spec/unit/local_pod/dir_list.rb rename to spec/unit/local_pod/path_list_spec.rb index 396dc4caad..cf2794cf07 100644 --- a/spec/unit/local_pod/dir_list.rb +++ b/spec/unit/local_pod/path_list_spec.rb @@ -1,13 +1,13 @@ require File.expand_path('../../../spec_helper', __FILE__) -describe Pod::LocalPod::DirList do +describe Pod::LocalPod::PathList do before do - @dir_list = Pod::LocalPod::DirList.new(fixture('banana-lib')) + @path_list = Pod::LocalPod::PathList.new(fixture('banana-lib')) end it "creates the list of all the files" do - files = @dir_list.files + files = @path_list.files files.reject! do |f| f.include?('libPusher') || f.include?('.git') || f.include?('DS_Store') end @@ -20,7 +20,7 @@ end it "creates theh list of the directories" do - dirs = @dir_list.dirs + dirs = @path_list.dirs dirs.reject! do |f| f.include?('libPusher') || f.include?('.git') end @@ -28,55 +28,55 @@ end it "detects a directory" do - @dir_list.directory?('classes').should == true + @path_list.directory?('classes').should == true end it "doesn't reports as a directory a file" do - @dir_list.directory?('Classes/Banana.m').should == false + @path_list.directory?('Classes/Banana.m').should == false end it "can glob the root for a given pattern" do - paths = @dir_list.relative_glob('Classes/*.{h,m}').map(&:to_s) + paths = @path_list.relative_glob('Classes/*.{h,m}').map(&:to_s) paths.should == %w| Classes/Banana.h Classes/Banana.m | end it "supports the `**` glob pattern" do - paths = @dir_list.relative_glob('Classes/**/*.{h,m}').map(&:to_s) + paths = @path_list.relative_glob('Classes/**/*.{h,m}').map(&:to_s) paths.should == %w| Classes/Banana.h Classes/Banana.m | end it "supports an optional pattern for globbing directories" do - paths = @dir_list.relative_glob('Classes', '*.{h,m}').map(&:to_s) + paths = @path_list.relative_glob('Classes', '*.{h,m}').map(&:to_s) paths.should == %w| Classes/Banana.h Classes/Banana.m | end it "can return the absolute paths from glob" do - paths = @dir_list.glob('Classes/*.{h,m}') + paths = @path_list.glob('Classes/*.{h,m}') paths.all? { |p| p.absolute? }.should == true end it "can return the relative paths from glob" do - paths = @dir_list.relative_glob('Classes/*.{h,m}') + paths = @path_list.relative_glob('Classes/*.{h,m}') paths.any? { |p| p.absolute? }.should == false end it "expands a pattern into all the combinations of Dir#glob literals" do - patterns = @dir_list.dir_glob_equivalent_patterns('{file1,file2}.{h,m}') + patterns = @path_list.dir_glob_equivalent_patterns('{file1,file2}.{h,m}') patterns.sort.should == %w| file1.h file1.m file2.h file2.m | end it "returns the original patter if there are no Dir#glob expansions" do - patterns = @dir_list.dir_glob_equivalent_patterns('file*.*') + patterns = @path_list.dir_glob_equivalent_patterns('file*.*') patterns.sort.should == %w| file*.* | end it "expands `**`" do - patterns = @dir_list.dir_glob_equivalent_patterns('Classes/**/file.m') + patterns = @path_list.dir_glob_equivalent_patterns('Classes/**/file.m') patterns.sort.should == %w| Classes/**/file.m Classes/file.m | end it "supports a combination of `**` and literals" do - patterns = @dir_list.dir_glob_equivalent_patterns('Classes/**/file.{h,m}') + patterns = @path_list.dir_glob_equivalent_patterns('Classes/**/file.{h,m}') patterns.sort.should == %w| Classes/**/file.h Classes/**/file.m Classes/file.h Classes/file.m | end end