Permalink
Browse files

renamed module namespace

  • Loading branch information...
manifest committed Jun 14, 2012
1 parent d934067 commit 9bdf6c51aee160592684163ddc35eb2543a4fb40
@@ -1,7 +1,7 @@
require 'xcodeproject/node'
require 'xcodeproject/pbx_build_file'
-module XCodeProject
+module XcodeProject
class BuildPhaseNode < Node
def initialize (root, uuid, data)
super(root, uuid, data)
View
@@ -22,7 +22,7 @@
require 'xcodeproject/root_node'
-module XCodeProject
+module XcodeProject
class Data
def initialize (data, wd)
@root = RootNode.new(data, wd)
@@ -1,4 +1,4 @@
-module XCodeProject
+module XcodeProject
class ParseError < StandardError; end
class FilePathError < StandardError; end
class GroupPathError < StandardError; end
@@ -1,7 +1,7 @@
require 'xcodeproject/formatter'
class Array
- def to_plist (fmtr = XCodeProject::Formatter.new)
+ def to_plist (fmtr = XcodeProject::Formatter.new)
items = map { |item| "#{item.to_plist(fmtr)}" }
%{(#{fmtr.t2}#{items.join(",#{fmtr.t2}")}#{fmtr.t1})}
end
@@ -1,7 +1,7 @@
require 'xcodeproject/formatter'
class Hash
- def to_plist (fmtr = XCodeProject::Formatter.new)
+ def to_plist (fmtr = XcodeProject::Formatter.new)
fmtr.inc
items = map { |key, value| "#{key.to_plist(fmtr)} = #{value.to_plist(fmtr)};" }
fmtr.dec
@@ -1,7 +1,7 @@
require 'xcodeproject/node'
require 'pathname'
-module XCodeProject
+module XcodeProject
class FileNode < Node
attr_reader :name
attr_reader :path
@@ -1,4 +1,4 @@
-module XCodeProject
+module XcodeProject
class Formatter
def initialize
@counter = 0
View
@@ -1,4 +1,4 @@
-module XCodeProject
+module XcodeProject
class Node
attr_reader :uuid
attr_reader :isa
@@ -1,6 +1,6 @@
require 'xcodeproject/node'
-module XCodeProject
+module XcodeProject
class PBXBuildFile < Node
attr_reader :file_ref
@@ -1,7 +1,7 @@
require 'xcodeproject/file_node'
require 'xcodeproject/exceptions'
-module XCodeProject
+module XcodeProject
class PBXFileReference < FileNode
def initialize (root, uuid, data)
super(root, uuid, data)
@@ -2,7 +2,7 @@
require 'xcodeproject/exceptions'
require 'pathname'
-module XCodeProject
+module XcodeProject
class PBXGroup < FileNode
def initialize (root, uuid, data)
super(root, uuid, data)
@@ -1,7 +1,7 @@
require 'xcodeproject/xc_configuration_list'
require 'xcodeproject/build_phase_node'
-module XCodeProject
+module XcodeProject
class PBXNativeTarget < Node
attr_reader :name
attr_reader :product_name
@@ -1,6 +1,6 @@
require 'xcodeproject/node'
-module XCodeProject
+module XcodeProject
class PBXProject < Node
attr_reader :main_group
attr_reader :product_ref_group
@@ -24,7 +24,7 @@
require 'pathname'
require 'find'
-module XCodeProject
+module XcodeProject
class Project
attr_reader :bundle_path
attr_reader :file_path
@@ -31,7 +31,7 @@
require 'xcodeproject/extend/array'
require 'xcodeproject/extend/hash'
-module XCodeProject
+module XcodeProject
class RootNode
def initialize (data, wd)
@data, @wd = data, Pathname.new(wd)
@@ -50,7 +50,7 @@ def build_files (file_ref_uuid)
def object (uuid)
data = @objects[uuid]
- XCodeProject.const_get(data['isa']).new(self, uuid, data) unless data.nil?
+ XcodeProject.const_get(data['isa']).new(self, uuid, data) unless data.nil?
end
def object! (uuid)
@@ -1,6 +1,6 @@
require "spec_helper"
-describe XCodeProject::BuildPhaseNode do
+describe XcodeProject::BuildPhaseNode do
let(:root) { prepare_example_project.read.send(:root) }
let(:file_ref) { root.project.main_group.file_ref('group1a/file2c.m') }
let(:build_file) { root.project.target('example').sources_build_phase.send(:build_file, file_ref.uuid) }
@@ -9,7 +9,7 @@
describe "#files" do
it "returns an array of files" do
obj.files.should be_an_instance_of(Array)
- obj.files.each {|obj| obj.should be_an_instance_of(XCodeProject::PBXFileReference) }
+ obj.files.each {|obj| obj.should be_an_instance_of(XcodeProject::PBXFileReference) }
end
end
@@ -56,19 +56,19 @@
describe "#build_files" do
it "returns an array of files" do
obj.send(:build_files).should be_an_instance_of(Array)
- obj.send(:build_files).each {|obj| obj.should be_an_instance_of(XCodeProject::PBXBuildFile) }
+ obj.send(:build_files).each {|obj| obj.should be_an_instance_of(XcodeProject::PBXBuildFile) }
end
end
describe "#build_file" do
it "returns the object" do
- obj.send(:build_file, file_ref.uuid).should be_an_instance_of(XCodeProject::PBXBuildFile)
+ obj.send(:build_file, file_ref.uuid).should be_an_instance_of(XcodeProject::PBXBuildFile)
end
end
describe "#add_build_file" do
it "adds the build file, returns the object" do
- obj.send(:add_build_file, file_ref.uuid).should be_an_instance_of(XCodeProject::PBXBuildFile)
+ obj.send(:add_build_file, file_ref.uuid).should be_an_instance_of(XcodeProject::PBXBuildFile)
end
end
@@ -1,6 +1,6 @@
require "spec_helper"
-describe XCodeProject::FileNode do
+describe XcodeProject::FileNode do
let(:data_name) { Hash['name', 'file.name'] }
let(:data_path) { Hash['path', 'path/to/file.name'] }
let(:data_path_name) { data_path.merge!(data_name) }
@@ -10,19 +10,19 @@
context "if the name is initialized " do
it "returns the name as is" do
[data_name, data_path_name].each do |data|
- XCodeProject::FileNode.new(stub, stub, data).name.should eql(data['name'])
+ XcodeProject::FileNode.new(stub, stub, data).name.should eql(data['name'])
end
end
end
context "if the name isn't initialized" do
context "and the path is initialized " do
it "returns the name as basename of the path" do
- XCodeProject::FileNode.new(stub, stub, data_path).name.should eql(File.basename(data_path['path']))
+ XcodeProject::FileNode.new(stub, stub, data_path).name.should eql(File.basename(data_path['path']))
end
end
context "and the path isn't initialized" do
it "returns nil" do
- XCodeProject::FileNode.new(stub, stub, data_empty).name.should be_nil
+ XcodeProject::FileNode.new(stub, stub, data_empty).name.should be_nil
end
end
end
@@ -32,13 +32,13 @@
context "if the path is initialized " do
it "returns the path as is" do
[data_path, data_path_name].each do |data|
- XCodeProject::FileNode.new(stub, stub, data_path).path.should eql(data['path'])
+ XcodeProject::FileNode.new(stub, stub, data_path).path.should eql(data['path'])
end
end
end
context "if the path isn't initialized" do
it "returns nil" do
- XCodeProject::FileNode.new(stub, stub, data_empty).path.should be_nil
+ XcodeProject::FileNode.new(stub, stub, data_empty).path.should be_nil
end
end
end
@@ -58,7 +58,7 @@
context "if the object is nested file node" do
it "returns the parent object" do
file_nodes_gpaths do |gpath|
- main_group.child(gpath).parent.should be_an_instance_of(XCodeProject::PBXGroup)
+ main_group.child(gpath).parent.should be_an_instance_of(XcodeProject::PBXGroup)
end
end
end
@@ -1,13 +1,13 @@
require "spec_helper"
-describe XCodeProject::PBXBuildFile do
+describe XcodeProject::PBXBuildFile do
let(:root) { prepare_example_project.read.send(:root) }
let(:obj_file_ref) { root.project.main_group.file_ref("group1a/file2c.m") }
let(:obj) { root.project.target('example').sources_build_phase.send(:build_file, obj_file_ref.uuid) }
describe "#file_ref" do
it "returns the object" do
- obj.file_ref.should be_an_instance_of(XCodeProject::PBXFileReference)
+ obj.file_ref.should be_an_instance_of(XcodeProject::PBXFileReference)
end
end
@@ -1,6 +1,6 @@
require "spec_helper"
-describe XCodeProject::PBXFileReference do
+describe XcodeProject::PBXFileReference do
let(:root) { prepare_example_project.read.send(:root) }
let(:obj_gpath) { "group1a/file2c.m" }
let(:obj) { root.project.main_group.file_ref(obj_gpath) }
@@ -1,6 +1,6 @@
require "spec_helper"
-describe XCodeProject::PBXGroup do
+describe XcodeProject::PBXGroup do
let(:root) { prepare_example_project.read.send(:root) }
let(:obj) { root.project.main_group.group('group1a') }
@@ -101,7 +101,7 @@
describe "#group" do
context "if the group exists" do
it "returns the object" do
- obj.group('group2a').should be_an_instance_of(XCodeProject::PBXGroup)
+ obj.group('group2a').should be_an_instance_of(XcodeProject::PBXGroup)
end
end
context "if the group doesn't exist" do
@@ -114,7 +114,7 @@
describe "#file_ref" do
context "if the file reference exists" do
it "returns the object" do
- obj.file_ref('file2c.m').should be_an_instance_of(XCodeProject::PBXFileReference)
+ obj.file_ref('file2c.m').should be_an_instance_of(XcodeProject::PBXFileReference)
end
end
context "if the file reference doesn't exist" do
@@ -127,12 +127,12 @@
describe "#add_file_ref" do
context "if passed the relative path" do
it "adds the file reference, returns the object" do
- obj.send(:add_file_ref, 'dir1b/file2b.m').should be_an_instance_of(XCodeProject::PBXFileReference)
+ obj.send(:add_file_ref, 'dir1b/file2b.m').should be_an_instance_of(XcodeProject::PBXFileReference)
end
end
context "if passed the absolute path" do
it "adds the file reference, returns the object" do
- obj.send(:add_file_ref, "#{example_project_dir}/dir1b/file2b.m").should be_an_instance_of(XCodeProject::PBXFileReference)
+ obj.send(:add_file_ref, "#{example_project_dir}/dir1b/file2b.m").should be_an_instance_of(XcodeProject::PBXFileReference)
end
end
context "if file reference already exists" do
@@ -143,23 +143,23 @@
end
context "if file doesn't exit" do
it "raise an exception " do
- lambda { obj.send(:add_file_ref, "file2c_ghost.m") }.should raise_exception(XCodeProject::FilePathError)
+ lambda { obj.send(:add_file_ref, "file2c_ghost.m") }.should raise_exception(XcodeProject::FilePathError)
end
end
end
describe "#add_group" do
it "adds the group, returns the object" do
group_obj = obj.add_group("group2a_ghost")
- group_obj.should be_an_instance_of(XCodeProject::PBXGroup)
+ group_obj.should be_an_instance_of(XcodeProject::PBXGroup)
group_obj.group?.should eql(true)
end
end
describe "#add_dir" do
it "adds the group, returns the object" do
group_obj = obj.add_dir("dir1c")
- group_obj.should be_an_instance_of(XCodeProject::PBXGroup)
+ group_obj.should be_an_instance_of(XcodeProject::PBXGroup)
group_obj.dir?.should eql(true)
end
it "adds all dir's children" do
@@ -172,15 +172,15 @@
end
context "if dir doesn't exit" do
it "raise an exception " do
- lambda { obj.add_dir("dir2c_ghost") }.should raise_exception(XCodeProject::FilePathError)
+ lambda { obj.add_dir("dir2c_ghost") }.should raise_exception(XcodeProject::FilePathError)
end
end
end
describe "#create_group" do
context "if passed a group name" do
it "creates and returns the group object" do
- obj.create_group('group2a_ghost').should be_an_instance_of(XCodeProject::PBXGroup)
+ obj.create_group('group2a_ghost').should be_an_instance_of(XcodeProject::PBXGroup)
end
end
context "if passed a group path" do
@@ -190,7 +190,7 @@
'group2a_ghost/group3a_ghost',
'group2a_ghost/../create_group2a_ghost/./group3a_ghost'
].each do |gpath|
- obj.create_group(gpath).should be_an_instance_of(XCodeProject::PBXGroup)
+ obj.create_group(gpath).should be_an_instance_of(XcodeProject::PBXGroup)
end
end
end
@@ -1,6 +1,6 @@
require "spec_helper"
-describe XCodeProject::PBXNativeTarget do
+describe XcodeProject::PBXNativeTarget do
before(:each) { @data = prepare_example_project.read }
let(:obj) { obj = @data.target('example') }
@@ -30,7 +30,7 @@
describe "#build_configurations_list" do
it "returns the build configuration list object" do
- obj.build_configurations_list.should be_an_instance_of(XCodeProject::XCConfigurationList)
+ obj.build_configurations_list.should be_an_instance_of(XcodeProject::XCConfigurationList)
end
end
@@ -1,21 +1,21 @@
require "spec_helper"
-describe XCodeProject::PBXProject do
+describe XcodeProject::PBXProject do
before(:each) { @data = prepare_example_project.read }
let(:obj) { @data.project }
describe "#targets" do
it "returns the array of target objects" do
targets = obj.targets
targets.should be_an_instance_of(Array)
- targets.each {|obj| obj.should be_an_instance_of(XCodeProject::PBXNativeTarget) }
+ targets.each {|obj| obj.should be_an_instance_of(XcodeProject::PBXNativeTarget) }
end
end
describe "#target" do
context "if the target exists" do
it "returns the object" do
- obj.target('example').should be_an_instance_of(XCodeProject::PBXNativeTarget)
+ obj.target('example').should be_an_instance_of(XcodeProject::PBXNativeTarget)
end
end
context "if the target doesn't exist" do
@@ -27,7 +27,7 @@
describe "#main_group" do
it "returns the main group object" do
- obj.main_group.should be_an_instance_of(XCodeProject::PBXGroup)
+ obj.main_group.should be_an_instance_of(XcodeProject::PBXGroup)
end
end
end
Oops, something went wrong.

0 comments on commit 9bdf6c5

Please sign in to comment.